improved Mk3 handling

This commit is contained in:
Bob 2022-10-19 20:09:12 +02:00
parent ed6ce927a2
commit 6fa857fed0
14 changed files with 180 additions and 136 deletions

View File

@ -150,11 +150,14 @@ public class NukeCustom extends BlockContainer implements IBomb {
schrab += amat / 2 + hydro / 4 + nuke / 8 + tnt / 16;
schrab = Math.min(schrab, maxSchrab);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, (int) schrab));
EntityCloudFleija cloud = new EntityCloudFleija(worldObj, (int) schrab);
cloud.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
worldObj.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, (int) schrab);
if(!ex.isDead) {
worldObj.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(worldObj, (int) schrab);
cloud.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
worldObj.spawnEntityInWorld(cloud);
}
/// ANTIMATTER ///
} else if(amat > 0) {

View File

@ -119,15 +119,17 @@ public class NukeFleija extends BlockContainer implements IBomb {
public boolean igniteTestBomb(World world, int x, int y, int z, int r) {
if(!world.isRemote) {
// world.spawnParticle("hugeexplosion", x, y, z, 0, 0, 0);
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(world, x + 0.5, y + 0.5, z + 0.5, r));
EntityCloudFleija cloud = new EntityCloudFleija(world, r);
cloud.posX = x;
cloud.posY = y;
cloud.posZ = z;
world.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, x + 0.5, y + 0.5, z + 0.5, r);
if(!ex.isDead) {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(world, r);
cloud.posX = x;
cloud.posY = y;
cloud.posZ = z;
world.spawnEntityInWorld(cloud);
}
}
return false;

View File

@ -130,15 +130,17 @@ public class NukePrototype extends BlockContainer implements IBomb {
public boolean igniteTestBomb(World world, int x, int y, int z, int r) {
if(!world.isRemote) {
tetn.clearSlots();
// world.spawnParticle("hugeexplosion", x, y, z, 0, 0, 0);
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(world, x + 0.5, y + 0.5, z + 0.5, r));
EntityCloudFleija cloud = new EntityCloudFleija(world, r);
cloud.posX = x;
cloud.posY = y;
cloud.posZ = z;
world.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, x + 0.5, y + 0.5, z + 0.5, r);
if(!ex.isDead) {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(world, r);
cloud.posX = x;
cloud.posY = y;
cloud.posZ = z;
world.spawnEntityInWorld(cloud);
}
}
return false;

View File

@ -117,14 +117,17 @@ public class NukeSolinium extends BlockContainer implements IBomb {
public boolean igniteTestBomb(World world, int x, int y, int z, int r) {
if(!world.isRemote) {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(world, x + 0.5, y + 0.5, z + 0.5, r).makeSol());
EntityCloudSolinium cloud = new EntityCloudSolinium(world, r);
cloud.posX = x;
cloud.posY = y;
cloud.posZ = z;
world.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, x + 0.5, y + 0.5, z + 0.5, r).makeSol();
if(!ex.isDead) {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudSolinium cloud = new EntityCloudSolinium(world, r);
cloud.posX = x;
cloud.posY = y;
cloud.posZ = z;
world.spawnEntityInWorld(cloud);
}
}
return false;

View File

@ -25,14 +25,17 @@ public class EntityGrenadeASchrab extends EntityGrenadeBase {
public void explode() {
if (!this.worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius));
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius);
if(!ex.isDead) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
worldObj.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
}
this.setDead();
}

View File

@ -24,13 +24,16 @@ public class EntityMissileSchrabidium extends EntityMissileBaseAdvanced {
@Override
public void onImpact() {
if(!this.worldObj.isRemote) {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius));
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius);
if(!ex.isDead) {
worldObj.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
}
}
}

View File

@ -540,14 +540,17 @@ public class EntityBulletBase extends Entity implements IProjectile {
}
if(config.rainbow > 0 && !worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, config.rainbow));
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, config.rainbow);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, config.rainbow);
if(!ex.isDead) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
worldObj.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, config.rainbow);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
}
}
if(config.nuke > 0 && !worldObj.isRemote) {

View File

@ -469,15 +469,18 @@ public class EntityExplosiveBeam extends Entity implements IProjectile
private void explode() {
if(!worldObj.isRemote) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, 10));
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 10);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, 10);
if(!ex.isDead) {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
worldObj.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 10);
cloud.posX = this.posX;
cloud.posY = this.posY;
cloud.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(cloud);
}
}
}
}

View File

