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

    Fields
    Modifier and Type
    Field
    Description
    boolean
     
    double
     
    boolean
     
    double
     
    static codechicken.lib.vec.Cuboid6
     
    static codechicken.lib.vec.Cuboid6[][]
     
    static net.minecraft.world.phys.shapes.VoxelShape[][]
     
    static net.minecraft.world.phys.shapes.VoxelShape[]
     
    static net.minecraft.world.phys.shapes.VoxelShape
     
    static codechicken.lib.vec.Cuboid6[]
     
    static net.minecraft.world.phys.shapes.VoxelShape[]
     
    boolean
     
    static int
     
    static int
     
    boolean
     
    static final net.minecraft.world.level.block.SoundType
     
    boolean
     
    byte
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     
    boolean
    canConnect(int side)
     
    boolean
    Use this to check if another part, not yourself can eject.
    boolean
    canInsert(int side)
     
    abstract boolean
     
    void
    Drops the part in world, removes all modifiers.
    boolean
    Called to check if the part can't stay anymore.
    protected void
    dropItem(net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.item.ItemStack
    getCloneStack(codechicken.multipart.util.PartRayTraceResult hit)
     
    net.minecraft.world.phys.shapes.VoxelShape
    getCollisionShape(net.minecraft.world.phys.shapes.CollisionContext ctx)
     
    Collection<net.minecraft.world.item.ItemStack>
     
    int
     
    codechicken.lib.vec.Cuboid6
     
    net.minecraft.world.phys.shapes.VoxelShape
     
    abstract net.minecraft.world.item.ItemStack
     
    net.minecraft.world.phys.shapes.VoxelShape
     
    <T> T
    getOther(int side)
     
    net.minecraft.world.level.block.SoundType
    getPlacementSound(net.minecraft.world.item.context.UseOnContext context)
     
    codechicken.lib.vec.Cuboid6
     
    net.minecraft.world.phys.shapes.VoxelShape
    getShape(net.minecraft.world.phys.shapes.CollisionContext ctx)
     
    int
     
    abstract int
     
    void
    load(net.minecraft.nbt.CompoundTag tag)
     
    void
     
    void
    onNeighborBlockChanged(net.minecraft.core.BlockPos from)
     
    void
    onPartChanged(codechicken.multipart.api.part.MultiPart part)
     
    void
    openGui(net.minecraft.world.entity.player.Player player)
    Called to open any gui that the translocator wishes to display.
    void
    readDesc(codechicken.lib.data.MCDataInput packet)
     
    protected void
    readFlags(int flags)
     
    void
    readIncUpdate(codechicken.lib.data.MCDataInput packet)
    Called when our Incremental update packet arrives.
    final void
    readUpdate(codechicken.lib.data.MCDataInput packet)
     
    int
     
    void
    save(net.minecraft.nbt.CompoundTag tag)
     
    void
     
    void
    sendIncUpdate(Consumer<codechicken.lib.data.MCDataOutput> func)
     
    setupPlacement(net.minecraft.world.entity.player.Player player, net.minecraft.core.Direction side)
     
    void
    Strips all modifiers from the Translocator and drops the items in world.
    void
     
    void
    writeDesc(codechicken.lib.data.MCDataOutput packet)
     
    protected int
     

    Methods inherited from class codechicken.multipart.api.part.BaseMultipart

    bind, hasTile, tile

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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, tile

    Methods 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:
      save in interface codechicken.multipart.api.part.MultiPart
    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      load in interface codechicken.multipart.api.part.MultiPart
    • writeDesc

      public void writeDesc(codechicken.lib.data.MCDataOutput packet)
      Specified by:
      writeDesc in interface codechicken.multipart.api.part.MultiPart
    • readDesc

      public void readDesc(codechicken.lib.data.MCDataInput packet)
      Specified by:
      readDesc in interface codechicken.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:
      readUpdate in interface codechicken.multipart.api.part.MultiPart
    • sendFlagsUpdate

      public void sendFlagsUpdate()
    • sendIncUpdate

      public void sendIncUpdate(Consumer<codechicken.lib.data.MCDataOutput> func)
    • 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:
      onPartChanged in interface codechicken.multipart.api.part.MultiPart
    • getPlacementSound

      public net.minecraft.world.level.block.SoundType getPlacementSound(net.minecraft.world.item.context.UseOnContext context)
      Specified by:
      getPlacementSound in interface codechicken.multipart.api.part.MultiPart
    • redstoneConductionMap

      public int redstoneConductionMap()
      Specified by:
      redstoneConductionMap in interface codechicken.multipart.api.part.FacePart
    • getSlotMask

      public int getSlotMask()
      Specified by:
      getSlotMask in interface codechicken.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:
      getShape in interface codechicken.multipart.api.part.MultiPart
    • getOcclusionShape

      public net.minecraft.world.phys.shapes.VoxelShape getOcclusionShape()
      Specified by:
      getOcclusionShape in interface codechicken.multipart.api.part.NormalOcclusionPart
    • getCollisionShape

      public net.minecraft.world.phys.shapes.VoxelShape getCollisionShape(net.minecraft.world.phys.shapes.CollisionContext ctx)
      Specified by:
      getCollisionShape in interface codechicken.multipart.api.part.MultiPart
    • getInteractionShape

      public net.minecraft.world.phys.shapes.VoxelShape getInteractionShape()
      Specified by:
      getInteractionShape in interface codechicken.multipart.api.part.MultiPart
    • onNeighborBlockChanged

      public void onNeighborBlockChanged(net.minecraft.core.BlockPos from)
      Specified by:
      onNeighborBlockChanged in interface codechicken.multipart.api.part.MultiPart
    • tick

      public void tick()
      Specified by:
      tick in interface codechicken.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:
      activate in interface codechicken.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

      public Collection<net.minecraft.world.item.ItemStack> getDrops()
      Specified by:
      getDrops in interface codechicken.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:
      getCloneStack in interface codechicken.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:
      getRenderBounds in interface codechicken.multipart.api.part.MultiPart