more INDEX crap

This commit is contained in:
Boblet 2025-05-14 11:51:30 +02:00
parent 4ce7e396be
commit a43986603b
28 changed files with 211 additions and 226 deletions

View File

@ -1,7 +1,13 @@
package com.hbm.blocks.bomb; package com.hbm.blocks.bomb;
import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
import com.hbm.explosion.vanillant.standard.ExplosionEffectTiny;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.interfaces.IBomb; import com.hbm.interfaces.IBomb;
import com.hbm.particle.helper.ExplosionCreator;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -17,9 +23,7 @@ public class BombFlameWar extends Block implements IBomb {
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
if(world.isBlockIndirectlyGettingPowered(x, y, z)) { if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
ExplosionChaos.explode(world, x, y, z, 15); explode(world, x, y, z);
ExplosionChaos.spawnExplosion(world, x, y, z, 75);
ExplosionChaos.flameDeath(world, x, y, z, 100);
} }
} }
@ -27,9 +31,24 @@ public class BombFlameWar extends Block implements IBomb {
public BombReturnCode explode(World world, int x, int y, int z) { public BombReturnCode explode(World world, int x, int y, int z) {
if(!world.isRemote) { if(!world.isRemote) {
ExplosionChaos.explode(world, x, y, z, 15);
ExplosionChaos.spawnExplosion(world, x, y, z, 75); world.func_147480_a(x, y, z, false);
ExplosionChaos.flameDeath(world, x, y, z, 100);
for(int i = 0; i < 150; i++) {
ExplosionVNT vnt = new ExplosionVNT(world, x + world.rand.nextInt(51) - 25, y + world.rand.nextInt(11) - 5, z + world.rand.nextInt(51) - 25, 4, null);
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 25));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectTiny());
vnt.explode();
}
ExplosionVNT xnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 15F);
xnt.setBlockAllocator(new BlockAllocatorStandard(32));
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
xnt.setEntityProcessor(new EntityProcessorCrossSmooth(2, 200));
xnt.setPlayerProcessor(new PlayerProcessorStandard());
xnt.explode();
ExplosionCreator.composeEffectSmall(world, x + 0.5, y + 0.5, z + 0.5);
} }
return BombReturnCode.DETONATED; return BombReturnCode.DETONATED;

View File

@ -18,10 +18,12 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.entity.effect.EntityMist;
import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.interfaces.IBomb; import com.hbm.interfaces.IBomb;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityBombMulti; import com.hbm.tileentity.bomb.TileEntityBombMulti;
@ -169,7 +171,11 @@ public class BombMulti extends BlockContainer implements IBomb {
} }
if(gasCloud > 0) { if(gasCloud > 0) {
ExplosionChaos.spawnChlorine(world, x, y, z, gasCloud, gasCloud / 50, 0); EntityMist mist = new EntityMist(world);
mist.setType(Fluids.CHLORINE);
mist.setPosition(x + 0.5, y + 0.5, z + 0.5);
mist.setArea(gasCloud * 15F / 50F, gasCloud * 7.5F / 50F);
world.spawnEntityInWorld(mist);
} }
return BombReturnCode.DETONATED; return BombReturnCode.DETONATED;

View File

@ -69,7 +69,7 @@ public class ExplosiveCharge extends BlockDetonatable implements IBomb, IDetConn
} }
if(this == ModBlocks.det_nuke) { if(this == ModBlocks.det_nuke) {
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.missileRadius); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.missileRadius);
} }
} }

View File

@ -179,7 +179,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
dirty *= 0.25F; dirty *= 0.25F;
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int)hydro, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).moreFallout((int)dirty)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int)hydro, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).moreFallout((int)dirty));
EntityNukeTorex.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, hydro); EntityNukeTorex.statFacStandard(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, hydro);
/// NUCLEAR /// /// NUCLEAR ///
} else if(nuke > 0) { } else if(nuke > 0) {
@ -188,7 +188,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
nuke = Math.min(nuke, maxNuke); nuke = Math.min(nuke, maxNuke);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int)nuke, xCoord + 0.5, yCoord + 5, zCoord + 0.5).moreFallout((int)dirty)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int)nuke, xCoord + 0.5, yCoord + 5, zCoord + 0.5).moreFallout((int)dirty));
EntityNukeTorex.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, nuke); EntityNukeTorex.statFacStandard(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, nuke);
/// NON-NUCLEAR /// /// NON-NUCLEAR ///
} else if(tnt >= 75) { } else if(tnt >= 75) {
@ -196,7 +196,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
tnt = Math.min(tnt, maxTnt); tnt = Math.min(tnt, maxTnt);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(worldObj, (int)tnt, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(worldObj, (int)tnt, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5));
EntityNukeTorex.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, tnt); EntityNukeTorex.statFacStandard(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, tnt);
} else if(tnt > 0) { } else if(tnt > 0) {
ExplosionLarge.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, tnt, true, true, true); ExplosionLarge.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, tnt, true, true, true);