@ -96,14 +96,17 @@ public class ItemDrop extends Item {
}
if (stack.getItem() != null && stack.getItem() == ModItems.cell_anti_schrabidium && WeaponConfig.dropCell) {
if (!entityItem.worldObj.isRemote) {
entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ, "random.explode", 100.0F, entityItem.worldObj.rand.nextFloat() * 0.1F + 0.9F);
entityItem.worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ, BombConfig.aSchrabRadius));
EntityCloudFleija cloud = new EntityCloudFleija(entityItem.worldObj, BombConfig.aSchrabRadius);
cloud.posX = entityItem.posX;
cloud.posY = entityItem.posY;
cloud.posZ = entityItem.posZ;
entityItem.worldObj.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ, BombConfig.aSchrabRadius);
if(!ex.isDead) {
entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ, "random.explode", 100.0F, entityItem.worldObj.rand.nextFloat() * 0.1F + 0.9F);
entityItem.worldObj.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(entityItem.worldObj, BombConfig.aSchrabRadius);
cloud.posX = entityItem.posX;
cloud.posY = entityItem.posY;
cloud.posZ = entityItem.posZ;
entityItem.worldObj.spawnEntityInWorld(cloud);
}
}
}
if (stack.getItem() != null && stack.getItem() == ModItems.singularity && WeaponConfig.dropSing) {

View File

@ -107,14 +107,17 @@ public class GunB92 extends Item {
setPower(stack, 0);
if(!world.isRemote) {
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(world, entity.posX, entity.posY, entity.posZ, 50));
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 50);
cloud.posX = entity.posX;
cloud.posY = entity.posY;
cloud.posZ = entity.posZ;
world.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, entity.posX, entity.posY, entity.posZ, 50);
if(!ex.isDead) {
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 50);
cloud.posX = entity.posX;
cloud.posY = entity.posY;
cloud.posZ = entity.posZ;
world.spawnEntityInWorld(cloud);
}
}
}
}

View File

@ -94,15 +94,18 @@ public class GunB93 extends Item {
setPower(stack, 0);
if(!world.isRemote) {
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(world, entity.posX, entity.posY, entity.posZ, 50));
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 50);
cloud.posX = entity.posX;
cloud.posY = entity.posY;
cloud.posZ = entity.posZ;
world.spawnEntityInWorld(cloud);
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, entity.posX, entity.posY, entity.posZ, 50);
if(!ex.isDead) {
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 50);
cloud.posX = entity.posX;
cloud.posY = entity.posY;
cloud.posZ = entity.posZ;
world.spawnEntityInWorld(cloud);
}
}
}
}

View File

@ -15,45 +15,47 @@ import net.minecraft.world.World;
public class WeaponizedCell extends Item {
public boolean onEntityItemUpdate(EntityItem item)
{
World world = item.worldObj;
if(item.ticksExisted > 50 * 20 || item.isBurning()) {
if(!world.isRemote) {
if(WeaponConfig.dropStar) {
world.playSoundEffect(item.posX, item.posY, item.posZ, "random.explode", 100.0F, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(world, item.posX, item.posY, item.posZ, 100));
public boolean onEntityItemUpdate(EntityItem item) {
World world = item.worldObj;
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 100);
cloud.posX = item.posX;
cloud.posY = item.posY;
cloud.posZ = item.posZ;
world.spawnEntityInWorld(cloud);
}
item.setDead();
}
}
int randy = (50 * 20) - item.ticksExisted;
if(randy < 1)
randy = 1;
if(item.worldObj.rand.nextInt(50 * 20) >= randy)
world.spawnParticle("reddust", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0);
else
world.spawnParticle("smoke", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0);
if(randy < 100)
world.spawnParticle("lava", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0);
return false;
}
if(item.ticksExisted > 50 * 20 || item.isBurning()) {
if(!world.isRemote) {
if(WeaponConfig.dropStar) {
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, item.posX, item.posY, item.posZ, 100);
if(!ex.isDead) {
world.playSoundEffect(item.posX, item.posY, item.posZ, "random.explode", 100.0F, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 100);
cloud.posX = item.posX;
cloud.posY = item.posY;
cloud.posZ = item.posZ;
world.spawnEntityInWorld(cloud);
}
}
item.setDead();
}
}
int randy = (50 * 20) - item.ticksExisted;
if(randy < 1)
randy = 1;
if(item.worldObj.rand.nextInt(50 * 20) >= randy)
world.spawnParticle("reddust", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0);
else
world.spawnParticle("smoke", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0);
if(randy < 100)
world.spawnParticle("lava", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0);
return false;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {

View File

@ -62,16 +62,18 @@ public class TileEntityCore extends TileEntityMachineBase {
int size = Math.max(Math.min(fill * mod / max, 1000), 50);
//System.out.println(fill + " * " + mod + " / " + max + " = " + size);
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 100000.0F, 1.0F);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, size));
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, size);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, size);
cloud.posX = xCoord;
cloud.posY = yCoord;
cloud.posZ = zCoord;
worldObj.spawnEntityInWorld(cloud);
if(!ex.isDead) {
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 100000.0F, 1.0F);
worldObj.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, size);
cloud.posX = xCoord;
cloud.posY = yCoord;
cloud.posZ = zCoord;
worldObj.spawnEntityInWorld(cloud);
}
}
if(slots[0] != null && slots[2] != null && slots[0].getItem() instanceof ItemCatalyst && slots[2].getItem() instanceof ItemCatalyst)

View File

@ -6,6 +6,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.BombConfig;
import com.hbm.entity.effect.EntityCloudFleija;
import com.hbm.entity.logic.EntityNukeExplosionMK3;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
@ -676,7 +677,15 @@ public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedIn
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F);
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "random.explode", 3.0F, 0.75F);
} else {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord, yCoord, zCoord, BombConfig.fleijaRadius));
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord, yCoord, zCoord, BombConfig.fleijaRadius);
if(!ex.isDead) {
worldObj.spawnEntityInWorld(ex);
EntityCloudFleija cloud = new EntityCloudFleija(worldObj, BombConfig.fleijaRadius);
cloud.posX = xCoord + 0.5;
cloud.posY = yCoord + 0.5;
cloud.posZ = zCoord + 0.6;
worldObj.spawnEntityInWorld(cloud);
}
}
}
}