Meteorite configs, AGP support for diesel gen, selenium functionality

This commit is contained in:
HbmMods 2018-04-04 22:17:24 +02:00
parent 6e9ebe5d52
commit 52ee2538d0
6 changed files with 141 additions and 127 deletions

View File

@ -31,7 +31,7 @@ public class GUIMachineDiesel extends GuiInfoContainer {
super.drawScreen(mouseX, mouseY, f);
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 16, 52);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.powerCap);
String[] text = new String[] { "Accepted Fuels:",
" Diesel (500 HE/t)",

View File

@ -395,6 +395,8 @@ public class MainRegistry
public static boolean enableMeteorStrikes = true;
public static boolean enableMeteorShowers = true;
public static boolean enableMeteorTails = true;
public static boolean enableSpecialMeteors = true;
public static int uraniumSpawn = 7;
public static int titaniumSpawn = 8;
public static int sulfurSpawn = 5;
@ -1248,6 +1250,7 @@ public class MainRegistry
enableMeteorStrikes = config.get(Configuration.CATEGORY_GENERAL, "1.09_enableMeteorStrikes", true).getBoolean(true);
enableMeteorShowers = config.get(Configuration.CATEGORY_GENERAL, "1.10_enableMeteorShowers", true).getBoolean(true);
enableMeteorTails = config.get(Configuration.CATEGORY_GENERAL, "1.11_enableMeteorTails", true).getBoolean(true);
enableSpecialMeteors = config.get(Configuration.CATEGORY_GENERAL, "1.12_enableSpecialMeteors", true).getBoolean(true);
Property PuraniumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.00_uraniumSpawnrate", 7);
PuraniumSpawn.comment = "Ammount of uranium ore veins per chunk";

View File

@ -7,6 +7,7 @@ import com.hbm.tileentity.bomb.TileEntityTurretCheapo;
import com.hbm.tileentity.machine.TileEntityAMSBase;
import com.hbm.tileentity.machine.TileEntityAMSEmitter;
import com.hbm.tileentity.machine.TileEntityAMSLimiter;
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
@ -104,8 +105,16 @@ public class AuxGaugePacket implements IMessage {
}
if (te instanceof TileEntityMachineSeleniumEngine) {
TileEntityMachineSeleniumEngine selenium = (TileEntityMachineSeleniumEngine)te;
if(m.id == 0)
selenium.pistonCount = m.value;
if(m.id == 1)
selenium.powerCap = m.value;
}
if (te instanceof TileEntityMachineDiesel) {
TileEntityMachineDiesel selenium = (TileEntityMachineDiesel)te;
selenium.pistonCount = m.value;
selenium.powerCap = m.value;
}
} catch (Exception x) { }

View File

@ -14,6 +14,7 @@ import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher;
import net.minecraft.entity.player.EntityPlayer;
@ -238,6 +239,7 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento
generate();
PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, (int)powerCap, 0));
}
}

View File

@ -31,8 +31,8 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
public long power;
public int soundCycle = 0;
public static final long maxPower = 100000;
public long powerCap = 100000;
public static final long maxPower = 250000;
public long powerCap = 250000;
public int age = 0;
public List<IConsumer> list = new ArrayList();
public FluidTank tank;
@ -230,10 +230,12 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
// Battery Item
power = Library.chargeItemsFromTE(slots, 13, power, powerCap);
generate();
if(this.pistonCount > 2)
generate();
PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, pistonCount, 0));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, (int)powerCap, 1));
}
}
@ -286,18 +288,15 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
if (soundCycle >= 3)
soundCycle = 0;
//if (this.superTimer > 0)
// soundCycle = 0;
tank.setFill(tank.getFill() - 10);
tank.setFill(tank.getFill() - this.pistonCount * 10);
if (tank.getFill() < 0)
tank.setFill(0);
if (power + getHEFromFuel() <= powerCap) {
power += getHEFromFuel();
} else {
power += getHEFromFuel() * Math.pow(this.pistonCount, 1.15D);
if(power > powerCap)
power = powerCap;
}
}
}
}

View File