View File

@ -131,7 +131,7 @@ public class NukeGadget extends BlockContainer implements IBomb {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.gadgetRadius, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.gadgetRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.gadgetRadius); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.gadgetRadius);
} }
return false; return false;

View File

@ -124,7 +124,7 @@ public class NukeMan extends BlockContainer implements IBomb {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.manRadius, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.manRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.manRadius); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.manRadius);
} }
return false; return false;

View File

@ -131,7 +131,7 @@ public class NukeMike extends BlockContainer implements IBomb {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.mikeRadius, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.mikeRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.mikeRadius); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.mikeRadius);
} }
return false; return false;

View File

@ -120,7 +120,7 @@ public class NukeN2 extends BlockContainer implements IBomb {
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, r, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, r, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, r); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, r);
} }
return false; return false;

View File

@ -129,7 +129,7 @@ public class NukeTsar extends BlockContainer implements IBomb {
tetn.clearSlots(); tetn.clearSlots();
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, r, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, r, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, r); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, r);
} }
return false; return false;

View File

@ -27,7 +27,7 @@ public class TestCore extends Block {
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.missileRadius); EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.missileRadius);
} else if(meta > 0) { } else if(meta > 0) {

View File

@ -45,16 +45,8 @@ public class EntityNukeTorex extends Entity {
this.dataWatcher.addObject(11, new Integer(0)); this.dataWatcher.addObject(11, new Integer(0));
} }
@Override @Override @SideOnly(Side.CLIENT) public int getBrightnessForRender(float interp) { return 15728880; }
@SideOnly(Side.CLIENT) @Override public float getBrightness(float interp) { return 1.0F; }
public int getBrightnessForRender(float p_70070_1_) {
return 15728880;
}
@Override
public float getBrightness(float p_70013_1_) {
return 1.0F;
}
@Override @Override
public void onUpdate() { public void onUpdate() {
@ -574,16 +566,12 @@ public class EntityNukeTorex extends Entity {
return true; return true;
} }
public static void statFac(World world, double x, double y, double z, float scale) { public static void statFacStandard(World world, double x, double y, double z, float scale) { statFac(world, x, y, z, scale, 0); }
EntityNukeTorex torex = new EntityNukeTorex(world).setScale(MathHelper.clamp_float((float) BobMathUtil.squirt(scale * 0.01) * 1.5F, 0.5F, 5F)); public static void statFacBale(World world, double x, double y, double z, float scale) { statFac(world, x, y, z, scale, 1); }
torex.setPosition(x, y, z);
torex.forceSpawn = true;
world.spawnEntityInWorld(torex);
TrackerUtil.setTrackingRange(world, torex, 1000);
}
public static void statFacBale(World world, double x, double y, double z, float scale) { public static void statFac(World world, double x, double y, double z, float scale, int type) {
EntityNukeTorex torex = new EntityNukeTorex(world).setScale(MathHelper.clamp_float((float) BobMathUtil.squirt(scale * 0.01) * 1.5F, 0.5F, 5F)).setType(1); EntityNukeTorex torex = new EntityNukeTorex(world).setScale(MathHelper.clamp_float((float) BobMathUtil.squirt(scale * 0.01) * 1.5F, 0.5F, 5F));
torex.setType(type);
torex.setPosition(x, y, z); torex.setPosition(x, y, z);
torex.forceSpawn = true; torex.forceSpawn = true;
world.spawnEntityInWorld(torex); world.spawnEntityInWorld(torex);

View File

@ -26,7 +26,7 @@ public class EntityGrenadeCloud extends EntityGrenadeBase {
this.setDead(); this.setDead();
this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, 250, 1.5, 1); ExplosionChaos.spawnPoisonCloud(worldObj, posX, posY, posZ, 250, 1.5, 1);
} }
} }
} }

