mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-09-20 12:41:35 +02:00
Page:
Attaching TileEntity Behaviours
Pages
0.0.x
0.1.1
0.1.1a
0.1
0.2.1
0.2.2
0.2.2a
0.2.2b
0.2.3
0.2.4
0.2.4a
0.2.4b
0.2.4c
0.2.4d
0.2.4e
0.2
0.3.1
0.3.1a
0.3.1b
0.3.1c
0.3.2
0.3.2a
0.3.2b
0.3.2c
0.3.2d
0.3.2e & f
0.3.2g
0.3
0.3a
0.3b
0.3c
0.3d
0.3e
0.4.1
0.4
0.4a
0.4b
0.4c
0.4d
0.4e
0.4f
0.5.1
0.5.1b
0.5.1c
0.5.1e
0.5.1f
0.5.1g & h
0.5
0.5a
0.5b & c
0.5d
0.5e
0.5f
0.5g
0.5h
0.5i
API Reference
Analog Lever
Andesite Alloy
Attaching TileEntity Behaviours
Basin
Blaze Burner
Blaze Cake
Brass
Changes
Changing Gears
Chute
Cogwheel
ComputerCraft Integration
Content Observer
Copper
Crafting Components
Create's Materials
Create Contraptions
Create Curiosities
Create Logistics
Create Palettes
Create Schematics
Crushing Wheels
Cuckoo Clock
Custom Potato Cannon Projectile Types
Custom Recipes
Custom Spout Interaction
Deforester
Depending on Create
Deployer
Depot
Display Link (Peripheral)
Empty Schematic
Encased Fan
Engineer's Goggles
Filter
Fluid Pipe
Funnel
Generate and Convey
Handheld Blockzapper
Handheld Worldshaper
Home
Internal Ponder UI
Item Drain
Loading a Schematic
Mechanical Arm
Mechanical Belt
Mechanical Crafter
Mechanical Drill
Mechanical Harvester
Mechanical Mixer
Mechanical Plough
Mechanical Press
Mechanical Pump
Mechanical Saw
Millstone
Moving Contraptions
Open Ended Pipe Effect Handlers
Portable Storage Interface
Printing a Schematic
Redstone Utility
Removed Features
Renewable Resources
Rotating Appliances
Rotation Speed Controller (Peripheral)
Rotation Speed Controller
Sand Paper
Saving a Schematic
Schematic Table
Schematic and Quill
Schematic
Schematicannon
Seat
Sequenced Gearshift (Peripheral)
Shaft
Speedometer (Peripheral)
Spout
Stress Units, Capacity and Impact
Stressometer (Peripheral)
Supporting the Project
The Basics of Rotation in Create
Train Schedule (ComputerCraft)
Train Station (Peripheral)
Tree Fertilizer
Troubleshooting
Useful Tags
Wand of Symmetry
Waterwheel
Zinc
_Development Environment
dev.status
2
Attaching TileEntity Behaviours
simibubi edited this page 2021-08-25 17:23:29 +02:00
Table of Contents
TileEntityBehaviourEvent
Event that is fired just before a SmartTileEntity is being deserealized, alternatively just after it was newly placed. Use it to attach a new TileEntityBehaviour or replace existing ones (with caution)
Example:
forgeEventBus.addGenericListener(FunnelTileEntity.class, (TileEntityBehaviourEvent<FunnelTileEntity> event) -> event
.attach(new FunFunnelBehaviour(event.getTileEntity())));
Will attach the new FunFunnelBehaviour
to any Funnels placed or loaded in
- When loaded from disk, the attached behaviour will be able to read from the tileentities' tag just after it was added. See
TileEntityBehaviour#read()
- The attached behaviour can initialize fully on its first tick. See
TileEntityBehaviour#initialize()
- In
TileEntityBehaviour#write()
, data can be placed into the tag before serialization. That way your custom data will persist until your next read()
Within the event context, make sure the tileentity itself is only used to provide the reference for later. Its level, position and data will not be set at this time.