BlockInteractionUtils class
Пакет: com.hypixel.hytale.server.core.modules.interaction
Файл: com/hypixel/hytale/server/core/modules/interaction/BlockInteractionUtils.java
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
Player |
var2 |
|
Player |
var2 |
|
PlayerSettings |
var3 |
Методы (4)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
if if(var0 == null) |
|
|
if if(var0 == null) |
static |
boolean |
isNaturalActionboolean isNaturalAction(@Nullable Ref<EntityStore> var0, @Nonnull ComponentAccessor<EntityStore> var1) |
static |
boolean |
isNoPhysicsboolean isNoPhysics(@Nullable Ref<EntityStore> var0, @Nonnull ComponentAccessor<EntityStore> var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.interaction;
class="kw">import com.hypixel.hytale.component.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.protocol.GameMode;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.modules.entity.player.PlayerSettings;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class BlockInteractionUtils {
class="kw">public BlockInteractionUtils() {
}
class="kw">public class="kw">static boolean isNaturalAction(@Nullable Ref<EntityStore> var0, @Nonnull ComponentAccessor<EntityStore> var1) {
if (var0 == null) {
class="kw">return true;
}
Player var2 = var1.getComponent(var0, Player.getComponentType());
class="kw">return var2 != null ? var2.getGameMode() == GameMode.Adventure : true;
}
class="kw">public class="kw">static boolean isNoPhysics(@Nullable Ref<EntityStore> var0, @Nonnull ComponentAccessor<EntityStore> var1) {
if (var0 == null) {
class="kw">return false;
} else {
Player var2 = var1.getComponent(var0, Player.getComponentType());
if (var2 != null && var2.getGameMode() == GameMode.Creative) {
PlayerSettings var3 = var1.getComponent(var0, PlayerSettings.getComponentType());
class="kw">return var3 != null && var3.creativeSettings().noPhysics();
} else {
class="kw">return false;
}
}
}
}