use of com.simibubi.create.content.contraptions.components.flywheel.engine.EngineTileEntity in project SteamPowered by TeamMoegMC.
the class MixinFlywheel method sp$tick.
@Inject(at = @At("HEAD"), method = "tick")
public void sp$tick(CallbackInfo cbi) {
Direction at = FlywheelBlock.getConnection(getBlockState());
if (at != null) {
BlockPos eng = this.getBlockPos().relative(at, 2);
Block b = this.getWorld().getBlockState(eng).getBlock();
if (!(b instanceof EngineBlock)) {
FlywheelBlock.setConnection(getWorld(), getBlockPos(), getBlockState(), null);
this.setRotation(0, 0);
} else {
TileEntity te = this.getWorld().getBlockEntity(eng);
if (te instanceof EngineTileEntity) {
if (te instanceof SteamEngineTileEntity) {
SteamEngineTileEntity ete = (SteamEngineTileEntity) te;
if (ete.getFlywheel() != this.getBlockState().getBlock())
this.setRotation(0, 0);
}
} else
this.setRotation(0, 0);
}
} else
this.setRotation(0, 0);
}
Aggregations