diff options
Diffstat (limited to 'src')
9 files changed, 899 insertions, 26 deletions
diff --git a/src/Java/gtPlusPlus/api/interfaces/IGeneratorWorld.java b/src/Java/gtPlusPlus/api/interfaces/IGeneratorWorld.java new file mode 100644 index 0000000000..63f2adbba7 --- /dev/null +++ b/src/Java/gtPlusPlus/api/interfaces/IGeneratorWorld.java @@ -0,0 +1,17 @@ +package gtPlusPlus.api.interfaces; + +import java.util.Random; +import net.minecraft.world.World; + +public abstract interface IGeneratorWorld +{ + public abstract boolean generate(World paramWorld, Random paramRandom, int paramInt1, int paramInt2); + + public abstract void initiate(); + + public abstract int getExtentX(); + + public abstract int getExtentZ(); + + public abstract int getRange(); +} diff --git a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java index af7c143a95..afd21300df 100644 --- a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java +++ b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java @@ -23,6 +23,7 @@ import gtPlusPlus.australia.dimension.Dimension_Australia; import gtPlusPlus.australia.gen.gt.WorldGen_Australia_Ores; import gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia_Base; import gtPlusPlus.australia.gen.map.structure.StructureManager; +import gtPlusPlus.australia.world.AustraliaWorldGenerator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.Australia; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; @@ -49,6 +50,7 @@ public class GTplusplus_Australia implements ActionListener { public static volatile Biome_AustralianPlains Australian_Plains_Biome; public static volatile Dimension_Australia Australia_Dimension; + public static AustraliaWorldGenerator Australia_World_Generator; public static int globalAustraliaPortalSpawnTimer = 0; // Pre-Init @@ -78,6 +80,8 @@ public class GTplusplus_Australia implements ActionListener { //Load Villages StructureManager.registerVillageComponents(); + + setupWorldGenerator(); //Load/Set Custom Ore Gen sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); @@ -129,9 +133,8 @@ public class GTplusplus_Australia implements ActionListener { } @EventHandler - public void serverLoad(FMLServerStartingEvent event) { - //Australian_Desert_Biome_1.serverLoad(event); - //Australian_Desert_Biome_2.serverLoad(event); + public void serverLoad(FMLServerStartingEvent event) { + Australia_World_Generator.initiate(); } @EventHandler @@ -144,5 +147,11 @@ public class GTplusplus_Australia implements ActionListener { // TODO Auto-generated method stub } + + private void setupWorldGenerator() { + Logger.INFO("Registering World Generator for Australia."); + Australia_World_Generator = new AustraliaWorldGenerator(); + GameRegistry.registerWorldGenerator(Australia_World_Generator, 0); + } } diff --git a/src/Java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java b/src/Java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java index ef49155dad..4455c81317 100644 --- a/src/Java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java +++ b/src/Java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java @@ -4,8 +4,6 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Random; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.lib.CORE; import net.minecraft.block.Block; import net.minecraft.util.MathHelper; @@ -17,27 +15,28 @@ public class MapGenLargeRavine extends MapGenRavine private float[] field_75046_d = new float[1024]; @Override - protected void func_151540_a(long aSeed, int var1, int var2, Block[] aBlocksInChunkOrPassedIn, double p_151540_6_, double p_151540_8_, double p_151540_10_, float p_151540_12_, float p_151540_13_, float p_151540_14_, int p_151540_15_, int p_151540_16_, double p_151540_17_) + protected void func_151540_a(long aSeed, int var1, int var2, Block[] aBlocksInChunkOrPassedIn, double p_151540_6_, double p_151540_8_, double p_151540_10_, float p_151540_12_, float p_151540_13_, float p_151540_14_, int possibleCurrentY, int possibleMaxY, double p_151540_17_) { - Logger.INFO("Generating Large Ravine."); - Random random = new XSTR(aSeed); - double d4 = (double)(var1 * 32 + 16); - double d5 = (double)(var2 * 32 + 16); + //Logger.INFO("Generating Large Ravine."); + Random random = CORE.RANDOM; + this.range *= 2; + double d4 = (double)(var1 * 24 + 16); + double d5 = (double)(var2 * 24 + 16); float f3 = 0.0F; float f4 = 0.0F; - if (p_151540_16_ <= 0) + if (possibleMaxY <= 25) { - int j1 = this.range * 16 - 16; - p_151540_16_ = j1 - random.nextInt(j1 / 4); + int j1 = Math.min(this.range * 16 - 32, 200); + possibleMaxY = j1 - random.nextInt(j1 / 4); } - boolean flag1 = false; + boolean possibleIsUnderGroundFlag = false; - if (p_151540_15_ == -1) + if (possibleCurrentY <= -1) { - p_151540_15_ = p_151540_16_ / 2; - flag1 = true; + possibleCurrentY = possibleMaxY / 3; + possibleIsUnderGroundFlag = true; } float f5 = 1.0F; @@ -52,9 +51,9 @@ public class MapGenLargeRavine extends MapGenRavine this.field_75046_d[k1] = f5 * f5; } - for (; p_151540_15_ < p_151540_16_; ++p_151540_15_) + for (; possibleCurrentY < possibleMaxY; ++possibleCurrentY) { - double d12 = 3.5D + (double)(MathHelper.sin((float)p_151540_15_ * CORE.PI / (float)p_151540_16_) * p_151540_12_ * 1.0F); + double d12 = 3.5D + (double)(MathHelper.sin((float)possibleCurrentY * CORE.PI / (float)possibleMaxY) * p_151540_12_ * 1.0F); double d6 = d12 * p_151540_17_; d12 *= (double)random.nextFloat() * 0.55D + 0.75D; d6 *= (double)random.nextFloat() * 0.55D + 0.75D; @@ -71,11 +70,11 @@ public class MapGenLargeRavine extends MapGenRavine f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; - if (flag1 || random.nextInt(4) != 0) + if (possibleIsUnderGroundFlag || random.nextInt(4) != 0) { double d7 = p_151540_6_ - d4; double d8 = p_151540_10_ - d5; - double d9 = (double)(p_151540_16_ - p_151540_15_); + double d9 = (double)(possibleMaxY - possibleCurrentY); double d10 = (double)(p_151540_12_ + 2.0F + 16.0F); if (d7 * d7 + d8 * d8 - d9 * d9 > d10 * d10) @@ -188,7 +187,7 @@ public class MapGenLargeRavine extends MapGenRavine } } - if (flag1) + if (possibleIsUnderGroundFlag) { break; } diff --git a/src/Java/gtPlusPlus/australia/gen/map/MapGenVillageLogging.java b/src/Java/gtPlusPlus/australia/gen/map/MapGenVillageLogging.java index fd5c8df5b2..69278591fe 100644 --- a/src/Java/gtPlusPlus/australia/gen/map/MapGenVillageLogging.java +++ b/src/Java/gtPlusPlus/australia/gen/map/MapGenVillageLogging.java @@ -2,6 +2,8 @@ package gtPlusPlus.australia.gen.map; import java.util.Map; import java.util.Random; + +import gtPlusPlus.api.objects.Logger; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenVillage; @@ -24,12 +26,16 @@ public class MapGenVillageLogging extends MapGenVillage { @Override protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { - - return super.canSpawnStructureAtCoords(p_75047_1_, p_75047_2_); + boolean aBool = super.canSpawnStructureAtCoords(p_75047_1_, p_75047_2_); + if (aBool) { + Logger.INFO("Is Location Valid for Spawning a Village? "+aBool); + } + return aBool; } @Override protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { + Logger.INFO("Created MapGenVillageLogging Start Object"); return new MapGenVillageLogging.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_, 0); } @@ -39,10 +45,13 @@ public class MapGenVillageLogging extends MapGenVillage { private static final String __OBFID = "CL_00000515"; public StartLogging() { + super(); + Logger.INFO("Created StartLogging Object"); } public StartLogging(World p_i2092_1_, Random p_i2092_2_, int p_i2092_3_, int p_i2092_4_, int p_i2092_5_) { super(p_i2092_1_, p_i2092_2_, p_i2092_3_, p_i2092_4_, p_i2092_5_); + Logger.INFO("Created StartLogging Object"); } /** diff --git a/src/Java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java b/src/Java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java new file mode 100644 index 0000000000..b6b83d997b --- /dev/null +++ b/src/Java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java @@ -0,0 +1,196 @@ +package gtPlusPlus.australia.gen.map.component; + +import java.util.Random; + +import gtPlusPlus.api.objects.Logger; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraftforge.common.ChestGenHooks; + +public class AustraliaComponent extends StructureComponent { + public AustraliaComponent() { + } + + public AustraliaComponent(int direction, Random random, int x, int z, int dimX, int dimY, int dimZ) { + super(direction); + this.coordBaseMode = direction; + this.boundingBox = calcBox(direction, x + (16 - dimX) / 2, 64, z + (16 - dimZ) / 2, dimX, dimY, dimZ, 0); + } + + public boolean addComponentParts(World world, Random random) { + return true; + } + + protected void func_151554_b(World par1World, Block par2, int par3, int par4, int par5, int par6, + StructureBoundingBox par7StructureBoundingBox) { + int j1 = getXWithOffset(par4, par6); + int k0 = getYWithOffset(par5); + int k1 = k0; + int l1 = getZWithOffset(par4, par6); + if (par7StructureBoundingBox.isVecInside(j1, k1, l1)) { + if (par1World.isAirBlock(j1, k1, l1)) { + return; + } + k1--; + while (((par1World.isAirBlock(j1, k1, l1)) || (!par1World.getBlock(j1, k1, l1).getMaterial().isSolid()) + || (par1World.getBlock(j1, k1, l1) == Blocks.ice)) && (k1 > 1)) { + par1World.setBlock(j1, k1, l1, par2, par3, 2); + + k1--; + } + } + } + + protected void clearCurrentPositionBlocksUpwards(World par1World, int par2, int par3, int par4, + StructureBoundingBox par5StructureBoundingBox) { + int l = getXWithOffset(par2, par4); + int i1 = getYWithOffset(par3); + int j1 = getZWithOffset(par2, par4); + if (par5StructureBoundingBox.isVecInside(l, i1, j1)) { + int i = 0; + for (;;) { + i++; + if (((i >= 20) && (par1World.isAirBlock(l, i1, j1))) || (i1 >= 255)) { + break; + } + par1World.setBlock(l, i1, j1, Blocks.air, 0, 2); + i1++; + } + } + } + + protected boolean isWaterBelow(World par1World, int par4, int par5, int par6, + StructureBoundingBox par7StructureBoundingBox) { + int j1 = getXWithOffset(par4, par6); + int k1 = getYWithOffset(par5); + int l1 = getZWithOffset(par4, par6); + for (int i = 0; i < 10; i++) { + Material material = par1World.getBlock(j1, k1, l1).getMaterial(); + if ((material.isLiquid()) || (material == Material.ice)) { + return true; + } + if (!par1World.isAirBlock(j1, k1, l1)) { + return false; + } + } + return false; + } + + public void setDispenser(int x, int y, int z, Random random, World world, int facing) { + int i1 = getXWithOffset(x, z); + int j1 = getYWithOffset(y); + int k1 = getZWithOffset(x, z); + + world.setBlock(i1, j1, k1, Blocks.dispenser, facing, 0); + TileEntity tileDispenser = world.getTileEntity(i1, j1, k1); + if ((tileDispenser != null) && ((tileDispenser instanceof TileEntityDispenser))) { + ChestGenHooks info = ChestGenHooks.getInfo("mineshaftCorridor"); + WeightedRandomChestContent.generateChestContents(random, info.getItems(random), + (TileEntityDispenser) tileDispenser, info.getCount(random)); + } else { + Logger.WARNING("Failed to fetch dispenser entity at (" + i1 + ", " + j1 + ", " + k1 + ")"); + } + } + + protected void setSpawner(int x, int y, int z, String mobName, World world) { + int i1 = getXWithOffset(x, z); + int j1 = getYWithOffset(y); + int k1 = getZWithOffset(x, z); + + world.setBlock(i1, j1, k1, Blocks.mob_spawner, 0, 2); + TileEntity tileSpawner = world.getTileEntity(i1, j1, k1); + if ((tileSpawner != null) && ((tileSpawner instanceof TileEntityMobSpawner))) { + ((TileEntityMobSpawner) tileSpawner).func_145881_a().setEntityName(mobName); + } else { + Logger.WARNING("Failed to fetch mob spawner entity at (" + i1 + ", " + j1 + ", " + k1 + ")"); + } + } + + protected void setFurnace(int x, int y, int z, World world) { + int i1 = getXWithOffset(x, z); + int j1 = getYWithOffset(y); + int k1 = getZWithOffset(x, z); + + world.setBlock(i1, j1, k1, Blocks.furnace, getMetadataWithOffset(Blocks.piston, 3), 2); + } + + protected void placeAirBlockAtPos(int x, int y, int z, StructureBoundingBox bounds, World world) { + placeBlockAtCurrentPosition(world, Blocks.air, 0, x, y, z, bounds); + } + + protected void place(Block block, int meta, int x, int y, int z, StructureBoundingBox bounds, World world) { + placeBlockAtCurrentPosition(world, block, meta, x, y, z, bounds); + } + + protected StructureBoundingBox calcBox(int direction, int x, int y, int z, int xLength, int height, int zLength, + int xShift) { + int minX = 0; + int maxX = 0; + int minY = y; + int maxY = y + height; + int minZ = 0; + int maxZ = 0; + switch (direction) { + case 0: + minX = x - xShift; + maxX = x - xShift + xLength; + minZ = z; + maxZ = z + zLength; + break; + case 1: + minX = x - zLength; + maxX = x; + minZ = z - xShift; + maxZ = z - xShift + xLength; + break; + case 2: + minX = x - xShift; + maxX = x - xShift + xLength; + minZ = z - zLength; + maxZ = z; + break; + case 3: + minX = x; + maxX = x + zLength; + minZ = z - xShift; + maxZ = z - xShift + xLength; + } + return new StructureBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); + } + + protected int calcGroundHeight(World world, StructureBoundingBox boundingBox) { + int height = 0; + int count = 0; + for (int z = boundingBox.minZ; z <= boundingBox.maxZ; z++) { + for (int x = boundingBox.minX; x <= boundingBox.maxX; x++) { + if (boundingBox.isVecInside(x, 64, z)) { + height += Math.max(world.getTopSolidOrLiquidBlock(x, z), world.provider.getAverageGroundLevel()); + count++; + } + } + } + if (count == 0) { + return -1; + } + return height / count; + } + + protected void func_143012_a(NBTTagCompound nbttagcompound) { + } + + protected void func_143011_b(NBTTagCompound nbttagcompound) { + } + + public boolean addComponentParts(World world, Random random, StructureBoundingBox structureboundingbox) { + return true; + } +} diff --git a/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java b/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java new file mode 100644 index 0000000000..de90a91fb1 --- /dev/null +++ b/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java @@ -0,0 +1,223 @@ +package gtPlusPlus.australia.gen.map.component; + +import java.util.Random; + +import gtPlusPlus.api.interfaces.IGeneratorWorld; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.australia.GTplusplus_Australia; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class ComponentHut extends AustraliaComponent { + public static final int DIM_X = 7; + public static final int DIM_Y = 10; + public static final int DIM_Z = 7; + + public ComponentHut() { + } + + public ComponentHut(int direction, Random random, int x, int z) { + super(direction, random, x, z, 7, 10, 7); + } + + public boolean addComponentParts(World world, Random random) { + BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0)); + int groundAvg = calcGroundHeight(world, this.boundingBox); + if (groundAvg < 0) { + return true; + } + this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0); + if ((isWaterBelow(world, 0, -1, 0, this.boundingBox)) || (isWaterBelow(world, 0, -1, 6, this.boundingBox)) + || (isWaterBelow(world, 6, -1, 0, this.boundingBox)) + || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) { + return false; + } + Block groundID = Blocks.grass; + Block undergroundID = Blocks.dirt; + if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) { + groundID = Blocks.sand; + undergroundID = Blocks.sand; + } + else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) { + groundID = Blocks.hardened_clay; + undergroundID = Blocks.stained_hardened_clay; + } + + + fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6); + fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 1, 6, 1, 5, Blocks.dirt, 0, Blocks.dirt, 1, false); + fillWithMetadataBlocks(world, this.boundingBox, 0, 2, 1, 6, 3, 5, Blocks.cobblestone, 0, Blocks.cobblestone, 0, false); + fillWithAir(world, this.boundingBox, 1, 1, 2, 5, 3, 4); + + int logID = MathUtils.randInt(0, 1); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 1, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 1, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 1, this.boundingBox, world); + + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 5, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 5, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 5, this.boundingBox, world); + + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 1, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 1, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 1, this.boundingBox, world); + + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 5, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 5, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 5, this.boundingBox, world); + + int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8; + + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 2, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 3, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 4, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 2, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 3, this.boundingBox, world); + place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 4, this.boundingBox, world); + + for (int x = 0; x < MathUtils.randInt(5, 9); x++) { + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 0, this.boundingBox, world); + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 1, this.boundingBox, world); + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 2, this.boundingBox, world); + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 3, this.boundingBox, world); + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 4, this.boundingBox, world); + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 5, this.boundingBox, world); + place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 6, this.boundingBox, world); + } + + int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8))); + if (MathUtils.randInt(0, 5) > 4) + place(Blocks.stained_glass, glassMeta, 2, 2, 1, this.boundingBox, world); + if (MathUtils.randInt(0, 5) > 4) + place(Blocks.stained_glass, glassMeta, 2, 2, 5, this.boundingBox, world); + if (MathUtils.randInt(0, 5) > 4) + place(Blocks.stained_glass, glassMeta, 4, 2, 5, this.boundingBox, world); + if (MathUtils.randInt(0, 5) > 4) + place(Blocks.stained_glass, glassMeta, 0, 2, 3, this.boundingBox, world); + if (MathUtils.randInt(0, 5) > 4) + place(Blocks.stained_glass, glassMeta, 6, 2, 3, this.boundingBox, world); + + placeDoorAtCurrentPosition(world, this.boundingBox, random, 4, 1, 1, + getMetadataWithOffset(Blocks.wooden_door, 1)); + + place(Blocks.leaves, MathUtils.randInt(0, 3), 1, 1, 4, this.boundingBox, world); + place(Blocks.torch, 0, 1, 2, 3, this.boundingBox, world); + place(Blocks.torch, 0, 3, 2, 2, this.boundingBox, world); + if (!this.hasMadeChest) { + int ic = getYWithOffset(0); + int jc = getXWithOffset(7, 1); + int kc = getZWithOffset(7, 1); + if (this.boundingBox.isVecInside(jc, ic, kc)) { + this.hasMadeChest = true; + generateStructureChestContents(world, this.boundingBox, random, 1, 1, 2, shackChestContents, + 1 + random.nextInt(3)); + } + } + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 7; j++) { + clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox); + func_151554_b(world, undergroundID, 0, j, 0, i, this.boundingBox); + } + } + spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5)); + + return true; + } + + private int nativesSpawned = 0; + + private void spawnNatives(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, + int par5, int maxSpawned) { + if (this.nativesSpawned < maxSpawned) { + for (int i1 = this.nativesSpawned; i1 < maxSpawned; i1++) { + int j1 = getXWithOffset(par3 + i1, par5); + int k1 = getYWithOffset(par4); + int l1 = getZWithOffset(par3 + i1, par5); + if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) { + break; + } + if (par1World.rand.nextInt(MathUtils.randInt(3, 5)) != 0) { + EntityVillager entityvillager = new EntityVillager(par1World, 7738); + entityvillager.func_110163_bv(); + entityvillager.setLocationAndAngles(j1 + 0.5D, k1, l1 + 0.5D, 0.0F, 0.0F); + par1World.spawnEntityInWorld(entityvillager); + this.nativesSpawned += 1; + } + } + } + } + + public static final WeightedRandomChestContent[] shackChestContents = { + new WeightedRandomChestContent(Items.glass_bottle, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.cooked_fished, 0, 1, 3, 10), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 1, 1, 1, 15), + // new WeightedRandomChestContent(Witchery.Items.GENERIC, + // Witchery.Items.GENERIC.itemRowanBerries.damageValue, 1, 2, 10), + new WeightedRandomChestContent(Items.iron_shovel, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5) }; + private boolean hasMadeChest; + private static final String CHEST_KEY = "AUSShackChest"; + + protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { + super.func_143012_a(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("AUSShackChest", this.hasMadeChest); + par1NBTTagCompound.setInteger("AUSWCount", this.nativesSpawned); + } + + protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { + super.func_143011_b(par1NBTTagCompound); + this.hasMadeChest = par1NBTTagCompound.getBoolean("AUSShackChest"); + if (par1NBTTagCompound.hasKey("AUSWCount")) { + this.nativesSpawned = par1NBTTagCompound.getInteger("AUSWCount"); + } else { + this.nativesSpawned = 0; + } + } + + public static class WorldHandlerHut implements IGeneratorWorld { + private final double chance; + private final int range; + + public WorldHandlerHut(double chance) { + this.chance = chance; + this.range = 400; + } + + public int getExtentX() { + return 7; + } + + public int getExtentZ() { + return 7; + } + + public int getRange() { + return this.range; + } + + public boolean generate(World world, Random random, int x, int z) { + if ((MathUtils.randInt(0, 100) < (this.chance/5))) { + int direction = MathUtils.randInt(0, 3); + new ComponentHut(direction, random, x, z).addComponentParts(world, random); + Logger.WORLD("NativeHut x: " + x + " | z: " + z + " | Dir: " + direction); + return true; + } + return false; + } + + public void initiate() { + } + } + +} diff --git a/src/Java/gtPlusPlus/australia/gen/map/component/ComponentShack.java b/src/Java/gtPlusPlus/australia/gen/map/component/ComponentShack.java new file mode 100644 index 0000000000..0bc4249d89 --- /dev/null +++ b/src/Java/gtPlusPlus/australia/gen/map/component/ComponentShack.java @@ -0,0 +1,264 @@ +package gtPlusPlus.australia.gen.map.component; + +import java.util.Random; + +import gtPlusPlus.api.interfaces.IGeneratorWorld; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.australia.GTplusplus_Australia; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class ComponentShack extends AustraliaComponent { + public static final int DIM_X = 7; + public static final int DIM_Y = 10; + public static final int DIM_Z = 7; + + public ComponentShack() { + } + + public ComponentShack(int direction, Random random, int x, int z) { + super(direction, random, x, z, 7, 10, 7); + } + + public boolean addComponentParts(World world, Random random) { + BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0)); + int groundAvg = calcGroundHeight(world, this.boundingBox); + if (groundAvg < 0) { + return true; + } + this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0); + if ((isWaterBelow(world, 0, -1, 0, this.boundingBox)) || (isWaterBelow(world, 0, -1, 6, this.boundingBox)) + || (isWaterBelow(world, 6, -1, 0, this.boundingBox)) + || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) { + return false; + } + Block mStone; + Block groundID = Blocks.grass; + Block undergroundID = Blocks.dirt; + if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) { + groundID = Blocks.sand; + undergroundID = Blocks.sand; + mStone = Blocks.sandstone; + } + else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) { + groundID = Blocks.hardened_clay; + undergroundID = Blocks.stained_hardened_clay; + mStone = Blocks.stained_hardened_clay; + } + else { + mStone = Blocks.stonebrick; + } + + int mWoodType = MathUtils.randInt(0, 5); + int logID; + Block mWoodenStairs; + Block mLog; + if (mWoodType == 1) { + mWoodenStairs = Blocks.spruce_stairs; + logID = 1; + } + else if (mWoodType == 2) { + mWoodenStairs = Blocks.birch_stairs; + logID = 2; + + } + else if (mWoodType == 3) { + mWoodenStairs = Blocks.jungle_stairs; + logID = 3; + } + else if (mWoodType == 4) { + mWoodenStairs = Blocks.acacia_stairs; + logID = 0; + } + else if (mWoodType == 5) { + mWoodenStairs = Blocks.dark_oak_stairs; + logID = 1; + } + else { + mWoodenStairs = Blocks.oak_stairs; + logID = 0; + } + if (mWoodType >= 4) { + mLog = Blocks.log2; + } + else { + mLog = Blocks.log; + } + + int mStoneMeta = MathUtils.randInt(0, mStone == Blocks.stained_hardened_clay ? 15 : mStone == Blocks.sandstone ? 2 : 3); + + fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6); + fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 1, 6, 1, 5, mStone, mStoneMeta, mStone, mStoneMeta, false); + fillWithMetadataBlocks(world, this.boundingBox, 0, 2, 1, 6, 3, 5, Blocks.planks, mWoodType, Blocks.planks, mWoodType, false); + fillWithAir(world, this.boundingBox, 1, 1, 2, 5, 3, 4); + + place(mLog, logID, 0, 1, 1, this.boundingBox, world); + place(mLog, logID, 0, 2, 1, this.boundingBox, world); + place(mLog, logID, 0, 3, 1, this.boundingBox, world); + + place(mLog, logID, 0, 1, 5, this.boundingBox, world); + place(mLog, logID, 0, 2, 5, this.boundingBox, world); + place(mLog, logID, 0, 3, 5, this.boundingBox, world); + + place(mLog, logID, 6, 1, 1, this.boundingBox, world); + place(mLog, logID, 6, 2, 1, this.boundingBox, world); + place(mLog, logID, 6, 3, 1, this.boundingBox, world); + + place(mLog, logID, 6, 1, 5, this.boundingBox, world); + place(mLog, logID, 6, 2, 5, this.boundingBox, world); + place(mLog, logID, 6, 3, 5, this.boundingBox, world); + + int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8; + + place(mLog, logID, 0, 4, 2, this.boundingBox, world); + place(mLog, logID, 0, 4, 3, this.boundingBox, world); + place(mLog, logID, 0, 4, 4, this.boundingBox, world); + place(mLog, logID, 6, 4, 2, this.boundingBox, world); + place(mLog, logID, 6, 4, 3, this.boundingBox, world); + place(mLog, logID, 6, 4, 4, this.boundingBox, world); + + for (int x = 0; x < 7; x++) { + place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 3, 0, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 4, 1, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 5, 2, this.boundingBox, world); + place(Blocks.planks, mWoodType, x, 5, 3, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 5, 4, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 4, 5, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 3, 6, this.boundingBox, world); + } + + int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8))); + + place(Blocks.stained_glass_pane, glassMeta, 2, 2, 1, this.boundingBox, world); + place(Blocks.stained_glass_pane, glassMeta, 2, 2, 5, this.boundingBox, world); + place(Blocks.stained_glass_pane, glassMeta, 4, 2, 5, this.boundingBox, world); + place(Blocks.stained_glass_pane, glassMeta, 0, 2, 3, this.boundingBox, world); + place(Blocks.stained_glass_pane, glassMeta, 6, 2, 3, this.boundingBox, world); + + placeDoorAtCurrentPosition(world, this.boundingBox, random, 4, 1, 1, + getMetadataWithOffset(Blocks.wooden_door, 1)); + + place(Blocks.planks, mWoodType, 1, 1, 4, this.boundingBox, world); + place(Blocks.torch, 0, 1, 2, 4, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(mWoodenStairs, 1), 1, 1, 3, this.boundingBox, world); + place(mWoodenStairs, getMetadataWithOffset(mWoodenStairs, 3), 2, 1, 4, this.boundingBox, world); + place(Blocks.fence, 0, 2, 1, 3, this.boundingBox, world); + place(Blocks.stone_pressure_plate, 0, 2, 2, 3, this.boundingBox, world); + if (!this.hasMadeChest) { + int ic = getYWithOffset(0); + int jc = getXWithOffset(7, 1); + int kc = getZWithOffset(7, 1); + if (this.boundingBox.isVecInside(jc, ic, kc)) { + this.hasMadeChest = true; + generateStructureChestContents(world, this.boundingBox, random, 1, 1, 2, shackChestContents, + 1 + random.nextInt(3)); + } + } + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 7; j++) { + clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox); + func_151554_b(world, undergroundID, 0, j, 0, i, this.boundingBox); + } + } + spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5)); + + return true; + } + + private int nativesSpawned = 0; + + private void spawnNatives(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, + int par5, int maxSpawned) { + if (this.nativesSpawned < maxSpawned) { + for (int i1 = this.nativesSpawned; i1 < maxSpawned; i1++) { + int j1 = getXWithOffset(par3 + i1, par5); + int k1 = getYWithOffset(par4); + int l1 = getZWithOffset(par3 + i1, par5); + if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) { + break; + } + if (par1World.rand.nextInt(MathUtils.randInt(1, 3)) != 0) { + EntityVillager entityvillager = new EntityVillager(par1World, 7736+(MathUtils.randInt(0, 1))); + entityvillager.func_110163_bv(); + entityvillager.setLocationAndAngles(j1 + 0.5D, k1, l1 + 0.5D, 0.0F, 0.0F); + par1World.spawnEntityInWorld(entityvillager); + this.nativesSpawned += 1; + } + } + } + } + + public static final WeightedRandomChestContent[] shackChestContents = { + new WeightedRandomChestContent(Items.glass_bottle, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.cooked_fished, 0, 1, 3, 10), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 1, 1, 1, 15), + // new WeightedRandomChestContent(Witchery.Items.GENERIC, + // Witchery.Items.GENERIC.itemRowanBerries.damageValue, 1, 2, 10), + new WeightedRandomChestContent(Items.iron_shovel, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5) }; + private boolean hasMadeChest; + private static final String CHEST_KEY = "AUSShackChest"; + + protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { + super.func_143012_a(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("AUSShackChest", this.hasMadeChest); + par1NBTTagCompound.setInteger("AUSWCount", this.nativesSpawned); + } + + protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { + super.func_143011_b(par1NBTTagCompound); + this.hasMadeChest = par1NBTTagCompound.getBoolean("AUSShackChest"); + if (par1NBTTagCompound.hasKey("AUSWCount")) { + this.nativesSpawned = par1NBTTagCompound.getInteger("AUSWCount"); + } else { + this.nativesSpawned = 0; + } + } + + public static class WorldHandlerShack implements IGeneratorWorld { + private final double chance; + private final int range; + + public WorldHandlerShack(double chance) { + this.chance = chance; + this.range = 400; + } + + public int getExtentX() { + return 7; + } + + public int getExtentZ() { + return 7; + } + + public int getRange() { + return this.range; + } + + public boolean generate(World world, Random random, int x, int z) { + if ((MathUtils.randInt(0, 100) < (this.chance/5))) { + int direction = MathUtils.randInt(0, 3); + new ComponentShack(direction, random, x, z).addComponentParts(world, random); + Logger.WORLD("NativeHut x: " + x + " | z: " + z + " | Dir: " + direction); + return true; + } + return false; + } + + public void initiate() { + } + } + +} diff --git a/src/Java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java b/src/Java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java new file mode 100644 index 0000000000..2bfc909558 --- /dev/null +++ b/src/Java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java @@ -0,0 +1,142 @@ +package gtPlusPlus.australia.world; + +import cpw.mods.fml.common.IWorldGenerator; +import gtPlusPlus.api.interfaces.IGeneratorWorld; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.australia.GTplusplus_Australia; +import gtPlusPlus.australia.gen.map.MapGenExtendedVillage; +import gtPlusPlus.australia.gen.map.component.ComponentHut.WorldHandlerHut; +import gtPlusPlus.australia.gen.map.component.ComponentShack.WorldHandlerShack; +import gtPlusPlus.core.lib.CORE; + +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.IChunkProvider; + +public class AustraliaWorldGenerator implements IWorldGenerator { + private LinkedList<ChunkCoordIntPair> structuresList = new LinkedList<ChunkCoordIntPair>(); + //private final WorldHandlerCoven covenGen; + //private final WorldHandlerWickerMan wickerManGen; + private final WorldHandlerShack shackGen; + private final WorldHandlerHut hutGen; + private final List<IGeneratorWorld> generators; + private int midX; + private int midZ; + int field_82665_g; + int field_82666_h = 8; + + public static final AutoMap<Integer> SHACK_ALLOWED_BIOMES = new AutoMap<Integer>(); + public static final AutoMap<Integer> HUT_ALLOWED_BIOMES = new AutoMap<Integer>(); + public static final AutoMap<Integer> ALLOWED_BIOMES = new AutoMap<Integer>(); + + public AustraliaWorldGenerator() { + + SHACK_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Plains_Biome.biomeID); + SHACK_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Forest_Biome.biomeID); + HUT_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Desert_Biome_3.biomeID); + HUT_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Outback_Biome.biomeID); + + ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Plains_Biome.biomeID); + ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Forest_Biome.biomeID); + ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Desert_Biome_3.biomeID); + ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Outback_Biome.biomeID); + + + this.shackGen = new WorldHandlerShack(3); + this.hutGen = new WorldHandlerHut(5); + + //IGeneratorWorld goblinHut = new WorldHandlerClonedStructure(ComponentGoblinHut.class, 1.0D, 400, 7, 7, 7); + this.generators = Arrays + .asList(new IGeneratorWorld[] { this.shackGen, this.hutGen }); + + this.field_82665_g = (8 + Math.max(gtPlusPlus.core.util.math.MathUtils.randInt(/*Config.instance().worldGenFrequency*/32, 64), 1)); + + this.midX = 0; + this.midZ = 0; + for (IGeneratorWorld gen : this.generators) { + this.midX = Math.max(this.midX, gen.getExtentX() / 2); + this.midZ = Math.max(this.midZ, gen.getExtentZ() / 2); + } + } + + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, + IChunkProvider chunkProvider) { + if (world.provider.dimensionId == CORE.AUSTRALIA_ID) { + generateOverworld(world, world.rand, chunkX * 16, chunkZ * 16); + } + } + + private void generateOverworld(World world, Random random, int x, int z) { + boolean gen = false; + try { + if (ALLOWED_BIOMES.containsValue(Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) { + Collections.shuffle(this.generators, random); + for (IGeneratorWorld generator : this.generators) { + boolean canGenerate = false; + + if (generator instanceof WorldHandlerShack) { + if (SHACK_ALLOWED_BIOMES.containsValue(Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) { + canGenerate = true; + } + } + else if (generator instanceof WorldHandlerHut) { + if (HUT_ALLOWED_BIOMES.containsValue(Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) { + canGenerate = true; + } + } + + if (canGenerate) { + Logger.WORLD("Running World Generator on Australia."); + boolean a1, a2; + a1 = generator.generate(world, random, x, z); + a2 = nonInRange(world, x, z, generator.getRange()); + Logger.INFO("A1: "+a1+" | A2: "+a2); + if (a1 && a2) { + this.structuresList.add(new ChunkCoordIntPair(x, z)); + gen = true; + Logger.INFO("Generated a structure"); + break; + } + } + } + } + } + catch (Throwable t) { + t.printStackTrace(); + } + } + + protected boolean nonInRange(World worldObj, int x, int z, int range) { + int par1 = x / 16; + int par2 = z / 16; + + int k = par1; + int l = par2; + if (par1 < 0) { + par1 -= this.field_82665_g - 1; + } + if (par2 < 0) { + par2 -= this.field_82665_g - 1; + } + int i1 = par1 / this.field_82665_g; + int j1 = par2 / this.field_82665_g; + Random random = worldObj.setRandomSeed(i1, j1, 10387312); + i1 *= this.field_82665_g; + j1 *= this.field_82665_g; + i1 += random.nextInt(this.field_82665_g - this.field_82666_h); + j1 += random.nextInt(this.field_82665_g - this.field_82666_h); + + return (k == i1) && (l == j1); + } + + public void initiate() { + this.structuresList.clear(); + } +} diff --git a/src/Java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java b/src/Java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java index 9b66c98be2..0025c054bd 100644 --- a/src/Java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java +++ b/src/Java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java @@ -8,6 +8,7 @@ import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; @@ -20,11 +21,24 @@ public class TradeHandlerTrader extends TradeHandlerBase { @SuppressWarnings("unchecked") @Override public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { + ItemStack Ore1 = null, Ore2 = null; + if (Ore1 == null) { + Ore1 = ELEMENT.getInstance().SILICON.getOre(1); + } + if (Ore2 == null) { + Ore2 = ELEMENT.getInstance().ALUMINIUM.getOre(1); + } + if (Ore1 == null) { + Ore1 = ELEMENT.getInstance().GOLD.getOre(1); + } + if (Ore2 == null) { + Ore2 = ELEMENT.getInstance().LEAD.getOre(1); + } recipeList.add(new MerchantRecipe(ItemUtils.getItemStackOfAmountFromOreDict("logWood", 32), ELEMENT.getInstance().IRON.getOre(1))); recipeList.add(new MerchantRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 32), ELEMENT.getInstance().COPPER.getOre(1))); recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.obsidian, 6), ELEMENT.getInstance().TIN.getOre(1))); - recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.glowstone, 32), ELEMENT.getInstance().SILICON.getOre(1))); - recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.piston, 32), ELEMENT.getInstance().ALUMINIUM.getOre(1))); + recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.glowstone, 32), Ore1)); + recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.piston, 32), Ore2)); Collections.shuffle(recipeList); } |