diff options
author | kekzdealer <kekzdealer@gmail.com> | 2020-05-13 11:29:09 +0200 |
---|---|---|
committer | kekzdealer <kekzdealer@gmail.com> | 2020-05-13 11:29:09 +0200 |
commit | 1731699923f01e166a2c3520a7afe10d7b31e28b (patch) | |
tree | c7574e529f011b281ab89909d971ae8eb09824a6 /src/main/java/common | |
parent | b9a3cc65e4a89990d8816fd6e815c0a84228ae6d (diff) | |
download | GT5-Unofficial-1731699923f01e166a2c3520a7afe10d7b31e28b.tar.gz GT5-Unofficial-1731699923f01e166a2c3520a7afe10d7b31e28b.tar.bz2 GT5-Unofficial-1731699923f01e166a2c3520a7afe10d7b31e28b.zip |
code cleanup, recipe fix
Diffstat (limited to 'src/main/java/common')
4 files changed, 68 insertions, 50 deletions
diff --git a/src/main/java/common/Recipes.java b/src/main/java/common/Recipes.java index 174e2b9104..43c9afe67b 100644 --- a/src/main/java/common/Recipes.java +++ b/src/main/java/common/Recipes.java @@ -557,7 +557,7 @@ public class Recipes { // Capacitor recycling GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), ItemList.Energy_LapotronicOrb.get(1L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Lapis, 4), 1200, 32); GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2), ItemList.Energy_LapotronicOrb2.get(1L), diff --git a/src/main/java/common/blocks/Block_IchorJar.java b/src/main/java/common/blocks/Block_IchorJar.java index 7601ab0f78..a2be000b7a 100644 --- a/src/main/java/common/blocks/Block_IchorJar.java +++ b/src/main/java/common/blocks/Block_IchorJar.java @@ -53,7 +53,7 @@ public class Block_IchorJar extends BlockJar { @Override @SideOnly(Side.CLIENT) - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"unchecked"}) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); // Normal jar par3List.add(new ItemStack(par1, 1, 3)); // Void jar @@ -73,33 +73,39 @@ public class Block_IchorJar extends BlockJar { final TileEntity te = world.getTileEntity(x, y, z); if(te instanceof TE_IchorJar) { final TE_IchorJar ite = (TE_IchorJar) te; - if(ite.amount > 0) { - // Create a decent explosion in the center of the block (TNT has strength 4.0F) - world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, 6.0F, false); - - // Place a lot of Flux in the area - final int limit = ite.amount / 16; - int created = 0; - for(int i = 0; i < 200; i++) { - final int xf = x + world.rand.nextInt(7) - world.rand.nextInt(7); - final int yf = x + world.rand.nextInt(7) - world.rand.nextInt(7); - final int zf = x + world.rand.nextInt(7) - world.rand.nextInt(7); - if(world.isAirBlock(xf, yf, zf)) { - if(yf > y) { - world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGas, 8, 3); - } else { - world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGoo, 8, 3); - } - - if(created++ > limit) { - break; - } + breakBlockWarpy(world, x, y, z, ite.amount, 200, 6.0F); + } else if(te instanceof TE_IchorVoidJar) { + final TE_IchorVoidJar ite = (TE_IchorVoidJar) te; + breakBlockWarpy(world, x, y, z, ite.amount, 200, 6.0F); + } + super.breakBlock(world, x, y, z, par5, par6); + } + + private void breakBlockWarpy(World world, int x, int y, int z, int fillAmount, int iterations, float explosionStrength){ + if(fillAmount > 0) { + // Create a decent explosion in the center of the block (TNT has strength 4.0F) + world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, explosionStrength, false); + + // Place a lot of Flux in the area + final int limit = fillAmount / 16; + int created = 0; + for(int i = 0; i < iterations; i++) { + final int xf = x + world.rand.nextInt(7) - world.rand.nextInt(7); + final int yf = x + world.rand.nextInt(7) - world.rand.nextInt(7); + final int zf = x + world.rand.nextInt(7) - world.rand.nextInt(7); + if(world.isAirBlock(xf, yf, zf)) { + if(yf > y) { + world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGas, 8, 3); + } else { + world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGoo, 8, 3); + } + + if(created++ > limit) { + break; } } } } - - super.breakBlock(world, x, y, z, par5, par6); } @Override diff --git a/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java b/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java index edcdb54a17..d9064214d2 100644 --- a/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java +++ b/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java @@ -53,7 +53,7 @@ public class Block_ThaumiumReinforcedJar extends BlockJar { @Override @SideOnly(Side.CLIENT) - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"unchecked"}) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); // Normal jar par3List.add(new ItemStack(par1, 1, 3)); // Void jar @@ -71,35 +71,42 @@ public class Block_ThaumiumReinforcedJar extends BlockJar { @Override public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { final TileEntity te = world.getTileEntity(x, y, z); - if(te != null && te instanceof TE_ThaumiumReinforcedJar) { + if(te instanceof TE_ThaumiumReinforcedJar) { final TE_ThaumiumReinforcedJar ite = (TE_ThaumiumReinforcedJar) te; - if(ite.amount > 0) { - // Create a small explosion in the center of the block (TNT has strength 4.0F) - world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, 1.0F, false); - - // Place some Flux in the area - final int limit = ite.amount / 16; - int created = 0; - for(int i = 0; i < 50; i++) { - final int xf = x + world.rand.nextInt(4) - world.rand.nextInt(4); - final int yf = x + world.rand.nextInt(4) - world.rand.nextInt(4); - final int zf = x + world.rand.nextInt(4) - world.rand.nextInt(4); - if(world.isAirBlock(xf, yf, zf)) { - if(yf > y) { - world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGas, 8, 3); - } else { - world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGoo, 8, 3); - } - - if(created++ > limit) { - break; - } + breakBlockWarpy(world, x, y, z, ite.amount, 50, 1.0F); + } else if(te instanceof TE_ThaumiumReinforcedVoidJar) { + final TE_ThaumiumReinforcedVoidJar ite = (TE_ThaumiumReinforcedVoidJar) te; + breakBlockWarpy(world, x, y, z, ite.amount, 50, 1.0F); + } + + super.breakBlock(world, x, y, z, par5, par6); + } + + private void breakBlockWarpy(World world, int x, int y, int z, int fillAmount, int iterations, float explosionStrength){ + if(fillAmount > 0) { + // Create a decent explosion in the center of the block (TNT has strength 4.0F) + world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, explosionStrength, false); + + // Place a lot of Flux in the area + final int limit = fillAmount / 16; + int created = 0; + for(int i = 0; i < iterations; i++) { + final int xf = x + world.rand.nextInt(7) - world.rand.nextInt(7); + final int yf = x + world.rand.nextInt(7) - world.rand.nextInt(7); + final int zf = x + world.rand.nextInt(7) - world.rand.nextInt(7); + if(world.isAirBlock(xf, yf, zf)) { + if(yf > y) { + world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGas, 8, 3); + } else { + world.setBlock(xf, yf, zf, ConfigBlocks.blockFluxGoo, 8, 3); + } + + if(created++ > limit) { + break; } } } } - - super.breakBlock(world, x, y, z, par5, par6); } @Override diff --git a/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java b/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java index 6afa33b91e..d81c5eb8c3 100644 --- a/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java +++ b/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java @@ -16,6 +16,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynam import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import kekztech.KekzCore; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -292,6 +293,8 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock } } + KekzCore.LOGGER.info("Found " + mDynamoTunnelsTT.size() + "Laser Source Hatches"); + KekzCore.LOGGER.info("Found " + mEnergyTunnelsTT.size() + "Laser Target Hatches"); // Glass has to be at least UV-tier to allow TT Laser hatches if(colourCorrectedMeta < 5) { if(mEnergyTunnelsTT.size() > 0 || mDynamoTunnelsTT.size() > 0) { @@ -427,6 +430,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock final BigInteger recampLimited = (MAX_LONG.compareTo(remcapActual) > 0) ? remcapActual : MAX_LONG; final long power = Math.min(eHatch.maxEUInput() * eHatch.maxAmperesIn(), recampLimited.longValue()); if(power <= eHatch.getEUVar()) { + KekzCore.LOGGER.info("Tried to take " + power + "EU from a Laser Target Hatch"); eHatch.setEUVar(eHatch.getEUVar() - power); stored = stored.add(BigInteger.valueOf(power)); } @@ -439,6 +443,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock final BigInteger remStoredLimited = (MAX_LONG.compareTo(stored) > 0) ? stored : MAX_LONG; final long power = Math.min(eDynamo.maxEUOutput() * eDynamo.maxAmperesOut(), remStoredLimited.longValue()); if(eDynamo.getEUVar() <= eDynamo.maxEUStore() - power) { + KekzCore.LOGGER.info("Tried to inject " + power + "EU into a Laser Source Hatch"); eDynamo.setEUVar(eDynamo.getEUVar() + power); stored = stored.subtract(BigInteger.valueOf(power)); } |