generated from tilera/1710mod
fix: remote detonator works now
This commit is contained in:
parent
9a42fed16c
commit
ee1862ca0c
|
@ -6,6 +6,5 @@
|
|||
- can push explosive entities
|
||||
- flying blocks dont properly render
|
||||
- black hole doesn't suck in blocks
|
||||
- remote detonator doesnt work
|
||||
|
||||
- see `// TODO: WTF`
|
||||
|
|
|
@ -5,9 +5,12 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
|||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import icbm.zhapin.dianqi.ItLaserDesignator;
|
||||
import icbm.zhapin.dianqi.ItRadarGun;
|
||||
import icbm.zhapin.zhapin.BExplosives;
|
||||
import icbm.zhapin.zhapin.TExplosive;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
|
@ -65,12 +68,23 @@ public class ItemUsePacketHandler implements IMessageHandler<ItemUsePacket, IMes
|
|||
}
|
||||
} else if (message.type == ItemUsePacket.Type.REMOTE) {
|
||||
final ItemStack itemStack = player.inventory.getCurrentItem();
|
||||
ICBMExplosion.itYaoKong.onProvide(
|
||||
ElectricityPack.getFromWatts(
|
||||
1500.0, ICBMExplosion.itYaoKong.getVoltage(itemStack)
|
||||
),
|
||||
itemStack
|
||||
);
|
||||
TileEntity te = message.pos.getTileEntity(player.worldObj);
|
||||
if (te instanceof TExplosive) {
|
||||
BExplosives.yinZha(
|
||||
player.worldObj,
|
||||
message.pos.intX(),
|
||||
message.pos.intY(),
|
||||
message.pos.intZ(),
|
||||
((TExplosive) te).explosiveId,
|
||||
0
|
||||
);
|
||||
ICBMExplosion.itYaoKong.onProvide(
|
||||
ElectricityPack.getFromWatts(
|
||||
1500.0, ICBMExplosion.itYaoKong.getVoltage(itemStack)
|
||||
),
|
||||
itemStack
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -125,10 +125,9 @@ public class ItRemoteDetonator extends ItElectricICBM {
|
|||
|
||||
if (this.nengZha(tileEntity)) {
|
||||
if (this.getJoules(itemStack) > 1500.0) {
|
||||
// TODO: WTF
|
||||
//PacketDispatcher.sendPacketToServer(
|
||||
// PacketManager.getPacket("ICBM|E", tileEntity,
|
||||
// 2));
|
||||
ICBMExplosion.channel.sendToServer(new ItemUsePacket(
|
||||
ItemUsePacket.Type.REMOTE, new Vector3(tileEntity)
|
||||
));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
|
@ -143,12 +142,9 @@ public class ItRemoteDetonator extends ItElectricICBM {
|
|||
= this.getSavedCoord(itemStack).getTileEntity((IBlockAccess) world);
|
||||
|
||||
if (this.nengZha(tileEntity2)) {
|
||||
// TODO: WTF
|
||||
//PacketDispatcher.sendPacketToServer(
|
||||
// PacketManager.getPacket("ICBM|E", tileEntity2, 2));
|
||||
ICBMExplosion.channel.sendToServer(
|
||||
new ItemUsePacket(ItemUsePacket.Type.REMOTE, new Vector3())
|
||||
);
|
||||
ICBMExplosion.channel.sendToServer(new ItemUsePacket(
|
||||
ItemUsePacket.Type.REMOTE, new Vector3(tileEntity2)
|
||||
));
|
||||
}
|
||||
} else {
|
||||
entityPlayer.addChatMessage(
|
||||
|
|
|
@ -174,7 +174,6 @@ public class GRadarTower extends GuiBase {
|
|||
int range = 4;
|
||||
|
||||
for (final Entity entity : this.tileEntity.entitiesInRange) {
|
||||
System.out.println("AAAAAAAAAALEC: " + entity.getCommandSenderName());
|
||||
final Vector2 position = new Vector2(
|
||||
this.radarCenter.x
|
||||
+ (entity.posX - this.tileEntity.xCoord) / this.radarMapRadius,
|
||||
|
|
|
@ -32,11 +32,9 @@ public class ExEmpSignal extends ZhaPin {
|
|||
final List<Entity> entitiesNearby
|
||||
= RadarRegistry.getEntitiesWithinRadius(position.toVector2(), radius);
|
||||
|
||||
System.out.println("AAAAAAALEC: " + entitiesNearby.size());
|
||||
for (final Entity entity : entitiesNearby) {
|
||||
if (entity instanceof IMissile && !entity.isEntityEqual(explosionSource)
|
||||
&& ((IMissile) entity).getTicksInAir() > -1) {
|
||||
System.out.println("AAAAAAALEC: dropMissileAsItem");
|
||||
((IMissile) entity).dropMissileAsItem();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue