mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 15:03:01 +00:00
more fixes
This commit is contained in:
1 parent
eba66e0182
commit
fb04e8eb08
55 files changed
+1446
-1442
No files matched your search
@@ -3,13 +3,14 @@ package tconstruct.worldgen;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class PlantGen extends WorldGenerator
|
||||
{
|
||||
/** The ID of the plant block used in this plant generator. */
|
||||
public final int plantID;
|
||||
public final Block plant;
|
||||
public final int metadata;
|
||||
public int chances = 64;
|
||||
int xSize = 8;
|
||||
@@ -17,15 +18,15 @@ public class PlantGen extends WorldGenerator
|
||||
int zSize = 8;
|
||||
boolean clumped = true;
|
||||
|
||||
public PlantGen(int id, int meta)
|
||||
public PlantGen(Block b, int meta)
|
||||
{
|
||||
this.plantID = id;
|
||||
this.plant = b;
|
||||
this.metadata = meta;
|
||||
}
|
||||
|
||||
public PlantGen(int id, int meta, int count, int range, int height, int width, boolean clumped)
|
||||
public PlantGen(Block b, int meta, int count, int range, int height, int width, boolean clumped)
|
||||
{
|
||||
this.plantID = id;
|
||||
this.plant = b;
|
||||
this.metadata = meta;
|
||||
this.chances = count;
|
||||
this.xSize = range;
|
||||
@@ -42,9 +43,9 @@ public class PlantGen extends WorldGenerator
|
||||
int posY = clumped ? y + random.nextInt(ySize) - random.nextInt(ySize) : y + random.nextInt(ySize);
|
||||
int posZ = clumped ? z + random.nextInt(zSize) - random.nextInt(zSize) : z + random.nextInt(zSize);
|
||||
|
||||
if (world.isAirBlock(posX, posY, posZ) && (!world.provider.hasNoSky || posY < 127) && Block.blocksList[this.plantID].canBlockStay(world, posX, posY, posZ))
|
||||
if (world.func_147439_a(posX, posY, posZ) == Blocks.air && (!world.provider.hasNoSky || posY < 127) && this.plant.func_149718_j(world, posX, posY, posZ))
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, this.plantID, this.metadata, 2);
|
||||
world.func_147465_d(posX, posY, posZ, this.plant, this.metadata, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
@@ -66,7 +67,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
for (int y = 0; y <= height; y++)
|
||||
{
|
||||
if (ellipse.contains(x, z))
|
||||
world.setBlock(x + xChunk, y + yCenter, z + zChunk, base, 5, 0);
|
||||
world.func_147465_d(x + xChunk, y + yCenter, z + zChunk, base, 5, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,14 +83,14 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
int xPos = x + xChunk;
|
||||
int yPos = y + yCenter + height;
|
||||
int zPos = z + zChunk;
|
||||
if (world.getBlock(xPos - 1, yPos + 1, zPos) == base && world.getBlock(xPos + 1, yPos + 1, zPos) == base && world.getBlock(xPos, yPos + 1, zPos - 1) == base
|
||||
&& world.getBlock(xPos - 1, yPos + 1, zPos + 1) == base && random.nextInt(100) > randomness)
|
||||
if (world.func_147439_a(xPos - 1, yPos + 1, zPos) == base && world.func_147439_a(xPos + 1, yPos + 1, zPos) == base && world.func_147439_a(xPos, yPos + 1, zPos - 1) == base
|
||||
&& world.func_147439_a(xPos - 1, yPos + 1, zPos + 1) == base && random.nextInt(100) > randomness)
|
||||
{
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlock(xPos, yPos, zPos, 0, 0, 0);
|
||||
world.func_147465_d(xPos, yPos, zPos, Blocks.air, 0, 0);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -107,14 +108,14 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
int xPos = x + xChunk;
|
||||
int yPos = y + yCenter + initialHeight - height + 1;
|
||||
int zPos = z + zChunk;
|
||||
if (world.getBlock(xPos - 1, yPos - 1, zPos) == base && world.getBlock(xPos + 1, yPos - 1, zPos) == base && world.getBlock(xPos, yPos - 1, zPos - 1) == base
|
||||
&& world.getBlock(xPos - 1, yPos - 1, zPos + 1) == base)
|
||||
if (world.func_147439_a(xPos - 1, yPos - 1, zPos) == base && world.func_147439_a(xPos + 1, yPos - 1, zPos) == base && world.func_147439_a(xPos, yPos - 1, zPos - 1) == base
|
||||
&& world.func_147439_a(xPos - 1, yPos - 1, zPos + 1) == base)
|
||||
{
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlock(xPos, yPos, zPos, 0, 0, 0);
|
||||
world.func_147465_d(xPos, yPos, zPos, Blocks.air, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,11 +131,11 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
int xPos = x + xChunk;
|
||||
int yPos = y + yCenter + initialHeight - height;
|
||||
int zPos = z + zChunk;
|
||||
if (world.getBlock(xPos, yPos, zPos) == base)
|
||||
if (world.func_147439_a(xPos, yPos, zPos) == base)
|
||||
{
|
||||
Block block = Block.blocksList[world.getBlock(xPos, yPos + 1, zPos)];
|
||||
if (block == null || block.isAirBlock(world, xPos, yPos + 1, zPos))
|
||||
world.setBlock(xPos, yPos, zPos, top, 0, 0);
|
||||
Block block = world.func_147439_a(xPos, yPos + 1, zPos);
|
||||
if (block == null || block == Blocks.air)
|
||||
world.func_147465_d(xPos, yPos, zPos, top, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +146,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
{
|
||||
generateSlimePool(world, rand, xChunk + xRange / 2, yCenter + initialHeight, zChunk + zRange / 2);
|
||||
}
|
||||
PlantGen tallGrass = new PlantGen(TRepo.slimeTallGrass.blockID, 0, 128, xRange, 1, zRange, false);
|
||||
PlantGen tallGrass = new PlantGen(TRepo.slimeTallGrass, 0, 128, xRange, 1, zRange, false);
|
||||
tallGrass.generate(world, rand, xChunk, yCenter + initialHeight + 1, zChunk);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
@@ -232,7 +233,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
return false;
|
||||
}
|
||||
|
||||
if (yPos < 4 && !var12.isSolid() && world.getBlock(x + xPos, y + yPos, z + zPos) != this.liquidBlock)
|
||||
if (yPos < 4 && !var12.isSolid() && world.func_147439_a(x + xPos, y + yPos, z + zPos) != this.liquidBlock)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -249,7 +250,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
{
|
||||
if (validLocations[(xPos * 16 + zPos) * 8 + yPos])
|
||||
{
|
||||
world.setBlock(x + xPos, y + yPos, z + zPos, yPos >= 4 ? 0 : this.liquidBlock);
|
||||
world.func_147465_d(x + xPos, y + yPos, z + zPos, yPos >= 4 ? Blocks.air : this.liquidBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,17 +262,17 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
{
|
||||
for (yPos = 4; yPos < 8; ++yPos)
|
||||
{
|
||||
if (validLocations[(xPos * 16 + zPos) * 8 + yPos] && world.getBlock(x + xPos, y + yPos - 1, z + zPos) == base
|
||||
if (validLocations[(xPos * 16 + zPos) * 8 + yPos] && world.func_147439_a(x + xPos, y + yPos - 1, z + zPos) == base
|
||||
&& world.getSavedLightValue(EnumSkyBlock.Sky, x + xPos, y + yPos, z + zPos) > 0)
|
||||
{
|
||||
world.setBlock(x + xPos, y + yPos - 1, z + zPos, top, 0, 0);
|
||||
world.func_147465_d(x + xPos, y + yPos - 1, z + zPos, top, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Generate blocks around
|
||||
if (this.liquidBlock.blockMaterial == Material.water)
|
||||
if (this.liquidBlock.func_149688_o() == Material.field_151586_h)
|
||||
{
|
||||
for (xPos = 0; xPos < 16; ++xPos)
|
||||
{
|
||||
@@ -285,9 +286,9 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
|
||||
&& validLocations[(xPos * 16 + zPos) * 8 + yPos + 1] || yPos > 0 && validLocations[(xPos * 16 + zPos) * 8 + (yPos - 1)]);
|
||||
|
||||
if (var33 && (yPos < 4 || rand.nextInt(2) != 0) && world.getBlockMaterial(x + xPos, y + yPos, z + zPos).isSolid()
|
||||
&& world.getBlockMaterial(x + xPos, y + yPos + 1, z + zPos) != Material.water)
|
||||
&& world.getBlockMaterial(x + xPos, y + yPos + 1, z + zPos) != Material.field_151586_h)
|
||||
{
|
||||
world.setBlock(x + xPos, y + yPos, z + zPos, TRepo.slimeGel, gelMeta, 2);
|
||||
world.func_147465_d(x + xPos, y + yPos, z + zPos, TRepo.slimeGel, gelMeta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ public class TBaseWorldGenerator implements IWorldGenerator
|
||||
{
|
||||
public TBaseWorldGenerator()
|
||||
{
|
||||
copper = new WorldGenMinable(TRepo.oreSlag, 3, 8, Block.stone);
|
||||
tin = new WorldGenMinable(TRepo.oreSlag, 4, 8, Block.stone);
|
||||
aluminum = new WorldGenMinable(TRepo.oreSlag, 5, 6, Block.stone);
|
||||
copper = new WorldGenMinable(TRepo.oreSlag, 3, 8, Blocks.stone);
|
||||
tin = new WorldGenMinable(TRepo.oreSlag, 4, 8, Blocks.stone);
|
||||
aluminum = new WorldGenMinable(TRepo.oreSlag, 5, 6, Blocks.stone);
|
||||
|
||||
cobalt = new WorldGenMinable(TRepo.oreSlag, 1, 3, Block.netherrack);
|
||||
ardite = new WorldGenMinable(TRepo.oreSlag, 2, 3, Block.netherrack);
|
||||
cobalt = new WorldGenMinable(TRepo.oreSlag, 1, 3, Blocks.netherrack);
|
||||
ardite = new WorldGenMinable(TRepo.oreSlag, 2, 3, Blocks.netherrack);
|
||||
|
||||
ironBush = new OreberryBushGen(TRepo.oreBerry, 12, 12);
|
||||
goldBush = new OreberryBushGen(TRepo.oreBerry, 13, 6);
|
||||
@@ -243,7 +243,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
|
||||
int height = y;
|
||||
do
|
||||
{
|
||||
if (world.getBlockId(x, height, z) == 0 && world.getBlockId(x, height + 1, z) != 0)
|
||||
if (world.func_147439_a(x, height, z) == Blocks.air && world.func_147439_a(x, height + 1, z) != Blocks.air)
|
||||
return height + 1;
|
||||
height++;
|
||||
} while (height < heightLimit);
|
||||
@@ -251,7 +251,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
|
||||
height = y;
|
||||
do
|
||||
{
|
||||
if (world.getBlockId(x, height, z) == 0 && world.getBlockId(x, height - 1, z) != 0)
|
||||
if (world.func_147439_a(x, height, z) == Blocks.air && world.func_147439_a(x, height - 1, z) != Blocks.air)
|
||||
return height - 1;
|
||||
height--;
|
||||
} while (height > depthLimit);
|
||||
@@ -263,7 +263,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
|
||||
{
|
||||
/*for (int x = 0; x < 16; x++)
|
||||
for (int z = 0; z < 16; z++)
|
||||
world.setBlock(x+chunkX, 192, z+chunkZ, Block.glowStone);*/
|
||||
world.func_147465_d(x+chunkX, 192, z+chunkZ, Block.glowStone);*/
|
||||
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
@@ -271,20 +271,19 @@ public class TBaseWorldGenerator implements IWorldGenerator
|
||||
{
|
||||
for (int y = 0; y < 128; y++)
|
||||
{
|
||||
int blockID = world.getBlockId(x + chunkX, y, z + chunkZ);
|
||||
Block block = Block.blocksList[blockID];
|
||||
Block block = world.func_147439_a(x + chunkX, y, z + chunkZ);
|
||||
if (block != null)
|
||||
{
|
||||
if (block.func_149688_o() == Material.leaves)
|
||||
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.lava, 0, 0);
|
||||
if (block.func_149688_o() == Material.wood)
|
||||
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.netherrack, 0, 0);
|
||||
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.lava, 0, 0);
|
||||
if (block.func_149688_o() == Material.field_151575_d)
|
||||
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.netherrack, 0, 0);
|
||||
if (block == Blocks.stone)
|
||||
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.end_stone, 0, 0);
|
||||
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.end_stone, 0, 0);
|
||||
if (y > 40 && (block.func_149688_o() == Material.ground || block.func_149688_o() == Material.grass))
|
||||
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.soul_sand, 0, 0);
|
||||
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.soul_sand, 0, 0);
|
||||
if (block.func_149688_o() == Material.sand)
|
||||
world.setBlock(x + chunkX, y, z + chunkZ, Block.silverfish, 0, 0);
|
||||
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.silverfish, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,7 +300,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
|
||||
{
|
||||
for (int y = 0; y < 256; y++)
|
||||
{
|
||||
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.bedrock, 0, 0);
|
||||
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.bedrock, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Random;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
import net.minecraft.world.gen.structure.MapGenVillage;
|
||||
@@ -58,25 +59,25 @@ public class ComponentSmeltery extends MapGenVillage
|
||||
* maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
|
||||
*/
|
||||
|
||||
this.fillWithBlocks(world, sbb, 1, 0, 0, 7, 0, 6, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); //Base
|
||||
this.fillWithBlocks(world, sbb, 0, 0, 1, 0, 0, 5, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false);
|
||||
this.fillWithBlocks(world, sbb, 8, 0, 1, 8, 0, 5, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false);
|
||||
this.fillWithBlocks(world, sbb, 1, 0, 0, 7, 0, 6, Blocks.stonebrick, Blocks.stonebrick, false); //Base
|
||||
this.fillWithBlocks(world, sbb, 0, 0, 1, 0, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
|
||||
this.fillWithBlocks(world, sbb, 8, 0, 1, 8, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
|
||||
this.fillWithBlocks(world, sbb, 0, 1, 0, 9, 3, 7, 0, 0, false);
|
||||
|
||||
this.fillWithMetaBlocks(world, sbb, 2, 0, 1, 6, 2, 5, TRepo.smeltery.blockID, 2, TRepo.smeltery.blockID, 2, false); //Basin
|
||||
this.fillWithMetaBlocks(world, sbb, 2, 0, 1, 6, 2, 5, TRepo.smeltery, 2, TRepo.smeltery, 2, false); //Basin
|
||||
this.fillWithBlocks(world, sbb, 3, 1, 2, 5, 2, 4, 0, 0, false);
|
||||
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 0, 1, 1, 2, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 2, 1, 1, 4, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 0, 7, 1, 2, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 2, 7, 1, 4, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 0, 1, 1, 2, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 2, 1, 1, 4, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 0, 7, 1, 2, sbb);
|
||||
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 2, 7, 1, 4, sbb);
|
||||
|
||||
for (int l = 1; l < 6; ++l)
|
||||
{
|
||||
for (int i1 = 0; i1 < 9; ++i1)
|
||||
{
|
||||
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
|
||||
this.fillCurrentPositionBlocksDownwards(world, Block.stoneBrick.blockID, 0, i1, -1, l, sbb);
|
||||
this.fillCurrentPositionBlocksDownwards(world, Blocks.stonebrick, 0, i1, -1, l, sbb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +86,7 @@ public class ComponentSmeltery extends MapGenVillage
|
||||
for (int i1 = 1; i1 < 8; ++i1)
|
||||
{
|
||||
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
|
||||
this.fillCurrentPositionBlocksDownwards(world, Block.stoneBrick.blockID, 0, i1, -1, l, sbb);
|
||||
this.fillCurrentPositionBlocksDownwards(world, Blocks.stonebrick, 0, i1, -1, l, sbb);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -105,7 +106,7 @@ public class ComponentSmeltery extends MapGenVillage
|
||||
case 3:
|
||||
return 0;
|
||||
}
|
||||
TConstruct.logger.severe("This shouldn't happen (remapDirection in tconstruct.worldgen.village.ComponentSmeltery)");
|
||||
TConstruct.logger.error("This shouldn't happen (remapDirection in tconstruct.worldgen.village.ComponentSmeltery)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -157,10 +157,10 @@ public class ComponentToolWorkshop extends MapGenVillage
|
||||
int posY = this.getYWithOffset(y);
|
||||
int posZ = this.getZWithOffset(x, z);
|
||||
|
||||
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Blocks.chest.blockID)
|
||||
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlock(posX, posY, posZ) != Blocks.chest)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, TRepo.craftingStationWood, 5, 2);
|
||||
CraftingStationLogic logic = (CraftingStationLogic) world.getBlockTileEntity(posX, posY, posZ);
|
||||
CraftingStationLogic logic = (CraftingStationLogic) world.func_147438_o(posX, posY, posZ);
|
||||
|
||||
if (logic != null)
|
||||
{
|
||||
@@ -181,10 +181,10 @@ public class ComponentToolWorkshop extends MapGenVillage
|
||||
int posY = this.getYWithOffset(y);
|
||||
int posZ = this.getZWithOffset(x, z);
|
||||
|
||||
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Blocks.chest.blockID)
|
||||
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlock(posX, posY, posZ) != Blocks.chest)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, TRepo.toolStationWood, 5, 2);
|
||||
PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(posX, posY, posZ);
|
||||
PatternChestLogic logic = (PatternChestLogic) world.func_147438_o(posX, posY, posZ);
|
||||
|
||||
if (logic != null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user