View File

@ -37,7 +37,6 @@ public class EntityGrenadeIFToxic extends EntityGrenadeBouncyBase {
ExplosionLarge.explode(worldObj, posX, posY, posZ, 2, true, true, true); ExplosionLarge.explode(worldObj, posX, posY, posZ, 2, true, true, true);
ExplosionChaos.poison(worldObj, (int)posX, (int)posY, (int)posZ, 12); ExplosionChaos.poison(worldObj, (int)posX, (int)posY, (int)posZ, 12);
ExplosionNukeGeneric.waste(worldObj, (int)posX, (int)posY, (int)posZ, 12); ExplosionNukeGeneric.waste(worldObj, (int)posX, (int)posY, (int)posZ, 12);
ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, 50, 1.5, 0);
} }
} }

View File

@ -26,7 +26,7 @@ public class EntityGrenadePC extends EntityGrenadeBase {
this.setDead(); this.setDead();
this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, 500, 2, 2); ExplosionChaos.spawnPoisonCloud(worldObj, posX, posY, posZ, 500, 2, 2);
} }
} }
} }

View File

@ -61,7 +61,7 @@ public class EntityBomber extends EntityPlaneBase {
if(type == 3) { if(type == 3) {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F); worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
ExplosionChaos.spawnChlorine(worldObj, this.posX, this.posY - 1F, this.posZ, 10, 0.5, 3); ExplosionChaos.spawnPoisonCloud(worldObj, this.posX, this.posY - 1F, this.posZ, 10, 0.5, 3);
} else if(type == 5) { } else if(type == 5) {
@ -75,7 +75,7 @@ public class EntityBomber extends EntityPlaneBase {
} else if(type == 7) { } else if(type == 7) {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F); worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
ExplosionChaos.spawnChlorine(worldObj, this.posX, worldObj.getHeightValue((int) this.posX, (int) this.posZ) + 2, this.posZ, 10, 1, 2); ExplosionChaos.spawnPoisonCloud(worldObj, this.posX, worldObj.getHeightValue((int) this.posX, (int) this.posZ) + 2, this.posZ, 10, 1, 2);
} else { } else {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "hbm:entity.bombWhistle", 10.0F, 0.9F + rand.nextFloat() * 0.2F); worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "hbm:entity.bombWhistle", 10.0F, 0.9F + rand.nextFloat() * 0.2F);

View File

@ -190,7 +190,7 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
case NUCLEAR: case NUCLEAR:
case TX: case TX:
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int) strength, posX, posY, posZ)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int) strength, posX, posY, posZ));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, strength); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, strength);
break; break;
case BALEFIRE: case BALEFIRE:
EntityBalefire bf = new EntityBalefire(worldObj); EntityBalefire bf = new EntityBalefire(worldObj);
@ -203,7 +203,7 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
break; break;
case N2: case N2:
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(worldObj, (int) strength, posX, posY, posZ)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(worldObj, (int) strength, posX, posY, posZ));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, strength); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, strength);
break; break;
case TAINT: case TAINT:
int r = (int) strength; int r = (int) strength;
@ -219,7 +219,7 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
break; break;
case CLOUD: case CLOUD:
this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 0); this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 0);
ExplosionChaos.spawnChlorine(worldObj, posX - motionX, posY - motionY, posZ - motionZ, 750, 2.5, 2); ExplosionChaos.spawnPoisonCloud(worldObj, posX - motionX, posY - motionY, posZ - motionZ, 750, 2.5, 2);
break; break;
case TURBINE: case TURBINE:
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10, true, false, true); ExplosionLarge.explode(worldObj, posX, posY, posZ, 10, true, false, true);

View File

