mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
updated static bombs
Replaced fixed blast speed with config value. Added isRemote() check to prevent duplicate entity creation
This commit is contained in:
parent
6424500d22
commit
c379755dfe
@ -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_) {
|
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);
|
TileEntityNukeBoy entity = (TileEntityNukeBoy) p_149695_1_.getTileEntity(x, y, z);
|
||||||
if (p_149695_1_.isBlockIndirectlyGettingPowered(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);
|
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
|
||||||
entity.clearSlots();
|
entity.clearSlots();
|
||||||
p_149695_1_.setBlockToAir(x, y, z);
|
p_149695_1_.setBlockToAir(x, y, z);
|
||||||
@ -151,7 +151,7 @@ public class NukeBoy extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = MainRegistry.boyRadius;
|
entity.destructionRange = MainRegistry.boyRadius;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 10.0F;
|
entity.coefficient = 10.0F;
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ public class NukeBoy extends BlockContainer implements IBomb {
|
|||||||
entity2.posZ = z;
|
entity2.posZ = z;
|
||||||
world.spawnEntityInWorld(entity2);
|
world.spawnEntityInWorld(entity2);
|
||||||
} else {
|
} else {
|
||||||
EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 1000);
|
EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 3000);
|
||||||
entity2.posX = x;
|
entity2.posX = x;
|
||||||
entity2.posY = y - 11;
|
entity2.posY = y - 11;
|
||||||
entity2.posZ = z;
|
entity2.posZ = z;
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
|||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
|
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);
|
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()) {
|
if (entity.isReady()) {
|
||||||
float[] f = entity.returnAllValues();
|
float[] f = entity.returnAllValues();
|
||||||
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
|
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.posY = y + 0.5;
|
||||||
entity.posZ = z + 0.5;
|
entity.posZ = z + 0.5;
|
||||||
entity.destructionRange = (int)schrab;
|
entity.destructionRange = (int)schrab;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 1.0F;
|
entity.coefficient = 1.0F;
|
||||||
entity.waste = false;
|
entity.waste = false;
|
||||||
|
|
||||||
|
|||||||
@ -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_)
|
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);
|
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())
|
if(entity.isReady())
|
||||||
{
|
{
|
||||||
@ -148,7 +148,7 @@ public class NukeFleija extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = r;
|
entity.destructionRange = r;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 1.0F;
|
entity.coefficient = 1.0F;
|
||||||
entity.waste = false;
|
entity.waste = false;
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class NukeGadget extends BlockContainer implements IBomb {
|
|||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
|
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);
|
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()) {
|
if (entity.isReady()) {
|
||||||
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
|
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
|
||||||
entity.clearSlots();
|
entity.clearSlots();
|
||||||
@ -164,7 +164,7 @@ public class NukeGadget extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = MainRegistry.gadgetRadius;
|
entity.destructionRange = MainRegistry.gadgetRadius;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 10.0F;
|
entity.coefficient = 10.0F;
|
||||||
|
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
|
|||||||
@ -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_)
|
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);
|
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())
|
if(entity.isReady())
|
||||||
{
|
{
|
||||||
@ -178,7 +178,7 @@ public class NukeMan extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = MainRegistry.manRadius;
|
entity.destructionRange = MainRegistry.manRadius;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 10.0F;
|
entity.coefficient = 10.0F;
|
||||||
|
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
|
|||||||
@ -118,7 +118,7 @@ public class NukeMike extends BlockContainer implements IBomb {
|
|||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) {
|
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);
|
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()) {
|
if (entity.isReady() && !entity.isFilled()) {
|
||||||
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
|
this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1);
|
||||||
entity.clearSlots();
|
entity.clearSlots();
|
||||||
@ -146,7 +146,7 @@ public class NukeMike extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = r;
|
entity.destructionRange = r;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 10.0F;
|
entity.coefficient = 10.0F;
|
||||||
|
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
|
|||||||
@ -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_)
|
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);
|
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())
|
if(entity.isReady())
|
||||||
{
|
{
|
||||||
@ -159,7 +159,7 @@ public class NukePrototype extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = r;
|
entity.destructionRange = r;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 1.0F;
|
entity.coefficient = 1.0F;
|
||||||
entity.waste = false;
|
entity.waste = false;
|
||||||
|
|
||||||
|
|||||||
@ -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_)
|
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);
|
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())
|
if(entity.isReady() && !entity.isFilled())
|
||||||
{
|
{
|
||||||
@ -155,7 +155,7 @@ public class NukeTsar extends BlockContainer implements IBomb {
|
|||||||
entity.posY = y;
|
entity.posY = y;
|
||||||
entity.posZ = z;
|
entity.posZ = z;
|
||||||
entity.destructionRange = r;
|
entity.destructionRange = r;
|
||||||
entity.speed = 25;
|
entity.speed = MainRegistry.blastSpeed;
|
||||||
entity.coefficient = 10.0F;
|
entity.coefficient = 10.0F;
|
||||||
|
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user