Search in sources :

Example 1 with IGantryShaft

use of com.teammoeg.frostedheart.util.IGantryShaft in project FrostedHeart by TeamMoegMC.

the class MixinGantryContraptionEntity method checkPinionShaft.

@Inject(at = @At("HEAD"), method = "checkPinionShaft", remap = false)
protected void checkPinionShaft(CallbackInfo cbi) {
    Direction facing = ((GantryContraption) contraption).getFacing();
    Vector3d currentPosition = getAnchorVec().add(.5, .5, .5);
    BlockPos gantryShaftPos = new BlockPos(currentPosition).offset(facing.getOpposite());
    TileEntity te = world.getTileEntity(gantryShaftPos);
    if (te instanceof IGantryShaft) {
        GantryShaftTileEntity gte = (GantryShaftTileEntity) te;
        ((IGantryShaft) gte).setEntity(this);
        gte.networkDirty = true;
        return;
    }
}
Also used : GantryShaftTileEntity(com.simibubi.create.content.contraptions.relays.advanced.GantryShaftTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) GantryContraption(com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraption) Vector3d(net.minecraft.util.math.vector.Vector3d) IGantryShaft(com.teammoeg.frostedheart.util.IGantryShaft) GantryShaftTileEntity(com.simibubi.create.content.contraptions.relays.advanced.GantryShaftTileEntity) BlockPos(net.minecraft.util.math.BlockPos) Direction(net.minecraft.util.Direction) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

GantryContraption (com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraption)1 GantryShaftTileEntity (com.simibubi.create.content.contraptions.relays.advanced.GantryShaftTileEntity)1 IGantryShaft (com.teammoeg.frostedheart.util.IGantryShaft)1 TileEntity (net.minecraft.tileentity.TileEntity)1 Direction (net.minecraft.util.Direction)1 BlockPos (net.minecraft.util.math.BlockPos)1 Vector3d (net.minecraft.util.math.vector.Vector3d)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1