@ -65,7 +65,7 @@ public abstract class EntityMissileTier4 extends EntityMissileBaseNT {
public EntityMissileNuclear(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); } public EntityMissileNuclear(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
@Override public void onImpact() { @Override public void onImpact() {
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ)); this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, BombConfig.missileRadius);
} }
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_nuclear); } @Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_nuclear); }
@Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_nuclear); } @Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_nuclear); }
@ -76,7 +76,7 @@ public abstract class EntityMissileTier4 extends EntityMissileBaseNT {
public EntityMissileMirv(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); } public EntityMissileMirv(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
@Override public void onImpact() { @Override public void onImpact() {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius * 2); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, BombConfig.missileRadius * 2);
} }
@Override public List<ItemStack> getDebris() { @Override public List<ItemStack> getDebris() {
List<ItemStack> list = new ArrayList<ItemStack>(); List<ItemStack> list = new ArrayList<ItemStack>();
@ -107,7 +107,7 @@ public abstract class EntityMissileTier4 extends EntityMissileBaseNT {
public EntityMissileDoomsday(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); } public EntityMissileDoomsday(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
@Override public void onImpact() { @Override public void onImpact() {
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ).moreFallout(100)); this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ).moreFallout(100));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius * 2); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, BombConfig.missileRadius * 2);
} }
@Override public List<ItemStack> getDebris() { return null; } @Override public List<ItemStack> getDebris() { return null; }
@Override public ItemStack getDebrisRareDrop() { return null; } @Override public ItemStack getDebrisRareDrop() { return null; }
@ -120,7 +120,7 @@ public abstract class EntityMissileTier4 extends EntityMissileBaseNT {
public EntityMissileDoomsdayRusted(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); } public EntityMissileDoomsdayRusted(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
@Override public void onImpact() { @Override public void onImpact() {
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ).moreFallout(100)); this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ).moreFallout(100));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, BombConfig.missileRadius);
} }
@Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_doomsday_rusted); } @Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_doomsday_rusted); }
} }

View File

@ -1,8 +1,8 @@
package com.hbm.entity.projectile; package com.hbm.entity.projectile;
import com.hbm.config.BombConfig; import com.hbm.config.BombConfig;
import com.hbm.entity.effect.EntityMist;
import com.hbm.entity.logic.EntityNukeExplosionMK5; import com.hbm.entity.logic.EntityNukeExplosionMK5;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.vanillant.ExplosionVNT; import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard; import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
import com.hbm.explosion.vanillant.standard.BlockMutatorFire; import com.hbm.explosion.vanillant.standard.BlockMutatorFire;
@ -11,6 +11,7 @@ import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon; import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard; import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.handler.threading.PacketThreading; import com.hbm.handler.threading.PacketThreading;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.packet.toclient.AuxParticlePacketNT; import com.hbm.packet.toclient.AuxParticlePacketNT;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
@ -70,7 +71,11 @@ public class EntityBombletZeta extends EntityThrowable {
} }
if(type == 2) { if(type == 2) {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F); worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
ExplosionChaos.spawnChlorine(worldObj, this.posX + 0.5F - motionX, this.posY + 0.5F - motionY, this.posZ + 0.5F - motionZ, 75, 2, 0); EntityMist mist = new EntityMist(worldObj);
mist.setType(Fluids.CHLORINE);
mist.setPosition(this.posX - motionX, this.posY - motionY, this.posZ - motionZ);
mist.setArea(15, 7.5F);
worldObj.spawnEntityInWorld(mist);
} }
if(type == 4) { if(type == 4) {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int) (BombConfig.fatmanRadius * 1.5), posX, posY, posZ)); worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int) (BombConfig.fatmanRadius * 1.5), posX, posY, posZ));

View File

@ -9,7 +9,6 @@ import com.hbm.entity.effect.EntityCloudFleijaRainbow;
import com.hbm.entity.effect.EntityEMPBlast; import com.hbm.entity.effect.EntityEMPBlast;
import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.entity.logic.EntityNukeExplosionMK3;
import com.hbm.entity.logic.EntityNukeExplosionMK5; import com.hbm.entity.logic.EntityNukeExplosionMK5;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.explosion.vanillant.ExplosionVNT; import com.hbm.explosion.vanillant.ExplosionVNT;
@ -447,11 +446,6 @@ public class EntityBulletBaseNT extends EntityThrowableInterp implements IBullet
if(config.shrapnel > 0 && !worldObj.isRemote) if(config.shrapnel > 0 && !worldObj.isRemote)
ExplosionLarge.spawnShrapnels(worldObj, posX, posY, posZ, config.shrapnel); ExplosionLarge.spawnShrapnels(worldObj, posX, posY, posZ, config.shrapnel);
if(config.chlorine > 0 && !worldObj.isRemote) {
ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, config.chlorine, 1.5, 0);
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
}
if(config.rainbow > 0 && !worldObj.isRemote) { if(config.rainbow > 0 && !worldObj.isRemote) {
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, config.rainbow); EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, config.rainbow);
if(!ex.isDead) { if(!ex.isDead) {

View File

@ -490,7 +490,7 @@ public class EntityModBeam extends Entity implements IProjectile {
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.gadgetRadius, posX, posY, posZ)); this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.gadgetRadius, posX, posY, posZ));
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.gadgetRadius); EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, BombConfig.gadgetRadius);
} }
} }
} }

