@Override public void onPadDestroyed() { if (!this.isDead && this.launchPhase != EnumLaunchPhase.LAUNCHED.getPhase()) { this.dropShipAsItem(); this.setDead(); } }
@Override public void onUpdate() { super.onUpdate(); int i; if (this.timeUntilLaunch >= 100) { i = Math.abs(this.timeUntilLaunch / 100); } else { i = 1; } if ((this.getLaunched() || this.launchPhase == EnumLaunchPhase.IGNITED.getPhase() && this.rand.nextInt(i) == 0) && !GCCoreConfigManager.disableSpaceshipParticles && this.hasValidFuel()) { if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { this.spawnParticles(this.getLaunched()); } } if (this.rocketSoundUpdater != null && (this.launchPhase == EnumLaunchPhase.IGNITED.getPhase() || this.getLaunched())) { this.rocketSoundUpdater.update(); } if (this.launchPhase == EnumLaunchPhase.LAUNCHED.getPhase() && this.hasValidFuel()) { double d = this.timeSinceLaunch / 250; d = Math.min(d, 1); if (d != 0.0) { this.motionY = -d * Math.cos((this.rotationPitch - 180) * Math.PI / 180.0D); } double multiplier = 1.0D; if (this.worldObj.provider instanceof IGalacticraftWorldProvider) { multiplier = ((IGalacticraftWorldProvider) this.worldObj.provider).getFuelUsageMultiplier(); if (multiplier <= 0) { multiplier = 1; } } if (this.timeSinceLaunch % MathHelper.floor_double(3 * (1 / multiplier)) == 0) { this.removeFuel(1); } } else if (!this.hasValidFuel() && this.getLaunched() && !this.worldObj.isRemote) { if (Math.abs(Math.sin(this.timeSinceLaunch / 1000)) / 10 != 0.0) { this.motionY -= Math.abs(Math.sin(this.timeSinceLaunch / 1000)) / 20; } } }
@Override public boolean canBeTargeted(Object entity) { return this.launchPhase == EnumLaunchPhase.LAUNCHED.getPhase() && this.timeSinceLaunch > 50; }