use of icbm.classic.content.machines.launcher.frame.TileLauncherFrame in project ICBM-Classic by BuiltBrokenModding.
the class TileLauncherBase method update.
/**
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner
* uses this to count ticks and creates a new spawn inside its implementation.
*/
@Override
public void update() {
super.update();
if (ticks % 20 == 0) {
if (this.supportFrame == null || launchScreen == null || launchScreen.isInvalid() || this.supportFrame.isInvalid()) {
this.supportFrame = null;
this.launchScreen = null;
for (byte i = 2; i < 6; i++) {
Pos position = new Pos(this.xCoord, this.yCoord, this.zCoord).add(ForgeDirection.getOrientation(i));
TileEntity tileEntity = this.worldObj.getTileEntity(position.xi(), position.yi(), position.zi());
if (tileEntity instanceof TileLauncherFrame) {
this.supportFrame = (TileLauncherFrame) tileEntity;
if (isServer()) {
this.supportFrame.setFacing(getDirection());
}
} else if (tileEntity instanceof TileLauncherScreen) {
this.launchScreen = (TileLauncherScreen) tileEntity;
}
}
}
}
}
Aggregations