use of com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraption 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;
}
}
use of com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryContraption in project FrostedHeart by TeamMoegMC.
the class MixinGantryShaftTileEntity method calculateStressApplied.
@Override
public float calculateStressApplied() {
if (currentComp != null && currentComp.isAlive()) {
// float impact = currentComp.getContraption().getBlocks().size()*4;
Direction facing = ((GantryContraption) currentComp.getContraption()).getFacing();
Vector3d currentPosition = currentComp.getAnchorVec().add(.5, .5, .5);
BlockPos gantryShaftPos = new BlockPos(currentPosition).offset(facing.getOpposite());
if (gantryShaftPos.equals(this.pos)) {
ContraptionCostUtils.setSpeedAndCollect(currentComp, (int) speed);
this.lastStressApplied = ContraptionCostUtils.getCost(currentComp) + 0.5F;
return lastStressApplied;
}
}
currentComp = null;
return 0;
}
Aggregations