updated static bombs

Replaced fixed blast speed with config value. Added isRemote() check to prevent duplicate entity creation
This commit is contained in:
grangerave 2017-12-02 20:12:47 -06:00
parent 6424500d22
commit c379755dfe
8 changed files with 17 additions and 17 deletions

View File

@ -115,7 +115,7 @@ public class NukeBoy extends BlockContainer implements IBomb {
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
TileEntityNukeBoy entity = (TileEntityNukeBoy) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) {
if (entity.isReady()) {
if (entity.isReady() && p_149695_1_.isRemote) {
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
entity.clearSlots();
p_149695_1_.setBlockToAir(x, y, z);
@ -151,7 +151,7 @@ public class NukeBoy extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = MainRegistry.boyRadius;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 10.0F;
world.spawnEntityInWorld(entity);
@ -164,7 +164,7 @@ public class NukeBoy extends BlockContainer implements IBomb {
entity2.posZ = z;
world.spawnEntityInWorld(entity2);
} else {
EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 1000);
EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 3000);
entity2.posX = x;
entity2.posY = y - 11;
entity2.posZ = z;

View File

@ -121,7 +121,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
TileEntityNukeCustom entity = (TileEntityNukeCustom) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) {
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z) && p_149695_1_.isRemote) {
if (entity.isReady()) {
float[] f = entity.returnAllValues();
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
@ -167,7 +167,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
entity.posY = y + 0.5;
entity.posZ = z + 0.5;
entity.destructionRange = (int)schrab;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 1.0F;
entity.waste = false;

View File

@ -123,7 +123,7 @@ public class NukeFleija extends BlockContainer implements IBomb {
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{
TileEntityNukeFleija entity = (TileEntityNukeFleija) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote)
{
if(entity.isReady())
{
@ -148,7 +148,7 @@ public class NukeFleija extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = r;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 1.0F;
entity.waste = false;

View File

@ -119,7 +119,7 @@ public class NukeGadget extends BlockContainer implements IBomb {
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
TileEntityNukeGadget entity = (TileEntityNukeGadget) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) {
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) {
if (entity.isReady()) {
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
entity.clearSlots();
@ -164,7 +164,7 @@ public class NukeGadget extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = MainRegistry.gadgetRadius;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 10.0F;
world.spawnEntityInWorld(entity);

View File

@ -125,7 +125,7 @@ public class NukeMan extends BlockContainer implements IBomb {
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{
TileEntityNukeMan entity = (TileEntityNukeMan) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote)
{
if(entity.isReady())
{
@ -178,7 +178,7 @@ public class NukeMan extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = MainRegistry.manRadius;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 10.0F;
world.spawnEntityInWorld(entity);

View File

@ -118,7 +118,7 @@ public class NukeMike extends BlockContainer implements IBomb {
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
TileEntityNukeMike entity = (TileEntityNukeMike) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) {
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) {
if (entity.isReady() && !entity.isFilled()) {
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
entity.clearSlots();
@ -146,7 +146,7 @@ public class NukeMike extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = r;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 10.0F;
world.spawnEntityInWorld(entity);

View File

@ -134,7 +134,7 @@ public class NukePrototype extends BlockContainer implements IBomb {
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{
TileEntityNukePrototype entity = (TileEntityNukePrototype) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote)
{
if(entity.isReady())
{
@ -159,7 +159,7 @@ public class NukePrototype extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = r;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 1.0F;
entity.waste = false;

View File

@ -122,7 +122,7 @@ public class NukeTsar extends BlockContainer implements IBomb {
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{
TileEntityNukeTsar entity = (TileEntityNukeTsar) p_149695_1_.getTileEntity(x, y, z);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote)
{
if(entity.isReady() && !entity.isFilled())
{
@ -155,7 +155,7 @@ public class NukeTsar extends BlockContainer implements IBomb {
entity.posY = y;
entity.posZ = z;
entity.destructionRange = r;
entity.speed = 25;
entity.speed = MainRegistry.blastSpeed;
entity.coefficient = 10.0F;
world.spawnEntityInWorld(entity);