aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/australia/gen/map/component
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-08-29 16:04:28 +0200
committerGitHub <noreply@github.com>2022-08-29 16:04:28 +0200
commit7d1f51a8937e0a86486267437d444696e81e8aa0 (patch)
treea5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/australia/gen/map/component
parent5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff)
downloadGT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip
Buildscript + Spotless (#318)
* Convert AES.java to readable class * Buildscript * Spotless
Diffstat (limited to 'src/main/java/gtPlusPlus/australia/gen/map/component')
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java360
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java906
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/component/ComponentShack.java578
3 files changed, 954 insertions, 890 deletions
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java b/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java
index b6b83d997b..98eb22f760 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java
@@ -1,8 +1,7 @@
package gtPlusPlus.australia.gen.map.component;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -17,180 +16,185 @@ 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;
- }
+ 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/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java b/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
index 1f5dd59667..c43a201fd1 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
@@ -1,14 +1,12 @@
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 gtPlusPlus.plugin.villagers.entity.EntityNativeAustralian;
+import java.util.Random;
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;
@@ -19,456 +17,454 @@ 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 aWall1, aWall2, aRoof, aFloor;
-
- if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
- aWall1 = Blocks.sand;
- aWall2 = Blocks.sandstone;
- aRoof = Blocks.sandstone;
- aFloor = Blocks.sandstone;
- }
- else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
- aWall1 = Blocks.clay;
- aWall2 = Blocks.hardened_clay;
- aRoof = Blocks.hardened_clay;
- aFloor = Blocks.stained_hardened_clay;
- }
- else {
- aWall1 = Blocks.sand;
- aWall2 = Blocks.sandstone;
- aRoof = Blocks.sandstone;
- aFloor = Blocks.sandstone;
- }
-
- //Empty Area
- fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6);
-
- //Build Floor
- fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 0, 6, 0, 6, aFloor, 0, aFloor, 1, false);
-
- //Layer 2
- int dir = MathUtils.randInt(0, 3);
-
- //Door First
- if (dir == 0) {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 0, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
- else if (dir == 1) {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 3, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
- else if (dir == 2) {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 6, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
- else {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 3, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
-
- //Layer 1
- //Wall Top
- place(aWall1, 0, 0, 1, 2, this.boundingBox, world);
- if (dir != 0) place(aWall1, 0, 0, 1, 3, this.boundingBox, world);
- place(aWall1, 0, 0, 1, 4, this.boundingBox, world);
- //Wall Right
- place(aWall1, 0, 2, 1, 6, this.boundingBox, world);
- if (dir != 1) place(aWall2, 0, 3, 1, 6, this.boundingBox, world);
- place(aWall1, 0, 4, 1, 6, this.boundingBox, world);
- //Wall Bottom
- place(aWall2, 0, 6, 1, 4, this.boundingBox, world);
- if (dir != 2) place(aWall1, 0, 6, 1, 3, this.boundingBox, world);
- place(aWall1, 0, 6, 1, 2, this.boundingBox, world);
- //Wall Left
- place(aWall1, 0, 4, 1, 0, this.boundingBox, world);
- if (dir != 3) place(aWall1, 0, 3, 1, 0, this.boundingBox, world);
- place(aWall2, 0, 2, 1, 0, this.boundingBox, world);
- //Corners
- place(aWall1, 0, 1, 1, 5, this.boundingBox, world);
- place(aWall2, 0, 5, 1, 5, this.boundingBox, world);
- place(aWall1, 0, 5, 1, 1, this.boundingBox, world);
- place(aWall1, 0, 1, 1, 1, this.boundingBox, world);
-
-
- //Wall Top
- place(aWall1, 0, 0, 2, 2, this.boundingBox, world);
- //place(aWall1, 0, 0, 2, 3, this.boundingBox, world);
- place(aWall2, 0, 0, 2, 4, this.boundingBox, world);
-
- //Wall Right
- place(aWall2, 0, 2, 2, 6, this.boundingBox, world);
- //place(aWall1, 0, 3, 2, 6, this.boundingBox, world);
- place(aWall1, 0, 4, 2, 6, this.boundingBox, world);
-
- //Wall Bottom
- place(aWall1, 0, 6, 2, 4, this.boundingBox, world);
- //place(aWall1, 0, 6, 2, 3, this.boundingBox, world);
- place(aWall2, 0, 6, 2, 2, this.boundingBox, world);
-
- //Wall Left
- place(aWall1, 0, 4, 2, 0, this.boundingBox, world);
- //place(aWall2, 0, 4, 2, 0, this.boundingBox, world);
- place(aWall1, 0, 2, 2, 0, this.boundingBox, world);
-
- //Corners
- place(aWall1, 0, 1, 2, 5, this.boundingBox, world);
- place(aWall1, 0, 5, 2, 5, this.boundingBox, world);
- place(aWall2, 0, 5, 2, 1, this.boundingBox, world);
- place(aWall2, 0, 1, 2, 1, this.boundingBox, world);
-
- //Layer 3
- //Wall Top
- place(aWall2, 0, 0, 3, 2, this.boundingBox, world);
- place(aWall1, 0, 0, 3, 3, this.boundingBox, world);
- place(aWall1, 0, 0, 3, 4, this.boundingBox, world);
- //Wall Right
- place(aWall1, 0, 2, 3, 6, this.boundingBox, world);
- place(aWall1, 0, 3, 3, 6, this.boundingBox, world);
- place(aWall1, 0, 4, 3, 6, this.boundingBox, world);
- //Wall Bottom
- place(aWall1, 0, 6, 3, 4, this.boundingBox, world);
- place(aWall2, 0, 6, 3, 3, this.boundingBox, world);
- place(aWall1, 0, 6, 3, 2, this.boundingBox, world);
- //Wall Left
- place(aWall1, 0, 4, 3, 0, this.boundingBox, world);
- place(aWall2, 0, 3, 3, 0, this.boundingBox, world);
- place(aWall1, 0, 2, 3, 0, this.boundingBox, world);
- //Corners
- place(aWall1, 0, 1, 3, 5, this.boundingBox, world);
- place(aWall2, 0, 5, 3, 5, this.boundingBox, world);
- place(aWall1, 0, 5, 3, 1, this.boundingBox, world);
- place(aWall1, 0, 1, 3, 1, this.boundingBox, world);
-
- //Roof
- //Roof 1 Top
- place(aRoof, 0, 1, 4, 2, this.boundingBox, world);
- place(aRoof, 0, 1, 4, 3, this.boundingBox, world);
- place(aRoof, 0, 1, 4, 4, this.boundingBox, world);
- //Roof 1 Right
- place(aRoof, 0, 2, 4, 5, this.boundingBox, world);
- place(aRoof, 0, 3, 4, 5, this.boundingBox, world);
- place(aRoof, 0, 4, 4, 5, this.boundingBox, world);
- //Roof 1 Bottom
- place(aRoof, 0, 5, 4, 4, this.boundingBox, world);
- place(aRoof, 0, 5, 4, 3, this.boundingBox, world);
- place(aRoof, 0, 5, 4, 2, this.boundingBox, world);
- //Roof 1 Left
- place(aRoof, 0, 4, 4, 1, this.boundingBox, world);
- place(aRoof, 0, 3, 4, 1, this.boundingBox, world);
- place(aRoof, 0, 2, 4, 1, this.boundingBox, world);
-
- //Roof 2 Top
- place(aRoof, 0, 2, 5, 2, this.boundingBox, world);
- place(aRoof, 0, 2, 5, 3, this.boundingBox, world);
- place(aRoof, 0, 2, 5, 4, this.boundingBox, world);
-
- //Roof 2 Right
- //place(aWall1, 0, 2, 5, 4, this.boundingBox, world);
- place(aRoof, 0, 3, 5, 4, this.boundingBox, world);
- //place(aWall1, 0, 4, 5, 4, this.boundingBox, world);
-
- //Roof 2 Bottom
- place(aRoof, 0, 4, 5, 4, this.boundingBox, world);
- place(aRoof, 0, 4, 5, 3, this.boundingBox, world);
- place(aRoof, 0, 4, 5, 2, this.boundingBox, world);
-
- //Roof 2 Left
- //place(aWall1, 0, 4, 5, 2, this.boundingBox, world);
- place(aRoof, 0, 3, 5, 2, this.boundingBox, world);
- //place(aWall1, 0, 2, 5, 2, this.boundingBox, world);
-
- //Roof 3 Top
- place(Blocks.glowstone, 0, 3, 5, 3, this.boundingBox, world);
- /*
- 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 = -2; x < 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, aFloor, 0, j, 0, i, this.boundingBox);
- }
- }
- spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5));
-
- return true;
-
- /*
- 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 = -2; x < 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) {
- EntityNativeAustralian entityvillager = new EntityNativeAustralian(par1World);
- 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() {
- }
- }
-
+ 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 aWall1, aWall2, aRoof, aFloor;
+
+ if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
+ aWall1 = Blocks.sand;
+ aWall2 = Blocks.sandstone;
+ aRoof = Blocks.sandstone;
+ aFloor = Blocks.sandstone;
+ } else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
+ aWall1 = Blocks.clay;
+ aWall2 = Blocks.hardened_clay;
+ aRoof = Blocks.hardened_clay;
+ aFloor = Blocks.stained_hardened_clay;
+ } else {
+ aWall1 = Blocks.sand;
+ aWall2 = Blocks.sandstone;
+ aRoof = Blocks.sandstone;
+ aFloor = Blocks.sandstone;
+ }
+
+ // Em