EntityIntangibleCommand class
Пакет: com.hypixel.hytale.server.core.command.commands.world.entity
Файл: com/hypixel/hytale/server/core/command/commands/world/entity/EntityIntangibleCommand.java
extends: AbstractTargetEntityCommand
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
|
boolean |
var5 |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
for for(Ref var7 : var2) |
|
|
if if(var5) |
abstract |
|
super super("intangible", "server.commands.entity.intangible.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.command.commands.world.entity;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.command.system.CommandContext;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.system.FlagArg;
class="kw">import com.hypixel.hytale.server.core.command.system.basecommands.AbstractTargetEntityCommand;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.Intangible;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.List;
class="kw">import javax.annotation.Nonnull;
class="kw">public class EntityIntangibleCommand class="kw">extends AbstractTargetEntityCommand {
@Nonnull
class="kw">private class="kw">final FlagArg removeFlag = this.withFlagArg("remove", "server.commands.entity.intangible.remove.desc");
class="kw">public EntityIntangibleCommand() {
super("intangible", "server.commands.entity.intangible.desc");
}
@Override
class="kw">protected void execute(@Nonnull CommandContext var1, @Nonnull List<Ref<EntityStore>> var2, @Nonnull World var3, @Nonnull Store<EntityStore> var4) {
boolean var5 = this.removeFlag.provided(var1);
for (Ref var7 : var2) {
if (var5) {
var4.tryRemoveComponent(var7, Intangible.getComponentType());
} else {
var4.ensureComponent(var7, Intangible.getComponentType());
}
}
var1.sendMessage(Message.translation("server.commands.entity.intangible.success." + (var5 ? "unset" : "set")).param("amount", var2.size()));
}
}