public interface ISemiBlock
extends net.minecraftforge.common.capabilities.ICapabilityProvider
| Modifier and Type | Method and Description |
|---|---|
default void |
addTooltip(java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.nbt.CompoundNBT tag,
boolean extended)
Add tooltip information for this semiblock.
|
static ISemiBlock |
byTrackingId(net.minecraft.world.World world,
int id)
Retrieve a semiblock by tracking ID.
|
boolean |
canCoexist(ISemiBlock otherSemiblock)
Check if this semiblock can coexist with the other semiblock, in the same block pos.
|
boolean |
canPlace(net.minecraft.util.Direction facing)
Check if this semiblock can be placed here.
|
net.minecraft.util.math.BlockPos |
getBlockPos()
Get the block position this entity occupies.
|
net.minecraft.tileentity.TileEntity |
getCachedTileEntity()
Get the tile entity at the semiblock's position.
|
default int |
getColor()
A color in ARGB format.
|
net.minecraft.util.text.ITextComponent |
getDisplayName()
Get the displayed name for this semiblock.
|
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> |
getDrops()
Add any dropped items from this semiblock to the given list.
|
net.minecraft.util.ResourceLocation |
getSemiblockId()
Get a unique ID for this semiblock, which should match the corresponding item's registry name.
|
int |
getTrackingId()
Get the tracking for this semiblock; this should only be used for network sync purposes, and is subject to change
on a world reload.
|
net.minecraft.world.World |
getWorld()
Get the world this semiblock is in.
|
boolean |
isValid()
Check if this semiblock is still valid, i.e.
|
default void |
onPlaced(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.item.ItemStack stack,
net.minecraft.util.Direction facing)
Called immediately after the semiblock entity has been added to the world.
|
default boolean |
onRightClickWithConfigurator(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Direction side)
Called when a semiblock is right-clicked with a Logistics Configurator
|
void |
readFromBuf(net.minecraft.network.PacketBuffer payload)
Read this semiblock from network buffer for network sync purposes.
|
void |
removeSemiblock(net.minecraft.entity.player.PlayerEntity player)
Mark this semiblock for removal.
|
net.minecraft.nbt.CompoundNBT |
serializeNBT(net.minecraft.nbt.CompoundNBT tag)
Written to the dropped item (under the "EntityTag" subtag) when the semiblock is broken, to persisted entity
data by
Entity#writeAdditional(), and displayed by info mods such as TOP or Waila. |
void |
tick()
Implement tick logic here.
|
void |
writeToBuf(net.minecraft.network.PacketBuffer payload)
Write this semiblock to network buffer for network sync purposes.
|
net.minecraft.util.ResourceLocation getSemiblockId()
net.minecraft.util.text.ITextComponent getDisplayName()
net.minecraft.world.World getWorld()
net.minecraft.util.math.BlockPos getBlockPos()
net.minecraft.tileentity.TileEntity getCachedTileEntity()
net.minecraft.nbt.CompoundNBT serializeNBT(net.minecraft.nbt.CompoundNBT tag)
Entity#writeAdditional(), and displayed by info mods such as TOP or Waila. Use this method
rather than writeAdditional() for fields that either need to be serialized to the dropped item, or
displayed on TOP/Waila.
tag - NBT tag to write data toEntityType.updateCustomEntityTag(World, PlayerEntity, Entity, CompoundNBT) when the
semiblock entity is spawned from an item (i.e. placed by a player).void tick()
super.tick() in subclass overrides!boolean isValid()
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> getDrops()
boolean canPlace(net.minecraft.util.Direction facing)
facing - the side of the block against which it is placeddefault void onPlaced(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.item.ItemStack stack,
net.minecraft.util.Direction facing)
player - player who is placing the semiblockstack - itemstack used to create the entityfacing - the side of the block which was clicked to place the entitydefault boolean onRightClickWithConfigurator(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Direction side)
player - the playerside - the side of the block being clickedboolean canCoexist(ISemiBlock otherSemiblock)
IDirectionalSemiblock and both semiblocks have a different
side.otherSemiblock - the other semiblockint getTrackingId()
byTrackingId(World, int)void removeSemiblock(net.minecraft.entity.player.PlayerEntity player)
player - player who is removing the semiblockdefault void addTooltip(java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.nbt.CompoundNBT tag,
boolean extended)
curInfo - append info to this listplayer - the player looking at the entity or itemtag - NBT data as saved by serializeNBT(CompoundNBT)extended - true if extended data should be shownvoid writeToBuf(net.minecraft.network.PacketBuffer payload)
payload - the buffervoid readFromBuf(net.minecraft.network.PacketBuffer payload)
payload - the bufferdefault int getColor()
static ISemiBlock byTrackingId(net.minecraft.world.World world, int id)
world - the worldid - the tracking IDgetTrackingId()