diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-06-09 18:01:26 +0200 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-06-09 18:01:26 +0200 |
commit | 81a97f7b99b7cec01fd609997a4b300952f3c83f (patch) | |
tree | 26938b303355e9852f7733d5e6a7c5cfe556f971 /src | |
parent | 3e8a3e12981a3090415f1b8f731e293ce7e50501 (diff) | |
download | GT5-Unofficial-81a97f7b99b7cec01fd609997a4b300952f3c83f.tar.gz GT5-Unofficial-81a97f7b99b7cec01fd609997a4b300952f3c83f.tar.bz2 GT5-Unofficial-81a97f7b99b7cec01fd609997a4b300952f3c83f.zip |
Fixes
+ fixed Ross128b crash
+ fixed TT recipe overlap
+ fixed double replicator recipes
+ updated deps
Former-commit-id: a265fe24881113be57001e84d3892d60d81f84aa
Diffstat (limited to 'src')
5 files changed, 203 insertions, 171 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index c8bc059230..b300adaa11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -873,7 +873,7 @@ public class RecipeLoader { GT_Values.RA.addAssemblerRecipe( new ItemStack[]{ ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Silver, WerkstoffLoader.gtnhGT ? 8 : 1), + GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Electrum, WerkstoffLoader.gtnhGT ? 8 : 1), WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 424a557f9a..c80c50cce9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1732,7 +1732,7 @@ public class WerkstoffLoader { Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } @@ -2511,7 +2511,7 @@ public class WerkstoffLoader { Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 14f0ca8e0c..29eb79ebdc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -24,14 +24,17 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; +import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -45,64 +48,158 @@ import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; @SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { - protected Pair<Block,Integer>[][] ToBuildWith = new Pair[4][0]; + protected Pair<Block, Integer>[][] ToBuildWith = new Pair[4][0]; @Override public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { return false; } - protected void setFloorBlocks(int[] metas, Block... blocks){ - this.ToBuildWith[0]=new Pair[metas.length]; + protected void setFloorBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[0] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[0][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } - protected void setWallBlocks(int[] metas,Block... blocks){ - this.ToBuildWith[1]=new Pair[metas.length]; + protected void setWallBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[1] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[1][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } - protected void setRoofBlocks(int[] metas,Block... blocks){ - this.ToBuildWith[2]=new Pair[metas.length]; + protected void setRoofBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[2] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[2][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } - protected void setMiscBlocks(int[] metas,Block... blocks){ - this.ToBuildWith[3]=new Pair[metas.length]; + protected void setMiscBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[3] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[3][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } int[] statBlocks = new int[4]; - protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair<Block,Integer>... blocks){ + protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair<Block, Integer>... blocks) { if (rand.nextInt(100) > airchance) - this.setRandomBlock(worldObj,x,y,z,rand,blocks); + this.setRandomBlock(worldObj, x, y, z, rand, blocks); else - this.setBlock(worldObj,x,y,z,Blocks.air,0); + this.setBlock(worldObj, x, y, z, Blocks.air, 0); } - protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair<Block,Integer>... blocks){ + protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair<Block, Integer>... blocks) { Block toSet = blocks[rand.nextInt(blocks.length)].getKey(); int meta = blocks[rand.nextInt(blocks.length)].getValue(); - this.setBlock(worldObj,x,y,z,toSet,meta); + this.setBlock(worldObj, x, y, z, toSet, meta); } - protected void setBlock(World worldObj, int x, int y, int z, Block block,int meta){ - this.setBlockAndNotifyAdequately(worldObj,x,y,z,block,meta); + protected void setBlock(World worldObj, int x, int y, int z, Block block, int meta) { + this.setBlockAndNotifyAdequately(worldObj, x, y, z, block, meta); } - protected void setBlock(World worldObj, int x, int y, int z, Pair<Block,Integer> pair){ - this.setBlockAndNotifyAdequately(worldObj,x,y,z,pair.getKey(),pair.getValue()); + + protected void setBlock(World worldObj, int x, int y, int z, Pair<Block, Integer> pair) { + this.setBlockAndNotifyAdequately(worldObj, x, y, z, pair.getKey(), pair.getValue()); + } + + private TileEntity setGTMachineBlock(World worldObj, int x, int y, int z, int meta) { + boolean isEnabled = true; + try { + isEnabled = GT_Runnable_MachineBlockUpdate.isEnabled(); + } catch (Throwable ignored) { + isEnabled = false; + } + if (isEnabled) + throw new IllegalStateException("Machine Block Runnable needs to be disabled while creating world!"); + this.setBlockAndNotifyAdequately(worldObj, x, y, z, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + TileEntity tile = worldObj.getTileEntity(x, y, z); + ((IGregTechTileEntity) tile).setInitialValuesAsNBT(null, (short) meta); + return tile; + } + + protected TileEntity reSetGTTileEntity(IGregTechTileEntity bte, World worldObj, int x, int y, int z, int meta) { + worldObj.removeTileEntity(x, y, z); + this.setBlock(worldObj, x, y, z, Blocks.air, 0); + return setGTMachineBlock(worldObj, x, y, z, meta); + } + + protected void setGTMachineBlockWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { + if (rand.nextInt(100) > airchance) { + this.setGTMachineBlock(worldObj, x, y, z, meta); + } else + this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } + + protected void setGTCablekWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { + if (rand.nextInt(100) > airchance) { + this.setGTCable(worldObj, x, y, z, meta); + } else + this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } + + protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + try { + GT_Runnable_MachineBlockUpdate.setDisabled(); + } catch (Throwable ignored) { + } + setGTMachineBlock(worldObj, x, y, z, meta); + BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); + BTE.setOwnerName(ownerName); + BTE.setFrontFacing(facing); + BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); + checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0); + try { + GT_Runnable_MachineBlockUpdate.setEnabled(); + } catch (Throwable ignored) { + } + } + + private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing, int depth) { + if (depth < 25) { + if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { + redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); + checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth++); + } + } else { + worldObj.removeTileEntity(x, y, z); + worldObj.setBlockToAir(x, y, z); + } + } + + private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + reSetGTTileEntity(BTE, worldObj, x, y, z, meta); + BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); + BTE.setOwnerName(ownerName); + BTE.setFrontFacing(facing); + } + + protected void setGTCable(World worldObj, int x, int y, int z, int meta) { + try { + GT_Runnable_MachineBlockUpdate.setDisabled(); + } catch (Throwable ignored) { + } + BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) setGTMachineBlock(worldObj, x, y, z, meta); + MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity(); + BTE.mConnections |= (byte) (1 << (byte) 4); + BTE.mConnections |= (byte) (1 << GT_Utility.getOppositeSide(4)); + BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z - 1); + if (BPE != null) { + BTE.mConnections |= (byte) (1 << (byte) 2); + } + MPE.mConnections = BTE.mConnections; + try { + GT_Runnable_MachineBlockUpdate.setEnabled(); + } catch (Throwable ignored) { + } } - public static class RuinsBase extends MapGenRuins{ + public static class RuinsBase extends MapGenRuins { + + private static final String owner = "Ancient Cultures"; @Override public boolean generate(World worldObj, Random rand1, int x, int y, int z) { @@ -114,175 +211,115 @@ public abstract class MapGenRuins extends WorldGenerator { Random rand = new XSTR(rand1.nextLong()); SecureRandom secureRandom = new SecureRandom(); - x=x+5; - z=z+5; - - if (worldObj.getBlock(x,y,z) == Blocks.air) { + if (worldObj.getBlock(x, y, z) == Blocks.air) { while (worldObj.getBlock(x, y, z) == Blocks.air) { y--; } - } else { - while (worldObj.getBlock(x, y, z) != Blocks.air) { - y++; - } - y--; } - this.setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); - this.setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); - this.setRoofBlocks(new int[]{9},Blocks.log); - this.setMiscBlocks(new int[]{1},Blocks.log); + this.setFloorBlocks(new int[]{0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); + this.setWallBlocks(new int[]{0, 1, 2, 1, 1}, Blocks.stonebrick); + this.setRoofBlocks(new int[]{9}, Blocks.log); + this.setMiscBlocks(new int[]{1}, Blocks.log); this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; int colored = rand.nextInt(15); int tier = secureRandom.nextInt(maxTierRoss); boolean useColor = rand.nextBoolean(); byte set = 0; byte toSet = (byte) (rand.nextInt(maxTierRoss - tier) + 1); - short cablemeta = GT_WorldgenUtil.getCable(secureRandom,tier); + short cablemeta = GT_WorldgenUtil.getCable(secureRandom, tier); byte treeinaRow = 0; boolean lastset = rand.nextBoolean(); for (int dx = -6; dx <= 6; dx++) { for (int dy = 0; dy <= 8; dy++) { for (int dz = -6; dz <= 6; dz++) { - this.setBlock(worldObj,x+dx,y+dy,z+dz,Blocks.air,0); - if (dy == 0){ - Pair<Block,Integer> floor = this.ToBuildWith[0][this.statBlocks[0]]; - this.setBlock(worldObj,x+dx,y+ 0,z+dz, floor.getKey(),floor.getValue()); - } - else if (dy > 0 && dy < 4){ - if (Math.abs(dx) == 5 && Math.abs(dz) == 5){ - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, this.ToBuildWith[3][0]); - } - else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)){ + this.setBlock(worldObj, x + dx, y + dy, z + dz, Blocks.air, 0); + if (dy == 0) { + Pair<Block, Integer> floor = this.ToBuildWith[0][this.statBlocks[0]]; + this.setBlock(worldObj, x + dx, y + 0, z + dz, floor.getKey(), floor.getValue()); + } else if (dy > 0 && dy < 4) { + if (Math.abs(dx) == 5 && Math.abs(dz) == 5) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); + } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) { if (dy == 1) - this.setBlock(worldObj,x+dx,y+ 1,z+ -5, Blocks.iron_door,1); + this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); if (dy == 2) - this.setBlock(worldObj,x+dx,y+ 2,z+dz, Blocks.iron_door,8); - } - else if (Math.abs(dx)== 5 && Math.abs(dz) < 5 || Math.abs(dz)== 5 && Math.abs(dx) < 5){ - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); + this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); + } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); if (dy == 2) { - if (rand.nextInt(100)<12) + if (rand.nextInt(100) < 12) if (useColor) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 2,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); + this.setRandomBlockWAirChance(worldObj, x + dx, y + 2, z + dz, rand, 25, new Pair<>(Blocks.stained_glass_pane, colored)); else - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, new Pair<>(Blocks.glass_pane, 0)); } } - if (dy == 3 && Math.abs(dx)== 6){ - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 3,z+dz,rand,25, this.ToBuildWith[2]); + if (dy == 3 && Math.abs(dx) == 6) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); } - if (dy == 1){ - if (dx == 3 && dz == -3){ - this.setBlock(worldObj,x + 3, y + 1, z + dz,Blocks.crafting_table,0); + if (dy == 1) { + if (dx == 3 && dz == -3) { + this.setBlock(worldObj, x + 3, y + 1, z + dz, Blocks.crafting_table, 0); } - if (dx == -3 && (dz == -3 || dz == -2)){ - this.setBlock(worldObj,x + -3, y + dy, z + dz,Blocks.chest,5); - IInventory chest = (IInventory)worldObj.getTileEntity(x + dx, y + dy, z + dz); + if (dx == -3 && (dz == -3 || dz == -2)) { + this.setBlock(worldObj, x + -3, y + dy, z + dz, Blocks.chest, 5); + IInventory chest = (IInventory) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); } } - if (dx == 4 && dz==4) { - short meta = GT_WorldgenUtil.getGenerator(secureRandom,tier); - this.setBlock(worldObj, x + 4, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null,meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing(tier > 0 ? (byte)4 : (byte) 2); - - } - else if (dx == 3 && dz==4) { - if (tier>0) { + if (dx == 4 && dz == 4) { + short meta = GT_WorldgenUtil.getGenerator(secureRandom, tier); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, tier > 0 ? (byte) 4 : (byte) 2); + } else if (dx == 3 && dz == 4) { + if (tier > 0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); - this.setBlock(worldObj, x + 3, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 4); - }else{ - short meta = cablemeta; - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair<Block, Integer>(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); - BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - if (BTE != null) { - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 4); - BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) 4); - BTE.mConnections = (byte) (BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); - ((MetaPipeEntity) BTE.getMetaTileEntity()).mConnections = BTE.mConnections; - } + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 4); + } else { + this.setGTCablekWChance(worldObj, x + dx, y + dy, z + dz, rand, 33, cablemeta); } - } - else if (dx < 3 && dx > -5 && dz == 4) { - short meta = cablemeta; - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + 4, rand, 33, new Pair<Block, Integer>(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); - - BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - if (BTE != null) { - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 4); - BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)4); - BTE.mConnections = (byte)(BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); - - BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz-1); - if (BPE != null) { - BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)2); - } - ((MetaPipeEntity)BTE.getMetaTileEntity()).mConnections=BTE.mConnections; - } - - } - else if (dx < 3 && dx > -5 && dz == 3 && set < toSet){ + } else if (dx < 3 && dx > -5 && dz == 4) { + this.setGTCablekWChance(worldObj, x + dx, y + dy, z + dz, rand, 33, cablemeta); + } else if (dx < 3 && dx > -5 && dz == 3 && set < toSet) { if (!lastset || treeinaRow > 2) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setBlock(worldObj, x + dx, y + dy, z + 3, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 2); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 2); set++; treeinaRow = 0; - lastset=true; - } - else { + lastset = true; + } else { lastset = rand.nextBoolean(); if (lastset) treeinaRow++; } } } - } - else if(dy == 4){ - if (Math.abs(dx)== 5) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 4,z+dz,rand,25, this.ToBuildWith[2]); + } else if (dy == 4) { + if (Math.abs(dx) == 5) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 5){ - if (Math.abs(dx)== 4) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 5,z+dz,rand,25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 5) { + if (Math.abs(dx) == 4) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 6){ - if (Math.abs(dx)== 3) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 6,z+dz,rand,25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 6) { + if (Math.abs(dx) == 3) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 7){ - if (Math.abs(dx)== 2) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 7,z+dz,rand,25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 7) { + if (Math.abs(dx) == 2) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 8) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 8) { if (Math.abs(dx) == 1 || Math.abs(dx) == 0) this.setRandomBlockWAirChance(worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); } @@ -290,29 +327,24 @@ public abstract class MapGenRuins extends WorldGenerator { } } tosetloop: - while (set < toSet){ + while (set < toSet) { int dy = 1; int dz = 3; for (int dx = 2; dx > -5; dx--) { - if (set < toSet){ + if (set < toSet) { if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 2); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 2); set++; treeinaRow = 0; - lastset=true; - } - else { + lastset = true; + } else { lastset = rand.nextBoolean(); if (lastset) treeinaRow++; } - }else + } else break tosetloop; } } @@ -320,4 +352,4 @@ public abstract class MapGenRuins extends WorldGenerator { } } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 4bc8f64f10..6fc3ed11ec 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -123,21 +123,22 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { int x1; int y1; int z1; - - if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver - && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { - x1 = k + this.rand.nextInt(16) + 3; - y1 = this.rand.nextInt(256); - z1 = l + this.rand.nextInt(16) + 3; - this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1); - } - - if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.rand.nextInt(4) == 0 - && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + int rni = this.rand.nextInt(8); + if (rni == 0) + (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); + else if (rni == 4) + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + } + if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver + && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { + x1 = k + this.rand.nextInt(16) + 3; + y1 = this.rand.nextInt(256); + z1 = l + this.rand.nextInt(16) + 3; + this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1); } biomegenbase.decorate(this.worldObj, this.rand, k, l); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 96522d618e..12f4c6d2cd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.google.common.collect.Sets; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; |