mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
cargo pad tower goes boom
This commit is contained in:
parent
f9762916fd
commit
c4ecb20cf8
@ -23,6 +23,7 @@ public class EntityMinerRocket extends Entity {
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(16, Integer.valueOf(0));
|
||||
this.dataWatcher.addObject(17, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -83,12 +84,14 @@ public class EntityMinerRocket extends Entity {
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
dataWatcher.updateObject(16, nbt.getInteger("mode"));
|
||||
dataWatcher.updateObject(17, nbt.getInteger("sat"));
|
||||
timer = nbt.getInteger("timer");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("mode", dataWatcher.getWatchableObjectInt(16));
|
||||
nbt.setInteger("sat", dataWatcher.getWatchableObjectInt(17));
|
||||
nbt.setInteger("timer", timer);
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.missile.EntityMinerRocket;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemSatChip;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
@ -221,6 +222,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
|
||||
rocket.posX = xCoord + 0.5;
|
||||
rocket.posY = 300;
|
||||
rocket.posZ = zCoord + 0.5;
|
||||
rocket.getDataWatcher().updateObject(17, freq);
|
||||
worldObj.spawnEntityInWorld(rocket);
|
||||
miner.lastOp = System.currentTimeMillis();
|
||||
data.markDirty();
|
||||
@ -236,6 +238,12 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
|
||||
|
||||
EntityMinerRocket rocket = (EntityMinerRocket)e;
|
||||
|
||||
if(slots[15] != null && ItemSatChip.getFreq(slots[15]) != rocket.getDataWatcher().getWatchableObjectInt(17)) {
|
||||
rocket.setDead();
|
||||
ExplosionNukeSmall.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, ExplosionNukeSmall.tots);
|
||||
break;
|
||||
}
|
||||
|
||||
if(rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
|
||||
unloadCargo();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user