InteractionRunSpecificCommand class
Пакет: com.hypixel.hytale.server.core.modules.interaction.commands
Файл: com/hypixel/hytale/server/core/modules/interaction/commands/InteractionRunSpecificCommand.java
extends: AbstractPlayerCommand
Поля (5)
| Модификаторы | Тип | Имя |
|---|---|---|
|
InteractionChain |
var10 |
|
InteractionManager |
var6 |
|
InteractionType |
var7 |
|
RootInteraction |
var8 |
|
InteractionContext |
var9 |
Методы (1)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
|
super super("specific", "server.commands.interaction.runSpecific.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.interaction.commands;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.protocol.InteractionType;
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.RequiredArg;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.EnumArgumentType;
class="kw">import com.hypixel.hytale.server.core.command.system.basecommands.AbstractPlayerCommand;
class="kw">import com.hypixel.hytale.server.core.entity.InteractionChain;
class="kw">import com.hypixel.hytale.server.core.entity.InteractionContext;
class="kw">import com.hypixel.hytale.server.core.entity.InteractionManager;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.InteractionModule;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.RootInteraction;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
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 javax.annotation.Nonnull;
class="kw">public class InteractionRunSpecificCommand class="kw">extends AbstractPlayerCommand {
@Nonnull
class="kw">private class="kw">static class="kw">final EnumArgumentType<InteractionType> INTERACTION_TYPE_ARG_TYPE = new EnumArgumentType<>(
"server.commands.parsing.argtype.interactiontype.name", InteractionType.class
);
@Nonnull
class="kw">private class="kw">final RequiredArg<InteractionType> interactionTypeArg = this.withRequiredArg(
"interactionType", "server.commands.interaction.run.interactionType.desc", INTERACTION_TYPE_ARG_TYPE
);
@Nonnull
class="kw">private class="kw">final RequiredArg<RootInteraction> rootInteractionArg = this.withRequiredArg(
"interaction", "server.commands.interaction.runSpecific.rootinteraction.desc", ArgTypes.ROOT_INTERACTION_ASSET
);
class="kw">public InteractionRunSpecificCommand() {
super("specific", "server.commands.interaction.runSpecific.desc");
}
@Override
class="kw">protected void execute(
@Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
) {
InteractionManager var6 = var2.getComponent(var3, InteractionModule.get().getInteractionManagerComponent());
assert var6 != null;
InteractionType var7 = this.interactionTypeArg.get(var1);
RootInteraction var8 = this.rootInteractionArg.get(var1);
InteractionContext var9 = InteractionContext.forInteraction(var6, var3, var7, var2);
InteractionChain var10 = var6.initChain(var7, var9, var8, false);
var6.queueExecuteChain(var10);
var1.sendMessage(Message.translation("server.commands.interaction.runSpecific.started").param("type", var7.name()).param("root", var8.getId()));
}
}