@ -34,121 +34,122 @@ public class Meteorite {
e.attackEntityFrom(ModDamageSource.meteorite, 1000);
}
switch(rand.nextInt(300)) {
case 0:
//Meteor-only tiny meteorite
List<ItemStack> list0 = new ArrayList<ItemStack>();
list0.add(new ItemStack(ModBlocks.block_meteor));
generateBox(world, rand, x, y, z, list0);
return;
case 1:
//Large ore-only meteorite
List<ItemStack> list1 = new ArrayList<ItemStack>();
list1.addAll(this.getRandomOre(rand));
int i = list1.size();
for(int j = 0; j < i; j++)
list1.add(new ItemStack(Blocks.stone));
generateSphere7x7(world, rand, x, y, z, list1);
return;
case 2:
//Medium ore-only meteorite
List<ItemStack> list2 = new ArrayList<ItemStack>();
list2.addAll(this.getRandomOre(rand));
int k = list2.size() / 2;
for(int j = 0; j < k; j++)
list2.add(new ItemStack(Blocks.stone));
generateSphere5x5(world, rand, x, y, z, list2);
return;
case 3:
//Small pure ore meteorite
List<ItemStack> list3 = new ArrayList<ItemStack>();
list3.addAll(this.getRandomOre(rand));
generateBox(world, rand, x, y, z, list3);
return;
case 4:
//Bamboozle
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 15F, true);
ExplosionLarge.spawnRubble(world, x, y, z, 25);
return;
case 5:
//Large treasure-only meteorite
List<ItemStack> list4 = new ArrayList<ItemStack>();
list4.add(new ItemStack(ModBlocks.block_meteor_treasure));
list4.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere7x7(world, rand, x, y, z, list4);
return;
case 6:
//Medium treasure-only meteorite
List<ItemStack> list5 = new ArrayList<ItemStack>();
list5.add(new ItemStack(ModBlocks.block_meteor_treasure));
list5.add(new ItemStack(ModBlocks.block_meteor_treasure));
list5.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere5x5(world, rand, x, y, z, list5);
return;
case 7:
//Small pure treasure meteorite
List<ItemStack> list6 = new ArrayList<ItemStack>();
list6.add(new ItemStack(ModBlocks.block_meteor_treasure));
generateBox(world, rand, x, y, z, list6);
return;
case 8:
//Large nuclear meteorite
List<ItemStack> list7 = new ArrayList<ItemStack>();
list7.add(new ItemStack(ModBlocks.block_meteor_treasure));
List<ItemStack> list8 = new ArrayList<ItemStack>();
list8.add(new ItemStack(ModBlocks.toxic_block));
generateSphere7x7(world, rand, x, y, z, list7);
generateSphere5x5(world, rand, x, y, z, list8);
return;
case 9:
//Giant ore meteorite
List<ItemStack> list9 = new ArrayList<ItemStack>();
list9.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere9x9(world, rand, x, y, z, list9);
generateSphere7x7(world, rand, x, y, z, this.getRandomOre(rand));
return;
case 10:
//Tainted Meteorite
List<ItemStack> list10 = new ArrayList<ItemStack>();
list10.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere5x5(world, rand, x, y, z, list10);
world.setBlock(x, y, z, ModBlocks.taint);
return;
case 11:
//Atomic meteorite
EntityNukeExplosionMK3 entity0 = new EntityNukeExplosionMK3(world);
entity0.posX = x + 0.5D;
entity0.posY = y + 0.5D;
entity0.posZ = z + 0.5D;
entity0.destructionRange = MainRegistry.fatmanRadius;
entity0.speed = MainRegistry.blastSpeed;
entity0.coefficient = 10.0F;
world.spawnEntityInWorld(entity0);
if(MainRegistry.polaroidID == 11)
if(rand.nextInt(100) >= 0)
{
ExplosionParticleB.spawnMush(world, x, y - 3, z);
} else {
ExplosionParticle.spawnMush(world, x, y - 3, z);
}
else
if(rand.nextInt(100) == 0)
{
ExplosionParticleB.spawnMush(world, x, y - 3, z);
} else {
ExplosionParticle.spawnMush(world, x, y - 3, z);
}
return;
case 12:
//Star Blaster
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 10F, true);
ItemStack stack = new ItemStack(ModItems.gun_b92);
stack.setStackDisplayName("§9Star Blaster§r");
EntityItem blaster = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack);
world.spawnEntityInWorld(blaster);
return;
}
if(MainRegistry.enableSpecialMeteors)
switch(rand.nextInt(300)) {
case 0:
//Meteor-only tiny meteorite
List<ItemStack> list0 = new ArrayList<ItemStack>();
list0.add(new ItemStack(ModBlocks.block_meteor));
generateBox(world, rand, x, y, z, list0);
return;
case 1:
//Large ore-only meteorite
List<ItemStack> list1 = new ArrayList<ItemStack>();
list1.addAll(this.getRandomOre(rand));
int i = list1.size();
for(int j = 0; j < i; j++)
list1.add(new ItemStack(Blocks.stone));
generateSphere7x7(world, rand, x, y, z, list1);
return;
case 2:
//Medium ore-only meteorite
List<ItemStack> list2 = new ArrayList<ItemStack>();
list2.addAll(this.getRandomOre(rand));
int k = list2.size() / 2;
for(int j = 0; j < k; j++)
list2.add(new ItemStack(Blocks.stone));
generateSphere5x5(world, rand, x, y, z, list2);
return;
case 3:
//Small pure ore meteorite
List<ItemStack> list3 = new ArrayList<ItemStack>();
list3.addAll(this.getRandomOre(rand));
generateBox(world, rand, x, y, z, list3);
return;
case 4:
//Bamboozle
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 15F, true);
ExplosionLarge.spawnRubble(world, x, y, z, 25);
return;
case 5:
//Large treasure-only meteorite
List<ItemStack> list4 = new ArrayList<ItemStack>();
list4.add(new ItemStack(ModBlocks.block_meteor_treasure));
list4.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere7x7(world, rand, x, y, z, list4);
return;
case 6:
//Medium treasure-only meteorite
List<ItemStack> list5 = new ArrayList<ItemStack>();
list5.add(new ItemStack(ModBlocks.block_meteor_treasure));
list5.add(new ItemStack(ModBlocks.block_meteor_treasure));
list5.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere5x5(world, rand, x, y, z, list5);
return;
case 7:
//Small pure treasure meteorite
List<ItemStack> list6 = new ArrayList<ItemStack>();
list6.add(new ItemStack(ModBlocks.block_meteor_treasure));
generateBox(world, rand, x, y, z, list6);
return;
case 8:
//Large nuclear meteorite
List<ItemStack> list7 = new ArrayList<ItemStack>();
list7.add(new ItemStack(ModBlocks.block_meteor_treasure));
List<ItemStack> list8 = new ArrayList<ItemStack>();
list8.add(new ItemStack(ModBlocks.toxic_block));
generateSphere7x7(world, rand, x, y, z, list7);
generateSphere5x5(world, rand, x, y, z, list8);
return;
case 9:
//Giant ore meteorite
List<ItemStack> list9 = new ArrayList<ItemStack>();
list9.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere9x9(world, rand, x, y, z, list9);
generateSphere7x7(world, rand, x, y, z, this.getRandomOre(rand));
return;
case 10:
//Tainted Meteorite
List<ItemStack> list10 = new ArrayList<ItemStack>();
list10.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere5x5(world, rand, x, y, z, list10);
world.setBlock(x, y, z, ModBlocks.taint);
return;
case 11:
//Atomic meteorite
EntityNukeExplosionMK3 entity0 = new EntityNukeExplosionMK3(world);
entity0.posX = x + 0.5D;
entity0.posY = y + 0.5D;
entity0.posZ = z + 0.5D;
entity0.destructionRange = MainRegistry.fatmanRadius;
entity0.speed = MainRegistry.blastSpeed;
entity0.coefficient = 10.0F;
world.spawnEntityInWorld(entity0);
if(MainRegistry.polaroidID == 11)
if(rand.nextInt(100) >= 0)
{
ExplosionParticleB.spawnMush(world, x, y - 3, z);
} else {
ExplosionParticle.spawnMush(world, x, y - 3, z);
}
else
if(rand.nextInt(100) == 0)
{
ExplosionParticleB.spawnMush(world, x, y - 3, z);
} else {
ExplosionParticle.spawnMush(world, x, y - 3, z);
}
return;
case 12:
//Star Blaster
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 10F, true);
ItemStack stack = new ItemStack(ModItems.gun_b92);
stack.setStackDisplayName("§9Star Blaster§r");
EntityItem blaster = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack);
world.spawnEntityInWorld(blaster);
return;
}
switch(rand.nextInt(3)) {
case 0: