Package com.simibubi.create.api.event
Class TileEntityBehaviourEvent<T extends SmartTileEntity>
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.GenericEvent<T>
com.simibubi.create.api.event.TileEntityBehaviourEvent<T>
- All Implemented Interfaces:
net.minecraftforge.eventbus.api.IGenericEvent<T>
public class TileEntityBehaviourEvent<T extends SmartTileEntity>
extends net.minecraftforge.eventbus.api.GenericEvent<T>
Event that is fired just before a SmartTileEntity is being deserialized
Also if a new one is placed
Use it to attach a new
Actual setup of the behaviours internal workings and data should be done in TileEntityBehaviour#read() and TileEntityBehaviour#initialize() respectively.
Because of the earliness of this event, the added behaviours will have access to the initial NBT read (unless the TE was placed, not loaded), thereby allowing tiles to store and retrieve data for injected behaviours.
Also if a new one is placed
Use it to attach a new
TileEntityBehaviour or replace existing ones
(with caution)Actual setup of the behaviours internal workings and data should be done in TileEntityBehaviour#read() and TileEntityBehaviour#initialize() respectively.
Because of the earliness of this event, the added behaviours will have access to the initial NBT read (unless the TE was placed, not loaded), thereby allowing tiles to store and retrieve data for injected behaviours.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionTileEntityBehaviourEvent(T tileEntity, Map<BehaviourType<?>, TileEntityBehaviour> behaviours) -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(TileEntityBehaviour behaviour) net.minecraft.world.level.block.state.BlockStateremove(BehaviourType<?> type) Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Constructor Details
-
TileEntityBehaviourEvent
-
-
Method Details
-
getGenericType
- Specified by:
getGenericTypein interfacenet.minecraftforge.eventbus.api.IGenericEvent<T extends SmartTileEntity>- Overrides:
getGenericTypein classnet.minecraftforge.eventbus.api.GenericEvent<T extends SmartTileEntity>
-
attach
-
remove
-
getTileEntity
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState()
-