InteractionModule class
Пакет: com.hypixel.hytale.server.core.modules.interaction
Файл: com/hypixel/hytale/server/core/modules/interaction/InteractionModule.java
extends: JavaPlugin
Поля (26)
| Модификаторы | Тип | Имя |
|---|---|---|
|
|
instance |
|
EventRegistry |
var1 |
|
InventoryComponent.Utility |
var10 |
|
ItemStack |
var11 |
|
Item |
var12 |
|
Item |
var13 |
|
Item |
var14 |
|
|
var14 |
|
|
var14 |
|
|
var14 |
|
WorldInteraction |
var15 |
|
BlockPosition |
var16 |
|
EntityStore |
var17 |
|
Vector3i |
var18 |
|
Ref |
var19 |
|
|
var19 |
|
|
var19 |
|
ComponentRegistryProxy |
var2 |
|
CameraManager |
var20 |
|
IEventDispatcher |
var21 |
|
IEventDispatcher |
var22 |
|
ComponentType |
var3 |
|
InventoryComponent.Hotbar |
var6 |
|
byte |
var7 |
|
MouseButtonType |
var8 |
|
ItemStack |
var9 |
Методы (13)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
throw new |
UnsupportedOperationExceptionthrow new UnsupportedOperationException() |
public |
void |
doMouseInteractionvoid doMouseInteraction(@Nonnull Ref<EntityStore> var1,
@Nonnull ComponentAccessor<EntityStore> var2,
@Nonnull MouseInteraction var3,
@Nonnull Player var4,
@Nonnull PlayerRef var5) |
public |
ResourceType<ChunkStore, BlockCounter> |
getBlockCounterResourceTypeResourceType<ChunkStore, BlockCounter> getBlockCounterResourceType() |
public |
ComponentType<ChunkStore, TrackedPlacement> |
getTrackedPlacementComponentTypeComponentType<ChunkStore, TrackedPlacement> getTrackedPlacementComponentType() |
static |
void |
handledLoadedInteractionsvoid handledLoadedInteractions(@Nonnull LoadedAssetsEvent<String, Interaction, ?> var0) |
static |
void |
handledLoadedRootInteractionsvoid handledLoadedRootInteractions(@Nonnull LoadedAssetsEvent<String, RootInteraction, ?> var0) |
static |
void |
handledRemovedInteractionsvoid handledRemovedInteractions(@Nonnull RemovedAssetsEvent<String, Interaction, ?> var0) |
|
|
if if(var6 != null) |
|
|
if if(var7 != var3.activeSlot) |
|
|
if if(var8 == MouseButtonType.Left) |
|
|
if if(var15.entityId < 0) |
|
|
if if(var3.mouseButton != null) |
abstract |
|
super super(var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.interaction;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.event.LoadedAssetsEvent;
class="kw">import com.hypixel.hytale.assetstore.event.RemovedAssetsEvent;
class="kw">import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
class="kw">import com.hypixel.hytale.assetstore.map.IndexedLookupTableAssetMap;
class="kw">import com.hypixel.hytale.codec.codecs.EnumCodec;
class="kw">import com.hypixel.hytale.codec.codecs.set.SetCodec;
class="kw">import com.hypixel.hytale.common.plugin.PluginManifest;
class="kw">import com.hypixel.hytale.component.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.ComponentRegistryProxy;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.ResourceType;
class="kw">import com.hypixel.hytale.event.EventRegistry;
class="kw">import com.hypixel.hytale.event.IEventDispatcher;
class="kw">import com.hypixel.hytale.protocol.BlockPosition;
class="kw">import com.hypixel.hytale.protocol.InteractionType;
class="kw">import com.hypixel.hytale.protocol.MouseButtonType;
class="kw">import com.hypixel.hytale.protocol.WorldInteraction;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.CustomPageLifetime;
class="kw">import com.hypixel.hytale.protocol.packets.player.MouseInteraction;
class="kw">import com.hypixel.hytale.server.core.HytaleServer;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.asset.HytaleAssetStore;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.BlockType;
class="kw">import com.hypixel.hytale.server.core.asset.type.entityeffect.config.EntityEffect;
class="kw">import com.hypixel.hytale.server.core.asset.type.item.config.Item;
class="kw">import com.hypixel.hytale.server.core.asset.type.itemanimation.config.ItemPlayerAnimations;
class="kw">import com.hypixel.hytale.server.core.asset.type.model.config.ModelAsset;
class="kw">import com.hypixel.hytale.server.core.asset.type.particle.config.ParticleSystem;
class="kw">import com.hypixel.hytale.server.core.asset.type.soundevent.config.SoundEvent;
class="kw">import com.hypixel.hytale.server.core.asset.type.trail.config.Trail;
class="kw">import com.hypixel.hytale.server.core.entity.InteractionManager;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.CameraManager;
class="kw">import com.hypixel.hytale.server.core.event.events.player.PlayerDisconnectEvent;
class="kw">import com.hypixel.hytale.server.core.event.events.player.PlayerMouseButtonEvent;
class="kw">import com.hypixel.hytale.server.core.event.events.player.PlayerMouseMotionEvent;
class="kw">import com.hypixel.hytale.server.core.inventory.InventoryComponent;
class="kw">import com.hypixel.hytale.server.core.inventory.ItemStack;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.modules.entity.hitboxcollision.HitboxCollisionConfig;
class="kw">import com.hypixel.hytale.server.core.modules.entity.spectator.SpectateControlInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.entity.tracker.EntityTrackerSystems;
class="kw">import com.hypixel.hytale.server.core.modules.entitystats.asset.EntityStatType;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.blocktrack.BlockCounter;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.blocktrack.TrackedPlacement;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.breakshape.BoxBreakShape;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.breakshape.BreakShape;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.breakshape.CylinderBreakShape;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.commands.InteractionCommand;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.components.CarriedBlock;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.components.CarriedBlockSystems;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.components.PlacedByInteractionComponent;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.host.InteractionHost;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.host.InteractionHostCleanupSystem;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.InteractionPacketGenerator;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.RootInteractionPacketGenerator;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.UnarmedInteractions;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.UnarmedInteractionsPacketGenerator;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.Interaction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.RootInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.SimpleInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.AddItemInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ApplyForceInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.BlockConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.BreakBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ChainingInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ChangeBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ChangeStateInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ChargingInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.CooldownConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.CycleBlockGroupInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.DestroyBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.DragEraseBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.DragPlaceBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ExplodeInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ExtrudePlaceBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.FirstClickInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.IncrementCooldownInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.MovementConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.PickBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.PlaceBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.PlaceFluidInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ResetCooldownInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.SurfaceDrawPlaceBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ToggleGliderInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.TriggerCooldownInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.UseBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.UseEntityInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.WieldingInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.BuilderToolInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.CameraInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.CancelChainInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.ChainFlagInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.ChangeActiveSlotInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.ConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.DurabilityConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.EffectConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.ParallelInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.PlaceModeSelectInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.RepeatInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.ReplaceInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.RunRootInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.SelectInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.SerialInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.StatsConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.StatsConditionWithModifierInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.simple.ApplyEffectInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.simple.RemoveEntityInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.none.simple.SendMessageInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.AOECircleSelector;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.AOECylinderSelector;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.DonutSelector;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.HorizontalSelector;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.PlayerMatcher;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.RaycastSelector;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.SelectorType;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.StabSelector;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.selector.VulnerableMatcher;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.CarryBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.CarryDroppedBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.CarryPlaceBlockInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.ChangeStatInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.ChangeStatWithModifierInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.CheckUniqueItemUsageInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.ClearEntityEffectInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.DamageEntityInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.DoorInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.EquipItemInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.IncreaseBackpackCapacityInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.InterruptInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.LaunchPadInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.LaunchProjectileInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.ModifyInventoryInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.OpenContainerInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.OpenCustomUIInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.OpenItemStackContainerInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.OpenPageInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.PlacementCountConditionInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.RefillContainerInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.RevealMapMarkersInViewInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.RunOnBlockTypesInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.ShowEventTitleInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.SpawnPrefabInteraction;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.combat.DirectionalKnockback;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.combat.ForceKnockback;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.combat.Knockback;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.combat.PointKnockback;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.suppliers.ItemRepairPageSupplier;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.system.InteractionSystems;
class="kw">import com.hypixel.hytale.server.core.plugin.JavaPlugin;
class="kw">import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
class="kw">import com.hypixel.hytale.server.core.universe.world.meta.state.LaunchPad;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.EnumSet;
class="kw">import java.util.List;
class="kw">import java.util.Map.Entry;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector2d;
class="kw">import org.joml.Vector3i;
class="kw">public class InteractionModule class="kw">extends JavaPlugin {
@Nonnull
class="kw">public class="kw">static class="kw">final PluginManifest MANIFEST = PluginManifest.corePlugin(InteractionModule.class).depends(EntityModule.class).build();
@Nonnull
class="kw">public class="kw">static class="kw">final EnumCodec<InteractionType> INTERACTION_TYPE_CODEC = new EnumCodec<>(InteractionType.class);
@Nonnull
class="kw">public class="kw">static class="kw">final SetCodec<InteractionType, EnumSet<InteractionType>> INTERACTION_TYPE_SET_CODEC = new SetCodec<>(
INTERACTION_TYPE_CODEC, () -> EnumSet.noneOf(InteractionType.class), true
);
class="kw">private class="kw">static InteractionModule instance;
class="kw">private ComponentType<EntityStore, InteractionManager> interactionManagerComponent;
class="kw">private ComponentType<EntityStore, InteractionHost> interactionHostComponentType;
class="kw">private ComponentType<EntityStore, ChainingInteraction.Data> chainingDataComponent;
class="kw">private ComponentType<EntityStore, Interactions> interactionsComponentType;
class="kw">private ComponentType<ChunkStore, PlacedByInteractionComponent> placedByComponentType;
class="kw">private ComponentType<EntityStore, CarriedBlock> carriedBlockComponentType;
class="kw">private ResourceType<EntityStore, CarriedBlockSystems.QueueResource> carriedBlockQueueResourceType;
class="kw">private ResourceType<ChunkStore, BlockCounter> blockCounterResourceType;
class="kw">private ComponentType<ChunkStore, TrackedPlacement> trackedPlacementComponentType;
@Nonnull
class="kw">public class="kw">static InteractionModule get() {
class="kw">return instance;
}
class="kw">public InteractionModule(@Nonnull JavaPluginInit var1) {
super(var1);
instance = this;
}
@Override
class="kw">protected void setup() {
EventRegistry var1 = this.getEventRegistry();
ComponentRegistryProxy var2 = this.getEntityStoreRegistry();
this.getCommandRegistry().registerCommand(new InteractionCommand());
AssetRegistry.register(
((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)HytaleAssetStore.builder(
UnarmedInteractions.class, new DefaultAssetMap()
)
.setPath("Item/Unarmed/Interactions"))
.setCodec(UnarmedInteractions.CODEC))
.setKeyFunction(UnarmedInteractions::getId))
.loadsAfter(RootInteraction.class))
.setPacketGenerator(new UnarmedInteractionsPacketGenerator())
.build()
);
AssetRegistry.register(
((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)HytaleAssetStore.builder(
Interaction.class, new IndexedLookupTableAssetMap<>(Interaction[]::new)
)
.setPath("Item/Interactions"))
.setCodec(Interaction.CODEC))
.setKeyFunction(Interaction::getId))
.setReplaceOnRemove(var0 -> new SendMessageInteraction(var0, "Missing interaction: " + var0)))
.setIsUnknown(Interaction::isUnknown))
.setPacketGenerator(new InteractionPacketGenerator())
.loadsAfter(
EntityStatType.class,
EntityEffect.class,
Trail.class,
ItemPlayerAnimations.class,
SoundEvent.class,
ParticleSystem.class,
ModelAsset.class,
HitboxCollisionConfig.class
))
.preLoadAssets(List.of(ChangeActiveSlotInteraction.DEFAULT_INTERACTION)))
.build()
);
AssetRegistry.register(
((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)HytaleAssetStore.builder(
RootInteraction.class, new IndexedLookupTableAssetMap<>(RootInteraction[]::new)
)
.setPath("Item/RootInteractions"))
.setCodec(RootInteraction.CODEC))
.setKeyFunction(RootInteraction::getId))
.setReplaceOnRemove(var0 -> new RootInteraction(var0)))
.setPacketGenerator(new RootInteractionPacketGenerator())
.loadsAfter(Interaction.class))
.loadsBefore(BlockType.class, Item.class))
.preLoadAssets(List.of(ChangeActiveSlotInteraction.DEFAULT_ROOT)))
.build()
);
this.interactionManagerComponent = this.getEntityStoreRegistry().registerComponent(InteractionManager.class, () -> {
throw new UnsupportedOperationException();
});
this.interactionHostComponentType = this.getEntityStoreRegistry().registerComponent(InteractionHost.class, InteractionHost::new);
this.interactionsComponentType = this.getEntityStoreRegistry().registerComponent(Interactions.class, "Interactions", Interactions.CODEC);
this.placedByComponentType = this.getChunkStoreRegistry()
.registerComponent(PlacedByInteractionComponent.class, "PlacedByInteraction", PlacedByInteractionComponent.CODEC);
this.carriedBlockComponentType = this.getEntityStoreRegistry().registerComponent(CarriedBlock.class, "CarriedBlock", CarriedBlock.CODEC);
Interaction.CODEC.register("Simple", SimpleInteraction.class, SimpleInteraction.CODEC);
Interaction.CODEC.register("PlaceBlock", PlaceBlockInteraction.class, PlaceBlockInteraction.CODEC);
Interaction.CODEC.register("DragPlaceBlock", DragPlaceBlockInteraction.class, DragPlaceBlockInteraction.CODEC);
Interaction.CODEC.register("ExtrudePlaceBlock", ExtrudePlaceBlockInteraction.class, ExtrudePlaceBlockInteraction.CODEC);
Interaction.CODEC.register("SurfaceDrawPlaceBlock", SurfaceDrawPlaceBlockInteraction.class, SurfaceDrawPlaceBlockInteraction.CODEC);
Interaction.CODEC.register("DragEraseBlock", DragEraseBlockInteraction.class, DragEraseBlockInteraction.CODEC);
Interaction.CODEC.register("PlaceModeSelect", PlaceModeSelectInteraction.class, PlaceModeSelectInteraction.CODEC);
Interaction.CODEC.register("PlaceFluid", PlaceFluidInteraction.class, PlaceFluidInteraction.CODEC);
Interaction.CODEC.register("BreakBlock", BreakBlockInteraction.class, BreakBlockInteraction.CODEC);
Interaction.CODEC.register("PickBlock", PickBlockInteraction.class, PickBlockInteraction.CODEC);
Interaction.CODEC.register("UseBlock", UseBlockInteraction.class, UseBlockInteraction.CODEC);
Interaction.CODEC.register("BlockCondition", BlockConditionInteraction.class, BlockConditionInteraction.CODEC);
Interaction.CODEC.register("ChangeBlock", ChangeBlockInteraction.class, ChangeBlockInteraction.CODEC);
Interaction.CODEC.register("ChangeState", ChangeStateInteraction.class, ChangeStateInteraction.CODEC);
Interaction.CODEC.register("UseEntity", UseEntityInteraction.class, UseEntityInteraction.CODEC);
Interaction.CODEC.register("BuilderTool", BuilderToolInteraction.class, BuilderToolInteraction.CODEC);
Interaction.CODEC.register("ModifyInventory", ModifyInventoryInteraction.class, ModifyInventoryInteraction.CODEC);
Interaction.CODEC.register("Charging", ChargingInteraction.class, ChargingInteraction.CODEC);
Interaction.CODEC.register("DestroyBlock", DestroyBlockInteraction.class, DestroyBlockInteraction.CODEC);
Interaction.CODEC.register("CycleBlockGroup", CycleBlockGroupInteraction.class, CycleBlockGroupInteraction.CODEC);
Interaction.CODEC.register("CarryBlock", CarryBlockInteraction.class, CarryBlockInteraction.CODEC);
Interaction.CODEC.register("CarryPlaceBlock", CarryPlaceBlockInteraction.class, CarryPlaceBlockInteraction.CODEC);
Interaction.CODEC.register("CarryDroppedBlock", CarryDroppedBlockInteraction.class, CarryDroppedBlockInteraction.CODEC);
Interaction.CODEC.register("Explode", ExplodeInteraction.class, ExplodeInteraction.CODEC);
Interaction.CODEC.register("Chaining", ChainingInteraction.class, ChainingInteraction.CODEC);
Interaction.CODEC.register("ChainFlag", ChainFlagInteraction.class, ChainFlagInteraction.CODEC);
Interaction.CODEC.register("CancelChain", CancelChainInteraction.class, CancelChainInteraction.CODEC);
this.chainingDataComponent = this.getEntityStoreRegistry().registerComponent(ChainingInteraction.Data.class, ChainingInteraction.Data::new);
Interaction.CODEC.register("Condition", ConditionInteraction.class, ConditionInteraction.CODEC);
Interaction.CODEC.register("FirstClick", FirstClickInteraction.class, FirstClickInteraction.CODEC);
Interaction.CODEC.register("Repeat", RepeatInteraction.class, RepeatInteraction.CODEC);
Interaction.CODEC.register("Parallel", ParallelInteraction.class, ParallelInteraction.CODEC);
Interaction.CODEC.register("Serial", SerialInteraction.class, SerialInteraction.CODEC);
Interaction.CODEC.register("ChangeActiveSlot", ChangeActiveSlotInteraction.class, ChangeActiveSlotInteraction.CODEC);
Interaction.CODEC.register("Selector", SelectInteraction.class, SelectInteraction.CODEC);
Interaction.CODEC.register("DamageEntity", DamageEntityInteraction.class, DamageEntityInteraction.CODEC);
Interaction.CODEC.register("LaunchProjectile", LaunchProjectileInteraction.class, LaunchProjectileInteraction.CODEC);
Interaction.CODEC.register("Wielding", WieldingInteraction.class, WieldingInteraction.CODEC);
Interaction.CODEC.register("Replace", ReplaceInteraction.class, ReplaceInteraction.CODEC);
Interaction.CODEC.register("StatsCondition", StatsConditionInteraction.class, StatsConditionInteraction.CODEC);
Interaction.CODEC.register("StatsConditionWithModifier", StatsConditionWithModifierInteraction.class, StatsConditionWithModifierInteraction.CODEC);
Interaction.CODEC.register("DurabilityCondition", DurabilityConditionInteraction.class, DurabilityConditionInteraction.CODEC);
Interaction.CODEC.register("SpawnPrefab", SpawnPrefabInteraction.class, SpawnPrefabInteraction.CODEC);
Interaction.CODEC.register("RevealMapMarkersInView", RevealMapMarkersInViewInteraction.class, RevealMapMarkersInViewInteraction.CODEC);
Interaction.CODEC.register("SendMessage", SendMessageInteraction.class, SendMessageInteraction.CODEC);
Interaction.CODEC.register("ShowEventTitle", ShowEventTitleInteraction.class, ShowEventTitleInteraction.CODEC);
Interaction.CODEC.register("SpectateControl", SpectateControlInteraction.class, SpectateControlInteraction.CODEC);
Interaction.CODEC.register("EquipItem", EquipItemInteraction.class, EquipItemInteraction.CODEC);
Interaction.CODEC.register("RefillContainer", RefillContainerInteraction.class, RefillContainerInteraction.CODEC);
Interaction.CODEC.register("Door", DoorInteraction.class, DoorInteraction.CODEC);
Interaction.CODEC.register("IncreaseBackpackCapacity", IncreaseBackpackCapacityInteraction.class, IncreaseBackpackCapacityInteraction.CODEC);
Interaction.CODEC.register("CheckUniqueItemUsage", CheckUniqueItemUsageInteraction.class, CheckUniqueItemUsageInteraction.CODEC);
Interaction.CODEC.register("LaunchPad", LaunchPadInteraction.class, LaunchPadInteraction.CODEC);
Interaction.CODEC.register("OpenContainer", OpenContainerInteraction.class, OpenContainerInteraction.CODEC);
Interaction.CODEC.register("OpenItemStackContainer", OpenItemStackContainerInteraction.class, OpenItemStackContainerInteraction.CODEC);
Interaction.CODEC.register("OpenCustomUI", OpenCustomUIInteraction.class, OpenCustomUIInteraction.CODEC);
Interaction.CODEC.register("OpenPage", OpenPageInteraction.class, OpenPageInteraction.CODEC);
Interaction.CODEC.register("ApplyEffect", ApplyEffectInteraction.class, ApplyEffectInteraction.CODEC);
Interaction.CODEC.register("ClearEntityEffect", ClearEntityEffectInteraction.class, ClearEntityEffectInteraction.CODEC);
Interaction.CODEC.register("RemoveEntity", RemoveEntityInteraction.class, RemoveEntityInteraction.CODEC);
Interaction.CODEC.register("EffectCondition", EffectConditionInteraction.class, EffectConditionInteraction.CODEC);
Interaction.CODEC.register("ApplyForce", ApplyForceInteraction.class, ApplyForceInteraction.CODEC);
Interaction.CODEC.register("ChangeStat", ChangeStatInteraction.class, ChangeStatInteraction.CODEC);
Interaction.CODEC.register("ChangeStatWithModifier", ChangeStatWithModifierInteraction.class, ChangeStatWithModifierInteraction.CODEC);
Interaction.CODEC.register("MovementCondition", MovementConditionInteraction.class, MovementConditionInteraction.CODEC);
Interaction.CODEC.register("ResetCooldown", ResetCooldownInteraction.class, ResetCooldownInteraction.CODEC);
Interaction.CODEC.register("TriggerCooldown", TriggerCooldownInteraction.class, TriggerCooldownInteraction.CODEC);
Interaction.CODEC.register("CooldownCondition", CooldownConditionInteraction.class, CooldownConditionInteraction.CODEC);
Interaction.CODEC.register("IncrementCooldown", IncrementCooldownInteraction.class, IncrementCooldownInteraction.CODEC);
Interaction.CODEC.register("AddItem", AddItemInteraction.class, AddItemInteraction.CODEC);
Interaction.CODEC.register("Interrupt", InterruptInteraction.class, InterruptInteraction.CODEC);
Interaction.CODEC.register("RunRootInteraction", RunRootInteraction.class, RunRootInteraction.CODEC);
Interaction.CODEC.register("RunOnBlockTypes", RunOnBlockTypesInteraction.class, RunOnBlockTypesInteraction.CODEC);
Interaction.CODEC.register("Camera", CameraInteraction.class, CameraInteraction.CODEC);
Interaction.CODEC.register("ToggleGlider", ToggleGliderInteraction.class, ToggleGliderInteraction.CODEC);
OpenCustomUIInteraction.registerBlockEntityCustomPage(
this,
LaunchPad.LaunchPadSettingsPage.class,
"LaunchPad",
(var0, var1x) -> var1x.getStore().getArchetype(var1x).contains(LaunchPad.getComponentType())
? new LaunchPad.LaunchPadSettingsPage(var0, var1x, CustomPageLifetime.CanDismissOrCloseThroughInteraction)
: null
);
OpenCustomUIInteraction.PAGE_CODEC.register("ItemRepair", ItemRepairPageSupplier.class, ItemRepairPageSupplier.CODEC);
SelectorType.CODEC.register("Horizontal", HorizontalSelector.class, HorizontalSelector.CODEC);
SelectorType.CODEC.register("Stab", StabSelector.class, StabSelector.CODEC);
SelectorType.CODEC.register("AOECircle", AOECircleSelector.class, AOECircleSelector.CODEC);
SelectorType.CODEC.register("AOECylinder", AOECylinderSelector.class, AOECylinderSelector.CODEC);
SelectorType.CODEC.register("Raycast", RaycastSelector.class, RaycastSelector.CODEC);
SelectorType.CODEC.register("Donut", DonutSelector.class, DonutSelector.CODEC);
BreakShape.CODEC.register("Box", BoxBreakShape.class, BoxBreakShape.CODEC);
BreakShape.CODEC.register("Cylinder", CylinderBreakShape.class, CylinderBreakShape.CODEC);
Knockback.CODEC.register("Directional", DirectionalKnockback.class, DirectionalKnockback.CODEC);
Knockback.CODEC.register("Point", PointKnockback.class, PointKnockback.CODEC);
Knockback.CODEC.register("Force", ForceKnockback.class, ForceKnockback.CODEC);
var1.register(LoadedAssetsEvent.class, RootInteraction.class, InteractionModule::handledLoadedRootInteractions);
var1.register(LoadedAssetsEvent.class, Interaction.class, InteractionModule::handledLoadedInteractions);
var1.register(RemovedAssetsEvent.class, Interaction.class, InteractionModule::handledRemovedInteractions);
var1.register(PlayerDisconnectEvent.class, CarriedBlockSystems::onPlayerDisconnect);
var2.registerSystem(new CarriedBlockSystems.DropOnDeath());
ComponentType var3 = EntityTrackerSystems.Visible.getComponentType();
this.carriedBlockQueueResourceType = var2.registerResource(CarriedBlockSystems.QueueResource.class, CarriedBlockSystems.QueueResource::new);
var2.registerSystem(new CarriedBlockSystems.OnPlayerCarryBlockComponentChange());
var2.registerSystem(new CarriedBlockSystems.ApplyDroppedBlockEntityEffect());
var2.registerSystem(new CarriedBlockSystems.EntityTrackerUpdate(var3));
var2.registerSystem(new CarriedBlockSystems.EntityTrackerAddAndRemove(var3));
var2.registerSystem(new InteractionSystems.PlayerAddManagerSystem());
var2.registerSystem(new InteractionSystems.CleanUpSystem());
var2.registerSystem(new InteractionSystems.TickInteractionManagerSystem());
var2.registerSystem(new InteractionHostCleanupSystem(this.interactionHostComponentType));
var2.registerSystem(new InteractionSystems.TrackerTickSystem());
var2.registerSystem(new InteractionSystems.EntityTrackerRemove(EntityTrackerSystems.Visible.getComponentType()));
var2.registerSystem(new InteractionSystems.DropUnresolvedInteractions());
this.getCodecRegistry(SelectInteraction.EntityMatcher.CODEC).register("Vulnerable", VulnerableMatcher.class, VulnerableMatcher.CODEC);
this.getCodecRegistry(SelectInteraction.EntityMatcher.CODEC).register("Player", PlayerMatcher.class, PlayerMatcher.CODEC);
this.blockCounterResourceType = this.getChunkStoreRegistry().registerResource(BlockCounter.class, "BlockCounter", BlockCounter.CODEC);
this.trackedPlacementComponentType = this.getChunkStoreRegistry().registerComponent(TrackedPlacement.class, "TrackedPlacement", TrackedPlacement.CODEC);
this.getChunkStoreRegistry().registerSystem(new TrackedPlacement.OnAddRemove());
this.getCodecRegistry(Interaction.CODEC)
.register("PlacementCountCondition", PlacementCountConditionInteraction.class, PlacementCountConditionInteraction.CODEC);
}
class="kw">private class="kw">static void handledLoadedRootInteractions(@Nonnull LoadedAssetsEvent<String, RootInteraction, ?> var0) {
for (RootInteraction var2 : var0.getLoadedAssets().values()) {
var2.build();
}
}
class="kw">private class="kw">static void handledLoadedInteractions(@Nonnull LoadedAssetsEvent<String, Interaction, ?> var0) {
for (Entry var2 : RootInteraction.getAssetMap().getAssetMap().entrySet()) {
var2.getValue().build(var0.getLoadedAssets().keySet());
}
}
class="kw">private class="kw">static void handledRemovedInteractions(@Nonnull RemovedAssetsEvent<String, Interaction, ?> var0) {
for (Entry var2 : RootInteraction.getAssetMap().getAssetMap().entrySet()) {
var2.getValue().build(var0.getRemovedAssets());
}
}
class="kw">public void doMouseInteraction(
@Nonnull Ref<EntityStore> var1,
@Nonnull ComponentAccessor<EntityStore> var2,
@Nonnull MouseInteraction var3,
@Nonnull Player var4,
@Nonnull PlayerRef var5
) {
if (!this.isDisabled()) {
InventoryComponent.Hotbar var6 = var2.getComponent(var1, InventoryComponent.Hotbar.getComponentType());
if (var6 != null) {
byte var7 = var6.getActiveSlot();
if (var7 != var3.activeSlot) {
var5.sendMessage(Message.translation("server.modules.interaction.failedGetActiveSlot").param("server", var7).param("packet", var3.activeSlot));
} else {
MouseButtonType var8 = var3.mouseButton != null ? var3.mouseButton.mouseButtonType : MouseButtonType.Left;
ItemStack var9 = InventoryComponent.getItemInHand(var2, var1);
InventoryComponent.Utility var10 = var2.getComponent(var1, InventoryComponent.Utility.getComponentType());
ItemStack var11 = var10 != null ? var10.getActiveItem() : null;
Item var12 = var9 != null && !var9.isEmpty() ? var9.getItem() : null;
Item var13 = var11 != null && !var11.isEmpty() ? var11.getItem() : null;
Item var14;
if (var8 == MouseButtonType.Left) {
var14 = var12;
} else if (var8 == MouseButtonType.Right && var13 != null) {
var14 = var13;
} else {
var14 = var12;
}
WorldInteraction var15 = var3.worldInteraction;
BlockPosition var16 = var15.blockPosition;
if (var1.isValid()) {
EntityStore var17 = var2.getExternalData();
Vector3i var18 = var16 == null ? null : new Vector3i(var16.x, var16.y, var16.z);
Ref var19;
if (var15.entityId < 0) {
var19 = null;
} else {
var19 = var17.getRefFromNetworkId(var15.entityId);
}
CameraManager var20 = var2.getComponent(var1, CameraManager.getComponentType());
assert var20 != null;
if (var3.mouseButton != null) {
IEventDispatcher var21 = HytaleServer.get().getEventBus().dispatchFor(PlayerMouseButtonEvent.class);
if (var21.hasListener()) {
var21.dispatch(
new PlayerMouseButtonEvent(var1, var4, var5, var3.clientTimestamp, var14, var18, var19, var3.screenPoint, var3.mouseButton)
);
}
var20.handleMouseButtonState(var3.mouseButton.mouseButtonType, var3.mouseButton.state, var18);
} else {
IEventDispatcher var22 = HytaleServer.get().getEventBus().dispatchFor(PlayerMouseMotionEvent.class);
if (var22.hasListener()) {
var22.dispatch(new PlayerMouseMotionEvent(var1, var4, var3.clientTimestamp, var14, var18, var19, var3.screenPoint, var3.mouseMotion));
}
}
var20.setLastScreenPoint(new Vector2d(var3.screenPoint.x(), var3.screenPoint.y()));
var20.setLastBlockPosition(var18);
}
}
}
}
}
@Nonnull
class="kw">public ComponentType<EntityStore, ChainingInteraction.Data> getChainingDataComponent() {
class="kw">return this.chainingDataComponent;
}
@Nonnull
class="kw">public ComponentType<EntityStore, Interactions> getInteractionsComponentType() {
class="kw">return this.interactionsComponentType;
}
@Nonnull
class="kw">public ComponentType<EntityStore, InteractionManager> getInteractionManagerComponent() {
class="kw">return this.interactionManagerComponent;
}
@Nonnull
class="kw">public ComponentType<EntityStore, InteractionHost> getInteractionHostComponentType() {
class="kw">return this.interactionHostComponentType;
}
@Nonnull
class="kw">public ComponentType<ChunkStore, PlacedByInteractionComponent> getPlacedByComponentType() {
class="kw">return this.placedByComponentType;
}
@Nonnull
class="kw">public ComponentType<EntityStore, CarriedBlock> getCarriedBlockComponentType() {
class="kw">return this.carriedBlockComponentType;
}
@Nonnull
class="kw">public ResourceType<EntityStore, CarriedBlockSystems.QueueResource> getCarriedBlockQueueResourceType() {
class="kw">return this.carriedBlockQueueResourceType;
}
class="kw">public ResourceType<ChunkStore, BlockCounter> getBlockCounterResourceType() {
class="kw">return this.blockCounterResourceType;
}
class="kw">public ComponentType<ChunkStore, TrackedPlacement> getTrackedPlacementComponentType() {
class="kw">return this.trackedPlacementComponentType;
}
}