Contents
Class RoleChangeSystem
java.lang.Object
com.hypixel.hytale.component.system.System<EntityStore>
com.hypixel.hytale.component.system.tick.TickingSystem<EntityStore>
com.hypixel.hytale.server.npc.systems.RoleChangeSystem
- All Implemented Interfaces:
ISystem<EntityStore>, TickableSystem<EntityStore>
Handles the processing of
RoleChangeSystem.RoleChangeRequests once per tick so that the NPC is reinitialised with the new Role.
Role changes can be requested by calling requestRoleChange(Ref, Role, int, boolean, Store).
Should be set as the last NPC system to run in a tick.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA resource that handles the changing of roles for NPC entities -
Field Summary
Fields inherited from interface ISystem
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionRoleChangeSystem(ResourceType<EntityStore, RoleChangeSystem.RoleChangeQueue> roleChangeQueueResourceType, ComponentType<EntityStore, BeaconSupport> beaconSupportComponentType, ComponentType<EntityStore, PlayerBlockEventSupport> playerBlockEventSupportComponentType, ComponentType<EntityStore, NPCBlockEventSupport> npcBlockEventSupportComponentType, ComponentType<EntityStore, PlayerEntityEventSupport> playerEntityEventSupportComponentType, ComponentType<EntityStore, NPCEntityEventSupport> npcEntityEventSupportComponentType, ComponentType<EntityStore, Timers> timersComponentType, ComponentType<EntityStore, StateEvaluator> stateEvaluatorComponentType, ComponentType<EntityStore, ValueStore> valueStoreComponentType) Default Constructor for aRoleChangeSysteminstance -
Method Summary
Modifier and TypeMethodDescriptionstatic voidrequestRoleChange(Ref<EntityStore> ref, Role role, int roleIndex, boolean changeAppearance, Store<EntityStore> store) Called to request a role change for a specific NPC entitystatic voidrequestRoleChange(Ref<EntityStore> ref, Role role, int roleIndex, boolean changeAppearance, String state, String subState, boolean detachFromSpawning, ComponentAccessor<EntityStore> store) Called to request a role change for a specific NPC entitystatic voidrequestRoleChange(Ref<EntityStore> ref, Role role, int roleIndex, boolean changeAppearance, String state, String subState, ComponentAccessor<EntityStore> store) Called to request a role change for a specific NPC entityvoidtick(float dt, int systemIndex, Store<EntityStore> store) Required reading:CommandBufferMethods inherited from class System
getComponentRegistrations, getResourceRegistrations, registerResource, registerResourceMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISystem
getGroup, onSystemRegistered, onSystemUnregistered
-
Constructor Details
-
RoleChangeSystem
public RoleChangeSystem(@Nonnull ResourceType<EntityStore, RoleChangeSystem.RoleChangeQueue> roleChangeQueueResourceType, @Nonnull ComponentType<EntityStore, BeaconSupport> beaconSupportComponentType, @Nonnull ComponentType<EntityStore, PlayerBlockEventSupport> playerBlockEventSupportComponentType, @Nonnull ComponentType<EntityStore, NPCBlockEventSupport> npcBlockEventSupportComponentType, @Nonnull ComponentType<EntityStore, PlayerEntityEventSupport> playerEntityEventSupportComponentType, @Nonnull ComponentType<EntityStore, NPCEntityEventSupport> npcEntityEventSupportComponentType, @Nonnull ComponentType<EntityStore, Timers> timersComponentType, @Nonnull ComponentType<EntityStore, StateEvaluator> stateEvaluatorComponentType, @Nonnull ComponentType<EntityStore, ValueStore> valueStoreComponentType) Default Constructor for aRoleChangeSysteminstance- Parameters:
roleChangeQueueResourceType- TheRoleChangeSystem.RoleChangeQueueresource typebeaconSupportComponentType- TheBeaconSupportcomponent typeplayerBlockEventSupportComponentType- ThePlayerBlockEventSupportcomponent typenpcBlockEventSupportComponentType- TheNPCBlockEventSupportcomponent typeplayerEntityEventSupportComponentType- ThePlayerEntityEventSupportcomponent typenpcEntityEventSupportComponentType- TheNPCEntityEventSupportcomponent typetimersComponentType- TheTimerscomponent typestateEvaluatorComponentType- TheStateEvaluatorcomponent typevalueStoreComponentType- TheValueStorecomponent type
-
-
Method Details
-
getDependencies
-
tick
Description copied from class:TickingSystem- Specified by:
tickin interfaceTickableSystem<EntityStore>- Specified by:
tickin classTickingSystem<EntityStore>- Parameters:
dt- The delta time in seconds.systemIndex- The index of this system, used for faster lookups inStore.
-
requestRoleChange
public static void requestRoleChange(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, int roleIndex, boolean changeAppearance, @Nonnull Store<EntityStore> store) Called to request a role change for a specific NPC entity- Parameters:
ref- The entity reference of the NPC entity to request a role change forrole- TheRoleinstance to change the NPC toroleIndex- The asset index of the role to change tochangeAppearance-trueif the NPC entities appearance should change,falseotherwisestore- The entity store for component access
-
requestRoleChange
public static void requestRoleChange(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, int roleIndex, boolean changeAppearance, @Nullable String state, @Nullable String subState, @Nonnull ComponentAccessor<EntityStore> store) Called to request a role change for a specific NPC entity- Parameters:
ref- The entity reference of the NPC entity to request a role change forrole- TheRoleinstance to change the NPC toroleIndex- The asset index of the role to change tochangeAppearance-trueif the NPC entities appearance should change,falseotherwisestate- The configured state, ornullif undesiredsubState- The configured substate, ornullif undesiredstore- The entity store for component access
-
requestRoleChange
public static void requestRoleChange(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, int roleIndex, boolean changeAppearance, @Nullable String state, @Nullable String subState, boolean detachFromSpawning, @Nonnull ComponentAccessor<EntityStore> store) Called to request a role change for a specific NPC entity- Parameters:
ref- The entity reference of the NPC entity to request a role change forrole- TheRoleinstance to change the NPC toroleIndex- The asset index of the role to change tochangeAppearance-trueif the NPC entities appearance should change,falseotherwisestate- The configured state, ornullif undesiredsubState- The configured substate, ornullif undesireddetachFromSpawning-trueto remove the NPC from world-spawn population tracking and despawningstore- The entity store for component access
-