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