Package codechicken.translocators.part
Class TranslocatorPart
java.lang.Object
codechicken.multipart.api.part.BaseMultipart
codechicken.translocators.part.TranslocatorPart
- All Implemented Interfaces:
codechicken.multipart.api.part.FacePart,codechicken.multipart.api.part.MultiPart,codechicken.multipart.api.part.NormalOcclusionPart,codechicken.multipart.api.part.SlottedPart,codechicken.multipart.api.part.TickablePart
- Direct Known Subclasses:
FluidTranslocatorPart,ItemTranslocatorPart
public abstract class TranslocatorPart
extends codechicken.multipart.api.part.BaseMultipart
implements codechicken.multipart.api.part.FacePart, codechicken.multipart.api.part.NormalOcclusionPart, codechicken.multipart.api.part.TickablePart
Created by covers1624 on 10/11/2017.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleandoublebooleandoublestatic codechicken.lib.vec.Cuboid6static codechicken.lib.vec.Cuboid6[][]static net.minecraft.world.phys.shapes.VoxelShape[][]static net.minecraft.world.phys.shapes.VoxelShape[]static net.minecraft.world.phys.shapes.VoxelShapestatic codechicken.lib.vec.Cuboid6[]static net.minecraft.world.phys.shapes.VoxelShape[]booleanstatic intstatic intbooleanstatic final net.minecraft.world.level.block.SoundTypebooleanbyte -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.InteractionResultactivate(net.minecraft.world.entity.player.Player player, codechicken.multipart.util.PartRayTraceResult hit, net.minecraft.world.item.ItemStack held, net.minecraft.world.InteractionHand hand) booleancanConnect(int side) booleancanEject()Use this to check if another part, not yourself can eject.booleancanInsert(int side) abstract booleancanStay()voiddrop()Drops the part in world, removes all modifiers.booleanCalled to check if the part can't stay anymore.protected voiddropItem(net.minecraft.world.item.ItemStack stack) net.minecraft.world.item.ItemStackgetCloneStack(codechicken.multipart.util.PartRayTraceResult hit) net.minecraft.world.phys.shapes.VoxelShapegetCollisionShape(net.minecraft.world.phys.shapes.CollisionContext ctx) Collection<net.minecraft.world.item.ItemStack>getDrops()intcodechicken.lib.vec.Cuboid6net.minecraft.world.phys.shapes.VoxelShapeabstract net.minecraft.world.item.ItemStackgetItem()net.minecraft.world.phys.shapes.VoxelShape<T> TgetOther(int side) net.minecraft.world.level.block.SoundTypegetPlacementSound(net.minecraft.world.item.context.UseOnContext context) codechicken.lib.vec.Cuboid6net.minecraft.world.phys.shapes.VoxelShapegetShape(net.minecraft.world.phys.shapes.CollisionContext ctx) intabstract intgetTType()voidload(net.minecraft.nbt.CompoundTag tag) voidvoidonNeighborBlockChanged(net.minecraft.core.BlockPos from) voidonPartChanged(codechicken.multipart.api.part.MultiPart part) voidopenGui(net.minecraft.world.entity.player.Player player) Called to open any gui that the translocator wishes to display.voidreadDesc(codechicken.lib.data.MCDataInput packet) protected voidreadFlags(int flags) voidreadIncUpdate(codechicken.lib.data.MCDataInput packet) Called when our Incremental update packet arrives.final voidreadUpdate(codechicken.lib.data.MCDataInput packet) intvoidsave(net.minecraft.nbt.CompoundTag tag) voidvoidsendIncUpdate(Consumer<codechicken.lib.data.MCDataOutput> func) setupPlacement(net.minecraft.world.entity.player.Player player, net.minecraft.core.Direction side) voidStrips all modifiers from the Translocator and drops the items in world.voidtick()voidwriteDesc(codechicken.lib.data.MCDataOutput packet) protected intMethods inherited from class codechicken.multipart.api.part.BaseMultipart
bind, hasTile, tileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.multipart.api.part.MultiPart
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, capCache, click, getBlockSupportShape, getExplosionResistance, getLightEmission, getRenderOcclusionShape, getStrength, getType, getVisualShape, harvest, hasLevel, hasTile, invalidateConvertedTile, level, onAdded, onChunkLoad, onChunkUnload, onConverted, onEntityCollision, onEntityStanding, onMoved, onRemoved, onWorldJoin, onWorldSeparate, pos, preRemove, scheduledTick, scheduleTick, sendUpdate, tileMethods inherited from interface codechicken.multipart.api.part.NormalOcclusionPart
occlusionTest
-
Field Details
-
PLACEMENT_SOUND
public static final net.minecraft.world.level.block.SoundType PLACEMENT_SOUND -
base
public static codechicken.lib.vec.Cuboid6 base -
boxes
public static codechicken.lib.vec.Cuboid6[] boxes -
base_parts
public static codechicken.lib.vec.Cuboid6[][] base_parts -
baseShape
public static net.minecraft.world.phys.shapes.VoxelShape baseShape -
boxShapes
public static net.minecraft.world.phys.shapes.VoxelShape[] boxShapes -
basePartShapes
public static net.minecraft.world.phys.shapes.VoxelShape[][] basePartShapes -
basePartsJoined
public static net.minecraft.world.phys.shapes.VoxelShape[] basePartsJoined -
HIT_BASE
public static int HIT_BASE -
HIT_INSERT
public static int HIT_INSERT -
side
public byte side -
a_eject
public boolean a_eject -
b_eject
public boolean b_eject -
redstone
public boolean redstone -
invert_redstone
public boolean invert_redstone -
fast
public boolean fast -
a_insertpos
public double a_insertpos -
b_insertpos
public double b_insertpos
-
-
Constructor Details
-
TranslocatorPart
public TranslocatorPart()
-
-
Method Details
-
save
public void save(net.minecraft.nbt.CompoundTag tag) - Specified by:
savein interfacecodechicken.multipart.api.part.MultiPart
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Specified by:
loadin interfacecodechicken.multipart.api.part.MultiPart
-
writeDesc
public void writeDesc(codechicken.lib.data.MCDataOutput packet) - Specified by:
writeDescin interfacecodechicken.multipart.api.part.MultiPart
-
readDesc
public void readDesc(codechicken.lib.data.MCDataInput packet) - Specified by:
readDescin interfacecodechicken.multipart.api.part.MultiPart
-
writeFlags
protected int writeFlags() -
readFlags
protected void readFlags(int flags) -
readUpdate
public final void readUpdate(codechicken.lib.data.MCDataInput packet) - Specified by:
readUpdatein interfacecodechicken.multipart.api.part.MultiPart
-
sendFlagsUpdate
public void sendFlagsUpdate() -
sendIncUpdate
-
readIncUpdate
public void readIncUpdate(codechicken.lib.data.MCDataInput packet) Called when our Incremental update packet arrives.- Parameters:
packet- The packet to read data from.
-
onPartChanged
public void onPartChanged(codechicken.multipart.api.part.MultiPart part) - Specified by:
onPartChangedin interfacecodechicken.multipart.api.part.MultiPart
-
getPlacementSound
public net.minecraft.world.level.block.SoundType getPlacementSound(net.minecraft.world.item.context.UseOnContext context) - Specified by:
getPlacementSoundin interfacecodechicken.multipart.api.part.MultiPart
-
redstoneConductionMap
public int redstoneConductionMap()- Specified by:
redstoneConductionMapin interfacecodechicken.multipart.api.part.FacePart
-
getSlotMask
public int getSlotMask()- Specified by:
getSlotMaskin interfacecodechicken.multipart.api.part.SlottedPart
-
getInsertBounds
public codechicken.lib.vec.Cuboid6 getInsertBounds() -
getShape
public net.minecraft.world.phys.shapes.VoxelShape getShape(net.minecraft.world.phys.shapes.CollisionContext ctx) - Specified by:
getShapein interfacecodechicken.multipart.api.part.MultiPart
-
getOcclusionShape
public net.minecraft.world.phys.shapes.VoxelShape getOcclusionShape()- Specified by:
getOcclusionShapein interfacecodechicken.multipart.api.part.NormalOcclusionPart
-
getCollisionShape
public net.minecraft.world.phys.shapes.VoxelShape getCollisionShape(net.minecraft.world.phys.shapes.CollisionContext ctx) - Specified by:
getCollisionShapein interfacecodechicken.multipart.api.part.MultiPart
-
getInteractionShape
public net.minecraft.world.phys.shapes.VoxelShape getInteractionShape()- Specified by:
getInteractionShapein interfacecodechicken.multipart.api.part.MultiPart
-
onNeighborBlockChanged
public void onNeighborBlockChanged(net.minecraft.core.BlockPos from) - Specified by:
onNeighborBlockChangedin interfacecodechicken.multipart.api.part.MultiPart
-
tick
public void tick()- Specified by:
tickin interfacecodechicken.multipart.api.part.TickablePart
-
activate
public net.minecraft.world.InteractionResult activate(net.minecraft.world.entity.player.Player player, codechicken.multipart.util.PartRayTraceResult hit, net.minecraft.world.item.ItemStack held, net.minecraft.world.InteractionHand hand) - Specified by:
activatein interfacecodechicken.multipart.api.part.MultiPart
-
openGui
public void openGui(net.minecraft.world.entity.player.Player player) Called to open any gui that the translocator wishes to display.- Parameters:
player- The player.
-
stripModifiers
public void stripModifiers()Strips all modifiers from the Translocator and drops the items in world. -
getDrops
- Specified by:
getDropsin interfacecodechicken.multipart.api.part.MultiPart
-
dropIfCantStay
public boolean dropIfCantStay()Called to check if the part can't stay anymore. I.E, chest removed, Translocator needs to drop. This method will drop the part in world and notify the tile that it was removed.- Returns:
- True if the translocator was dropped, false if it wasn't.
-
drop
public void drop()Drops the part in world, removes all modifiers. Also notifies the tile to remove this part. -
getCloneStack
public net.minecraft.world.item.ItemStack getCloneStack(codechicken.multipart.util.PartRayTraceResult hit) - Specified by:
getCloneStackin interfacecodechicken.multipart.api.part.MultiPart
-
getItem
public abstract net.minecraft.world.item.ItemStack getItem() -
getTType
public abstract int getTType() -
canStay
public abstract boolean canStay() -
setupPlacement
public TranslocatorPart setupPlacement(net.minecraft.world.entity.player.Player player, net.minecraft.core.Direction side) -
markUpdate
public void markUpdate() -
canEject
public boolean canEject()Use this to check if another part, not yourself can eject. Mainly to bypass ticking issues, as the part state may actually change next tick, But hasn't had the chance to tick in the space yet.- Returns:
- same as a_eject but with tick look forward.
-
canConnect
public boolean canConnect(int side) -
canInsert
public boolean canInsert(int side) -
getOther
public <T> T getOther(int side) -
dropItem
protected void dropItem(net.minecraft.world.item.ItemStack stack) -
getIconIndex
public int getIconIndex() -
getRenderBounds
public codechicken.lib.vec.Cuboid6 getRenderBounds()- Specified by:
getRenderBoundsin interfacecodechicken.multipart.api.part.MultiPart
-