View File

@ -7,7 +7,6 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.entity.grenade.EntityGrenadeTau; import com.hbm.entity.grenade.EntityGrenadeTau;
import com.hbm.entity.grenade.EntityGrenadeZOMG; import com.hbm.entity.grenade.EntityGrenadeZOMG;
import com.hbm.entity.item.EntityFallingBlockNT; import com.hbm.entity.item.EntityFallingBlockNT;
import com.hbm.entity.particle.EntityChlorineFX;
import com.hbm.entity.particle.EntityCloudFX; import com.hbm.entity.particle.EntityCloudFX;
import com.hbm.entity.particle.EntityModFX; import com.hbm.entity.particle.EntityModFX;
import com.hbm.entity.particle.EntityOrangeFX; import com.hbm.entity.particle.EntityOrangeFX;
@ -28,7 +27,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityArrow;
@ -40,34 +38,13 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@Deprecated
@Spaghetti("my eyes are bleeding") @Spaghetti("my eyes are bleeding")
public class ExplosionChaos { public class ExplosionChaos { //TODO: destroy this entire class
private final static Random random = new Random(); private final static Random random = new Random();
private static Random rand = new Random(); private static Random rand = new Random();
public static void explode(World world, int x, int y, int z, int bombStartStrength) {
int r = bombStartStrength;
int r2 = r * r;
int r22 = r2 / 2;
for (int xx = -r; xx < r; xx++) {
int X = xx + x;
int XX = xx * xx;
for (int yy = -r; yy < r; yy++) {
int Y = yy + y;
int YY = XX + yy * yy;
for (int zz = -r; zz < r; zz++) {
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
destruction(world, X, Y, Z);
}
}
}
}
}
public static void hardenVirus(World world, int x, int y, int z, int bombStartStrength) { public static void hardenVirus(World world, int x, int y, int z, int bombStartStrength) {
int r = bombStartStrength; int r = bombStartStrength;
@ -130,8 +107,10 @@ public class ExplosionChaos {
int ZZ = YY + zz * zz; int ZZ = YY + zz * zz;
if (ZZ < r22) { if (ZZ < r22) {
if(world.getBlock(X, Y, Z).getExplosionResistance(null) <= 70) if(world.getBlock(X, Y, Z).getExplosionResistance(null) <= 70) {
pDestruction(world, X, Y, Z); EntityFallingBlockNT entityfallingblock = new EntityFallingBlockNT(world, X + 0.5, Y + 0.5, Z + 0.5, world.getBlock(X, Y, Z), world.getBlockMetadata(X, Y, Z));
world.spawnEntityInWorld(entityfallingblock);
}
} }
} }
} }
@ -183,79 +162,6 @@ public class ExplosionChaos {
} }
} }
public static void spawnExplosion(World world, int x, int y, int z, int bound) {
int randX;
int randY;
int randZ;
for (int i = 0; i < 25; i++) {
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x + randX, y + randY, z + randZ, 10.0F, true);
// ExplosionChaos.explode(world, x + randX, y + randY, z + randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x + randX, y - randY, z + randZ, 10.0F, true);
// ExplosionChaos.explode(world, x - randX, y + randY, z + randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x + randX, y + randY, z - randZ, 10.0F, true);
// ExplosionChaos.explode(world, x + randX, y - randY, z + randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x - randX, y + randY, z + randZ, 10.0F, true);
// ExplosionChaos.explode(world, x + randX, y + randY, z - randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x - randX, y - randY, z + randZ, 10.0F, true);
// ExplosionChaos.explode(world, x - randX, y - randY, z + randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x - randX, y + randY, z - randZ, 10.0F, true);
// ExplosionChaos.explode(world, x - randX, y + randY, z - randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x + randX, y - randY, z - randZ, 10.0F, true);
// ExplosionChaos.explode(world, x + randX, y - randY, z - randZ,
// 5);
randX = random.nextInt(bound);
randY = random.nextInt(bound);
randZ = random.nextInt(bound);
world.createExplosion(null, x - randX, y - randY, z - randZ, 10.0F, true);
// ExplosionChaos.explode(world, x - randX, y - randY, z - randZ,
// 5);
}
}
/** /**
* Sets all flammable blocks on fire * Sets all flammable blocks on fire
* *
@ -327,15 +233,13 @@ public class ExplosionChaos {
} }
public static void spawnChlorine(World world, double x, double y, double z, int count, double speed, int type) { @Deprecated public static void spawnPoisonCloud(World world, double x, double y, double z, int count, double speed, int type) {
for(int i = 0; i < count; i++) { for(int i = 0; i < count; i++) {
EntityModFX fx = null; EntityModFX fx = null;
if(type == 0) { if(type == 1) {
fx = new EntityChlorineFX(world, x, y, z, 0.0, 0.0, 0.0);
} else if(type == 1) {
fx = new EntityCloudFX(world, x, y, z, 0.0, 0.0, 0.0); fx = new EntityCloudFX(world, x, y, z, 0.0, 0.0, 0.0);
} else if(type == 2) { } else if(type == 2) {
fx = new EntityPinkCloudFX(world, x, y, z, 0.0, 0.0, 0.0); fx = new EntityPinkCloudFX(world, x, y, z, 0.0, 0.0, 0.0);
@ -365,25 +269,6 @@ public class ExplosionChaos {
} }
} }
public static void destruction(World world, int x, int y, int z) {
if (world.getBlock(x, y, z) == Blocks.bedrock || world.getBlock(x, y, z) == ModBlocks.reinforced_brick
|| world.getBlock(x, y, z) == ModBlocks.reinforced_sand
|| world.getBlock(x, y, z) == ModBlocks.reinforced_glass
|| world.getBlock(x, y, z) == ModBlocks.reinforced_lamp_on
|| world.getBlock(x, y, z) == ModBlocks.reinforced_lamp_off) {
} else {
world.setBlock(x, y, z, Blocks.air);
}
}
public static void pDestruction(World world, int x, int y, int z) {
EntityFallingBlockNT entityfallingblock = new EntityFallingBlockNT(world, (double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
world.spawnEntityInWorld(entityfallingblock);
}
public static void cluster(World world, int x, int y, int z, int count, int gravity) { public static void cluster(World world, int x, int y, int z, int count, int gravity) {
double d1 = 0; double d1 = 0;
@ -436,35 +321,6 @@ public class ExplosionChaos {
} }
} }
public static void nuke(World world, int x, int y, int z, int count) {
double d1 = 0;
double d2 = 0;
double d3 = 0;
EntityTNTPrimed fragment;
for (int i = 0; i < 5; i++) {
d1 = rand.nextDouble();
d2 = rand.nextDouble();
d3 = rand.nextDouble();
if (rand.nextInt(2) == 0) {
d1 *= -1;
}
if (rand.nextInt(2) == 0) {
d3 *= -1;
}
fragment = new EntityTNTPrimed(world);
fragment.motionX = d1;
fragment.motionY = d2;
fragment.motionZ = d3;
world.spawnEntityInWorld(fragment);
}
}
public static void frag(World world, int x, int y, int z, int count, boolean flame, Entity shooter) { public static void frag(World world, int x, int y, int z, int count, boolean flame, Entity shooter) {
double d1 = 0; double d1 = 0;

View File

@ -43,15 +43,14 @@ public class ItemLens extends Item {
stack.stackTagCompound.setLong("damage", damage); stack.stackTagCompound.setLong("damage", damage);
} }
public double getDurabilityForDisplay(ItemStack stack)
{
return (double)getLensDamage(stack) / (double)maxDamage;
}
public boolean showDurabilityBar(ItemStack stack)
{
return getDurabilityForDisplay(stack) != 0;
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
return (double) getLensDamage(stack) / (double) maxDamage;
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
return getDurabilityForDisplay(stack) != 0;
}
} }

View File

@ -152,7 +152,7 @@ public class WeaponSpecial extends ItemSword {
if(entityPlayer.fallDistance >= 20 && !((EntityPlayer)entityPlayer).capabilities.isCreativeMode) { if(entityPlayer.fallDistance >= 20 && !((EntityPlayer)entityPlayer).capabilities.isCreativeMode) {
if(!world.isRemote) { if(!world.isRemote) {
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, 100, entity.posX, entity.posY, entity.posZ)); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, 100, entity.posX, entity.posY, entity.posZ));
EntityNukeTorex.statFac(world, entity.posX, entity.posY, entity.posZ, 100); EntityNukeTorex.statFacStandard(world, entity.posX, entity.posY, entity.posZ, 100);
} }
} }
} }

View File

@ -262,7 +262,7 @@ public class ItemAmmoArty extends Item {
this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) { this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) {
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
shell.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(shell.worldObj, BombConfig.missileRadius, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord)); shell.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(shell.worldObj, BombConfig.missileRadius, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
EntityNukeTorex.statFac(shell.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, BombConfig.missileRadius); EntityNukeTorex.statFacStandard(shell.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, BombConfig.missileRadius);
shell.setDead(); shell.setDead();
} }
}; };

View File

@ -93,7 +93,7 @@ public class XFactoryFolly {
if(bullet.isDead) return; if(bullet.isDead) return;
bullet.setDead(); bullet.setDead();
bullet.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(bullet.worldObj, 100, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord)); bullet.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(bullet.worldObj, 100, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
EntityNukeTorex.statFac(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 100); EntityNukeTorex.statFacStandard(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 100);
}; };
public static void init() { public static void init() {

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
import api.hbm.block.ILaserable; import api.hbm.block.ILaserable;
import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.energymk2.IEnergyReceiverMK2;
import api.hbm.fluid.IFluidStandardReceiver; import api.hbm.fluid.IFluidStandardReceiver;
import api.hbm.redstoneoverradio.IRORInteractive;
import api.hbm.tile.IInfoProviderEC; import api.hbm.tile.IInfoProviderEC;
import com.hbm.handler.CompatHandler; import com.hbm.handler.CompatHandler;
@ -38,7 +39,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.List; import java.util.List;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyReceiverMK2, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent { public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyReceiverMK2, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent, IRORInteractive {
public long power; public long power;
public static final long maxPower = 1000000000L; public static final long maxPower = 1000000000L;
@ -336,4 +337,46 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, joules > 0 || prev > 0 ? 20 : 0); data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, joules > 0 || prev > 0 ? 20 : 0);
data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, maxPower * watts / 2000); data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, maxPower * watts / 2000);
} }
@Override
public String[] getFunctionInfo() {
return new String[] {
PREFIX_FUNCTION + "setpower" + NAME_SEPARATOR + "percent",
PREFIX_FUNCTION + "toggle",
PREFIX_FUNCTION + "switch" + NAME_SEPARATOR + "on/off",
};
}
@Override
public String runRORFunction(String name, String[] params) {
if((PREFIX_FUNCTION + "setpower").equals(name) && params.length > 0) {
int watts = IRORInteractive.parseInt(params[0], 0, 100);
this.watts = watts;
this.markChanged();
return null;
}
if((PREFIX_FUNCTION + "toggle").equals(name)) {
this.isOn = !this.isOn;
this.markChanged();
return null;
}
if((PREFIX_FUNCTION + "switch").equals(name) && params.length > 0) {
if("on".equals(params[0])) {
this.isOn = true;
this.markChanged();
return null;
}
if("off".equals(params[0])) {
this.isOn = false;
this.markChanged();
return null;
}
}
return null;
}
} }

View File

@ -10,6 +10,8 @@ import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.CompatEnergyControl; import com.hbm.util.CompatEnergyControl;
import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.energymk2.IEnergyReceiverMK2;
import api.hbm.redstoneoverradio.IRORInteractive;
import api.hbm.redstoneoverradio.IRORValueProvider;
import api.hbm.tile.IInfoProviderEC; import api.hbm.tile.IInfoProviderEC;
import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -29,7 +31,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyReceiverMK2, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent { public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyReceiverMK2, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent, IRORValueProvider, IRORInteractive {
public long power; public long power;
public static final long maxPower = 2500000000L; public static final long maxPower = 2500000000L;
@ -245,4 +247,33 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
else else
data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, 0); data.setDouble(CompatEnergyControl.D_CONSUMPTION_HE, 0);
} }
@Override
public String[] getFunctionInfo() {
return new String[] {
PREFIX_VALUE + "durability",
PREFIX_VALUE + "durabilitypercent",
PREFIX_FUNCTION + "setpower" + NAME_SEPARATOR + "percent",
};
}
@Override
public String provideRORValue(String name) {
if((PREFIX_VALUE + "durability").equals(name)) return (slots[0] != null && slots[0].getItem() == ModItems.ams_lens) ? "" + (((ItemLens) slots[0].getItem()).maxDamage - ItemLens.getLensDamage(slots[0])) : "0";
if((PREFIX_VALUE + "durabilitypercent").equals(name)) return (slots[0] != null && slots[0].getItem() == ModItems.ams_lens) ? "" + ((((ItemLens) slots[0].getItem()).maxDamage - ItemLens.getLensDamage(slots[0])) * 100 / ((ItemLens) slots[0].getItem()).maxDamage) : "0";
return null;
}
@Override
public String runRORFunction(String name, String[] params) {
if((PREFIX_FUNCTION + "setpower").equals(name) && params.length > 0) {
int watts = IRORInteractive.parseInt(params[0], 0, 100);
this.watts = watts;
this.markChanged();
return null;
}
return null;
}
} }

View File

@ -32,6 +32,8 @@ import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.energymk2.IEnergyReceiverMK2;
import api.hbm.fluid.IFluidStandardTransceiver; import api.hbm.fluid.IFluidStandardTransceiver;
import api.hbm.redstoneoverradio.IRORInteractive;
import api.hbm.redstoneoverradio.IRORValueProvider;
import api.hbm.tile.IInfoProviderEC; import api.hbm.tile.IInfoProviderEC;
import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
@ -52,7 +54,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityITER extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC, SimpleComponent, CompatHandler.OCComponent, IFluidCopiable { public class TileEntityITER extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC, SimpleComponent, CompatHandler.OCComponent, IFluidCopiable, IRORValueProvider, IRORInteractive {
public long power; public long power;
public static final long maxPower = 10000000; public static final long maxPower = 10000000;
@ -657,4 +659,47 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
public FluidTank getTankToPaste() { public FluidTank getTankToPaste() {
return null; return null;
} }
@Override
public String[] getFunctionInfo() {
return new String[] {
PREFIX_VALUE + "durability",
PREFIX_VALUE + "durabilitypercent",
PREFIX_FUNCTION + "toggle",
PREFIX_FUNCTION + "switch" + NAME_SEPARATOR + "on/off",
};
}
@Override
public String provideRORValue(String name) {
if((PREFIX_VALUE + "durability").equals(name)) return (slots[3] != null && slots[3].getItem() instanceof ItemFusionShield) ? "" + (((ItemFusionShield) slots[3].getItem()).maxDamage - ItemFusionShield.getShieldDamage(slots[3])) : "0";
if((PREFIX_VALUE + "durabilitypercent").equals(name)) return (slots[3] != null && slots[3].getItem() instanceof ItemFusionShield) ? "" + ((((ItemFusionShield) slots[3].getItem()).maxDamage - ItemFusionShield.getShieldDamage(slots[3])) * 100 / ((ItemFusionShield) slots[3].getItem()).maxDamage) : "0";
return null;
}
@Override
public String runRORFunction(String name, String[] params) {
if((PREFIX_FUNCTION + "toggle").equals(name)) {
this.isOn = !this.isOn;
this.markChanged();
return null;
}
if((PREFIX_FUNCTION + "switch").equals(name) && params.length > 0) {
if("on".equals(params[0])) {
this.isOn = true;
this.markChanged();
return null;
}
if("off".equals(params[0])) {
this.isOn = false;
this.markChanged();
return null;
}
}
return null;
}
} }