Reimplement IForgeBlockEntity#onLoad() hook (#7946)

This commit is contained in:
Dennis C authored and GitHub committed 2021-10-07 13:31:56 -07:00
1 parent 9944a8252a
commit 6125ec3bc8
5 files changed
+155 -6

No files matched your search

@@ -26,6 +26,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.phys.AABB;
import net.minecraft.core.BlockPos;
import net.minecraft.world.phys.shapes.VoxelShape;
@@ -87,7 +88,8 @@ public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
default void onChunkUnloaded(){}
/**
* Called when this is first added to the world (by {@link World#addTileEntity(TileEntity)}).
* Called when this is first added to the world (by {@link LevelChunk#addAndRegisterBlockEntity(BlockEntity)})
* or right before the first tick when the chunk is generated or loaded from disk.
* Override instead of adding {@code if (firstTick)} stuff in update.
*/
default void onLoad()