block cleanup #4

This commit is contained in:
Sen 2025-06-21 11:23:42 +02:00
parent a836d7a2a5
commit 84611eef7f
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
21 changed files with 139 additions and 108 deletions

View file

@ -15,7 +15,6 @@ import common.model.Model;
import common.model.ModelProvider;
import common.properties.Property;
import common.properties.PropertyBool;
import common.properties.PropertyEnum;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Facing;

View file

@ -1,16 +1,18 @@
package common.block;
package common.block.artificial;
import common.block.Block;
import common.block.Material;
import common.color.DyeColor;
import common.item.CheatTab;
import common.model.Model;
import common.model.ModelProvider;
import common.world.State;
public class BlockColored extends Block {
public class BlockWool extends Block {
private final DyeColor color;
public BlockColored(Material material, DyeColor color) {
super(material);
public BlockWool(DyeColor color) {
super(Material.BURNABLE);
this.color = color;
this.setTab(CheatTab.BLOCKS);
}
@ -20,6 +22,6 @@ public class BlockColored extends Block {
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel(this.color.getName() + "_" + name).add().all();
return provider.getModel(this.color.getName() + "_wool").add().all();
}
}

View file

@ -2,6 +2,7 @@ package common.block.foliage;
import common.block.Block;
import common.block.Material;
import common.block.natural.BlockColoredClay;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.Items;
@ -38,7 +39,7 @@ public class BlockDeadBush extends BlockBush
*/
protected boolean canPlaceBlockOn(Block ground)
{
return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt;
return ground == Blocks.sand || ground == Blocks.hardened_clay || ground instanceof BlockColoredClay || ground == Blocks.dirt;
}
/**

View file

@ -125,11 +125,11 @@ public class BlockTallGrass extends BlockBush implements IGrowable
public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{
BlockDoublePlant block = Blocks.tallgrass_double;
BlockDoublePlant block = Blocks.large_tallgrass;
if (this.type == BlockTallGrass.EnumType.FERN)
{
block = Blocks.fern_double;
block = Blocks.large_fern;
}
if (block.canPlaceBlockAt(worldIn, pos))

View file

@ -0,0 +1,27 @@
package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.color.DyeColor;
import common.item.CheatTab;
import common.model.Model;
import common.model.ModelProvider;
import common.world.State;
public class BlockColoredClay extends Block {
private final DyeColor color;
public BlockColoredClay(DyeColor color) {
super(Material.SOLID);
this.color = color;
this.setTab(CheatTab.NATURE);
}
public DyeColor getColor() {
return this.color;
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel(this.color.getName() + "_clay").add().all();
}
}

View file

@ -7,8 +7,6 @@ import common.block.Material;
import common.entity.Entity;
import common.entity.item.EntityItem;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.FluidRegistry;
import common.init.Items;
import common.item.Item;
import common.item.ItemArmor;

View file

@ -19,7 +19,6 @@ import common.model.ModelProvider;
import common.model.ModelRotation;
import common.properties.Property;
import common.properties.PropertyBool;
import common.properties.PropertyEnum;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityPiston;
import common.util.BlockPos;

View file

@ -27,7 +27,7 @@ import common.block.artificial.BlockStairs;
import common.block.artificial.BlockStoneBrick;
import common.block.artificial.BlockTrapDoor;
import common.block.artificial.BlockWall;
import common.block.foliage.BlockBaseFlower;
import common.block.artificial.BlockWool;
import common.block.foliage.BlockBlackenedSoil;
import common.block.foliage.BlockBlueShroom;
import common.block.foliage.BlockCactus;
@ -61,6 +61,7 @@ import common.block.natural.BlockBedrock;
import common.block.natural.BlockBlackenedDirt;
import common.block.natural.BlockBlackenedStone;
import common.block.natural.BlockClay;
import common.block.natural.BlockColoredClay;
import common.block.natural.BlockDirt;
import common.block.natural.BlockFire;
import common.block.natural.BlockGlowstone;
@ -252,8 +253,8 @@ public abstract class BlockRegistry {
.setDisplay("Obsidian").setMiningLevel(3));
registerBlock("clay", (new BlockClay()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable());
registerBlock("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(SoundType.STONE).setDisplay("Gebrannter Ton"));
registerBlock("stained_hardened_clay", (new BlockColored(Material.SOLID)).setHardness(1.25F).setResistance(7.0F)
.setStepSound(SoundType.STONE).setDisplay("gefärbter Ton").setTab(CheatTab.NATURE));
registerBlock("stained_hardened_clay", (new BlockColoredClay()).setHardness(1.25F).setResistance(7.0F)
.setStepSound(SoundType.STONE).setDisplay("gefärbter Ton"));
registerBlock("coal_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Kohleblock").setTab(CheatTab.NATURE));
registerBlock("sand", (new BlockSand()).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable());
@ -392,7 +393,7 @@ public abstract class BlockRegistry {
registerBlock("wool", (new BlockColored(Material.BURNABLE)).setHardness(0.8F).setStepSound(SoundType.CLOTH).setDisplay("Wolle")
registerBlock("wool", (new BlockWool()).setHardness(0.8F).setStepSound(SoundType.CLOTH).setDisplay("Wolle")
.setShearsEfficiency(1));
registerBlock("carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(SoundType.CLOTH).setDisplay("Teppich").setLightOpacity(0));
for(DyeColor color : BlockBed.COLORS) {

View file

@ -348,7 +348,7 @@ public abstract class Blocks {
public static final BlockStairs spruce_stairs = get("spruce_stairs");
public static final BlockStainedGlass stained_glass = get("stained_glass");
public static final BlockStainedGlassPane stained_glass_pane = get("stained_glass_pane");
public static final BlockColored stained_hardened_clay = get("stained_hardened_clay");
public static final BlockWool stained_hardened_clay = get("stained_hardened_clay");
public static final BlockPistonBase sticky_piston = get("sticky_piston");
public static final BlockStone stone = get("stone");
public static final BlockButton stone_button = get("stone_button");
@ -403,7 +403,7 @@ public abstract class Blocks {
public static final BlockBed white_bed = get("white_bed");
public static final BlockButton wooden_button = get("wooden_button");
public static final BlockPressurePlate wooden_pressure_plate = get("wooden_pressure_plate");
public static final BlockColored wool = get("wool");
public static final BlockWool wool = get("wool");
public static final BlockWorkbench workbench = get("workbench");
public static final Block zinc_block = get("zinc_block");
public static final BlockOre zinc_ore = get("zinc_ore");

View file

@ -5,7 +5,7 @@ import java.util.Map;
import java.util.Map.Entry;
import common.biome.Biome;
import common.block.BlockColored;
import common.block.artificial.BlockWool;
import common.block.foliage.LeavesType;
import common.block.natural.BlockSand;
import common.collect.Lists;
@ -557,7 +557,7 @@ public abstract class UniverseRegistry {
.setPerlinGen(Blocks.sand.getState(), Blocks.air.getState(), 63)
.setTimeQualifier(1), "sol");
registerDimension("Mars", new Planet(6, "mars", 0xd6905b, 0xbd723a, 0xbd9273, 16487781L, 24623L, 3.71f, 208.0f)
.setPerlinGen(Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND),
.setPerlinGen(Blocks.red_sand.getState(),
Blocks.air.getState(), 63).setTimeQualifier(1), "sol");
registerDimension("Jupiter", new Planet(7, "jupiter", 0xffd5ba, 0xb89f90, 0xc7b5a9, 103989391L, 9925L, 24.79f, 163.0f).enableDenseFog()
.setFlatGen(Blocks.hydrogen.getState(), 256).setTimeQualifier(1).setCloudHeight(576.0f), "sol");
@ -615,7 +615,7 @@ public abstract class UniverseRegistry {
.enableMobs().enableSnow().setWeather(Weather.SNOW), "transylvania");
registerDimension("'Wüstenplanet Me'sar'", new Planet(104, "mesar", 0xff7f3f, 0xff6022, 0xff6f00, 56643366L, 87340L, 11.0f, 333.15f)
.setTimeQualifier(5).setPerlinGen(Blocks.rock.getState(), Blocks.air.getState(), 63)
.setBiomeReplacer(Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND))
.setBiomeReplacer(Blocks.red_sand.getState())
.setBiomeGen(Biome.MESA, true, 3, 1000, 100000, 100000)
.enableCavesRavines(Blocks.lava.getState()).enableMobs()
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
@ -656,7 +656,7 @@ public abstract class UniverseRegistry {
.addLiquid(Blocks.flowing_springwater.getState(), 50, 8, 255, false), "tianxin");
registerDimension("Cyberspace", new Area(-3, "cyberspace", 0x000000, 0x000000, 293.15f, 15)
.setFlatGen(Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.GREEN), 2)
.setFlatGen(Blocks.green_clay.getState(), 2)
.enableMobs());
registerDomain("Hölle", "hell");

View file

@ -21,8 +21,8 @@ import server.worldgen.tree.WorldGenTree;
public class BiomeForest extends GenBiome
{
private static final BlockDoublePlant.EnumPlantType[] FLOWER_TYPES = new BlockDoublePlant.EnumPlantType[] {
BlockDoublePlant.EnumPlantType.SYRINGA, BlockDoublePlant.EnumPlantType.ROSE, BlockDoublePlant.EnumPlantType.PAEONIA
private static final BlockDoublePlant[] FLOWER_TYPES = new BlockDoublePlant[] {
Blocks.syringa, Blocks.rose_bush, Blocks.paeonia
};
protected static final WorldGenBirch tallBirch = new WorldGenBirch(false, true);
protected static final WorldGenBirch normalBirch = new WorldGenBirch(false, false);

View file

@ -61,7 +61,7 @@ public class BiomeJungle extends GenBiome
*/
public FeatureGenerator getRandomWorldGenForGrass(Random rand)
{
return rand.chance(4) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
return rand.chance(4) ? new WorldGenTallGrass(Blocks.large_fern) : new WorldGenTallGrass(Blocks.tallgrass);
}
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)

View file

@ -4,7 +4,8 @@ import java.util.Arrays;
import common.biome.Biome;
import common.block.Block;
import common.block.BlockColored;
import common.block.artificial.BlockWool;
import common.block.natural.BlockColoredClay;
import common.block.natural.BlockDirt;
import common.block.natural.BlockSand;
import common.color.DyeColor;
@ -37,8 +38,8 @@ public class BiomeMesa extends GenBiome
// this.setDisableRain();
// this.setTemperatureLegacy(2.0F).setHumidity(0.0F);
// this.mobs.clear();
this.topBlock = Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND);
this.fillerBlock = Blocks.stained_hardened_clay.getState();
this.topBlock = Blocks.red_sand.getState();
this.fillerBlock = Blocks.white_clay.getState();
this.treesPerChunk = -999;
this.deadBushPerChunk = 20;
this.reedsPerChunk = 3;
@ -107,7 +108,7 @@ public class BiomeMesa extends GenBiome
int j1 = x & 15;
int k1 = z & 15;
int l1 = worldIn.getSeaLevel();
State iblockstate = Blocks.stained_hardened_clay.getState();
State iblockstate = Blocks.white_clay.getState();
State iblockstate3 = this.fillerBlock;
int k = (int)(noiseVal / 3.0D + 3.0D + rand.doublev() * 0.25D);
boolean flag = Math.cos(noiseVal / 3.0D * Math.PI) > 0.0D;
@ -151,7 +152,7 @@ public class BiomeMesa extends GenBiome
}
else if (i1 >= l1 - 4 && i1 <= l1 + 1)
{
iblockstate = Blocks.stained_hardened_clay.getState();
iblockstate = Blocks.white_clay.getState();
iblockstate3 = this.fillerBlock;
}
@ -166,16 +167,16 @@ public class BiomeMesa extends GenBiome
{
chunkPrimerIn.set(k1, i1, j1, iblockstate3);
if (iblockstate3.getBlock() == Blocks.stained_hardened_clay)
if (iblockstate3.getBlock() instanceof BlockColoredClay)
{
chunkPrimerIn.set(k1, i1, j1, iblockstate3.getBlock().getState().withProperty(BlockColored.COLOR, DyeColor.ORANGE));
chunkPrimerIn.set(k1, i1, j1, Blocks.orange_clay.getState());
}
}
else if (this.soil && i1 > 86 + k * 2)
{
if (flag)
{
chunkPrimerIn.set(k1, i1, j1, Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT));
chunkPrimerIn.set(k1, i1, j1, Blocks.coarse_dirt.getState());
}
else
{
@ -204,7 +205,7 @@ public class BiomeMesa extends GenBiome
}
else
{
iblockstate4 = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.ORANGE);
iblockstate4 = Blocks.orange_clay.getState();
}
chunkPrimerIn.set(k1, i1, j1, iblockstate4);
@ -216,7 +217,7 @@ public class BiomeMesa extends GenBiome
if (flag1)
{
chunkPrimerIn.set(k1, i1, j1, Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.ORANGE));
chunkPrimerIn.set(k1, i1, j1, Blocks.orange_clay.getState());
}
else
{
@ -242,7 +243,7 @@ public class BiomeMesa extends GenBiome
if (l1 < 64)
{
this.layers[l1] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.ORANGE);
this.layers[l1] = Blocks.orange_clay.getState();
}
}
@ -255,7 +256,7 @@ public class BiomeMesa extends GenBiome
for (int l = 0; k + l < 64 && l < j; ++l)
{
this.layers[k + l] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.YELLOW);
this.layers[k + l] = Blocks.yellow_clay.getState();
}
}
@ -268,7 +269,7 @@ public class BiomeMesa extends GenBiome
for (int i1 = 0; l3 + i1 < 64 && i1 < i3; ++i1)
{
this.layers[l3 + i1] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.BROWN);
this.layers[l3 + i1] = Blocks.brown_clay.getState();
}
}
@ -281,7 +282,7 @@ public class BiomeMesa extends GenBiome
for (int j1 = 0; k4 + j1 < 64 && j1 < i4; ++j1)
{
this.layers[k4 + j1] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.RED);
this.layers[k4 + j1] = Blocks.red_clay.getState();
}
}
@ -295,16 +296,16 @@ public class BiomeMesa extends GenBiome
for (int k1 = 0; j4 + k1 < 64 && k1 < i5; ++k1)
{
this.layers[j4 + k1] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.WHITE);
this.layers[j4 + k1] = Blocks.white_clay.getState();
if (j4 + k1 > 1 && random.chance())
{
this.layers[j4 + k1 - 1] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.SILVER);
this.layers[j4 + k1 - 1] = Blocks.silver_clay.getState();
}
if (j4 + k1 < 63 && random.chance())
{
this.layers[j4 + k1 + 1] = Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.SILVER);
this.layers[j4 + k1 + 1] = Blocks.silver_clay.getState();
}
}
}

View file

@ -4,6 +4,7 @@ import common.biome.Biome;
import common.block.foliage.BlockDoublePlant;
import common.block.foliage.BlockFlower;
import common.entity.animal.EntityHorse;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import server.world.WorldServer;
@ -81,7 +82,7 @@ public class BiomePlains extends GenBiome
{
this.flowersPerChunk = 4;
this.grassPerChunk = 10;
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
DOUBLE_PLANT_GEN.setPlantType(Blocks.large_tallgrass);
for (int i = 0; i < 7; ++i)
{
@ -95,7 +96,7 @@ public class BiomePlains extends GenBiome
// int n = rand.range(0, 2);
if (rand.chance())
{
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);
DOUBLE_PLANT_GEN.setPlantType(Blocks.sunflower);
// for (int i1 = 0; i1 < 10; ++i1)
// {

View file

@ -40,7 +40,7 @@ public class BiomeSavanna extends GenBiome
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
DOUBLE_PLANT_GEN.setPlantType(Blocks.large_tallgrass);
for (int i = 0; i < 7; ++i)
{
@ -75,7 +75,7 @@ public class BiomeSavanna extends GenBiome
}
else if (noiseVal > -0.5D)
{
this.topBlock = Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
this.topBlock = Blocks.coarse_dirt.getState();
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);

View file

@ -1,7 +1,6 @@
package server.biome;
import common.biome.Biome;
import common.block.natural.BlockDirt;
import common.init.Blocks;
import common.rng.Random;
import common.rng.WeightedList;
@ -15,7 +14,7 @@ public class BiomeSpace extends GenBiome
protected FeatureGenerator asteroidGen1 = new WorldGenAsteroid(Blocks.stone.getState(),
Blocks.rock.getState());
protected FeatureGenerator asteroidGen2 = new WorldGenAsteroid(Blocks.dirt.getState(),
Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT));
Blocks.coarse_dirt.getState());
public BiomeSpace()
{

View file

@ -57,7 +57,7 @@ public class BiomeTaiga extends GenBiome
*/
public FeatureGenerator getRandomWorldGenForGrass(Random rand)
{
return rand.rarity(5) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
return rand.rarity(5) ? new WorldGenTallGrass(Blocks.fern) : new WorldGenTallGrass(Blocks.tallgrass);
}
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
@ -75,7 +75,7 @@ public class BiomeTaiga extends GenBiome
}
}
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.FERN);
DOUBLE_PLANT_GEN.setPlantType(Blocks.large_fern);
for (int i1 = 0; i1 < 7; ++i1)
{
@ -97,11 +97,11 @@ public class BiomeTaiga extends GenBiome
if (noiseVal > 1.75D)
{
this.topBlock = Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
this.topBlock = Blocks.coarse_dirt.getState();
}
else if (noiseVal > -0.95D)
{
this.topBlock = Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
this.topBlock = Blocks.podzol.getState();
}
}

View file

@ -3,8 +3,8 @@ package server.biome;
import common.biome.Biome;
import common.biome.IBiome;
import common.block.Block;
import common.block.BlockColored;
import common.block.Material;
import common.block.artificial.BlockWool;
import common.block.foliage.BlockFlower;
import common.block.foliage.BlockSapling;
import common.block.foliage.BlockTallGrass;
@ -133,7 +133,7 @@ public abstract class GenBiome implements IBiome {
private final FeatureGenerator clayGen = new WorldGenClay(4);
private final FeatureGenerator sandGen = new WorldGenSand(Blocks.sand, 7);
private final FeatureGenerator gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6);
private final WorldGenFlowers yellowFlowerGen = new WorldGenFlowers(Blocks.flower, BlockFlower.EnumFlowerType.DANDELION);
private final WorldGenFlowers yellowFlowerGen = new WorldGenFlowers(Blocks.dandelion);
private final FeatureGenerator mushroomBrownGen = new WorldGenMushroom(Blocks.brown_mushroom);
private final FeatureGenerator mushroomRedGen = new WorldGenMushroom(Blocks.red_mushroom);
private final FeatureGenerator bigMushroomGen = new WorldGenBigMushroom();
@ -259,7 +259,7 @@ public abstract class GenBiome implements IBiome {
public FeatureGenerator getRandomWorldGenForGrass(Random rand)
{
return new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
return new WorldGenTallGrass(Blocks.tallgrass);
}
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)
@ -366,9 +366,8 @@ public abstract class GenBiome implements IBiome {
int k17 = rand.zrange(j14);
BlockPos blockpos1 = pos.add(i7, k17, l10);
BlockFlower.EnumFlowerType blockflower$enumflowertype = this.pickRandomFlower(rand, blockpos1);
BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock();
this.yellowFlowerGen.setGeneratedBlock(blockflower, blockflower$enumflowertype);
this.yellowFlowerGen.setGeneratedBlock(BlockFlower.getByType(blockflower$enumflowertype));
this.yellowFlowerGen.generate(world, rand, blockpos1);
}
}
@ -620,7 +619,12 @@ public abstract class GenBiome implements IBiome {
if (j == 0 && iblockstate1.getBlock() == Blocks.sand)
{
j = rand.zrange(4) + Math.max(0, j1 - 63);
iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.ORANGE) : Blocks.sandstone.getState(); //TODO: check!
iblockstate1 = Blocks.sandstone.getState(); //TODO: check!
}
else if (j == 0 && iblockstate1.getBlock() == Blocks.red_sand)
{
j = rand.zrange(4) + Math.max(0, j1 - 63);
iblockstate1 = Blocks.orange_clay.getState(); //TODO: check!
}
}
}
@ -815,8 +819,8 @@ public abstract class GenBiome implements IBiome {
if (rand.chance(8))
{
BlockFlower.EnumFlowerType blockflower$enumflowertype = BIOMES[worldIn.getBiomeGenForCoords(blockpos1).id].pickRandomFlower(rand, blockpos1);
BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock();
State iblockstate = blockflower.getState().withProperty(blockflower.getTypeProperty(), blockflower$enumflowertype);
BlockFlower blockflower = BlockFlower.getByType(blockflower$enumflowertype);
State iblockstate = blockflower.getState();
if (blockflower.canBlockStay(worldIn, blockpos1, iblockstate))
{
@ -825,7 +829,7 @@ public abstract class GenBiome implements IBiome {
}
else
{
State iblockstate1 = Blocks.tallgrass.getState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS);
State iblockstate1 = Blocks.tallgrass.getState();
if (Blocks.tallgrass.canBlockStay(worldIn, blockpos1, iblockstate1))
{

View file

@ -19,7 +19,6 @@ import java.util.zip.InflaterInputStream;
import common.biome.Biome;
import common.block.Block;
import common.block.BlockColored;
import common.block.artificial.BlockCarpet;
import common.block.artificial.BlockFlowerPot;
import common.block.artificial.BlockQuartz;
@ -28,6 +27,7 @@ import common.block.artificial.BlockStainedGlass;
import common.block.artificial.BlockStainedGlassPane;
import common.block.artificial.BlockStoneBrick;
import common.block.artificial.BlockWall;
import common.block.artificial.BlockWool;
import common.block.foliage.BlockCactus;
import common.block.foliage.BlockFlower;
import common.block.foliage.BlockLeaves;
@ -483,7 +483,7 @@ public abstract class Converter {
.withProperty(BlockPistonHead.TYPE, BlockPistonHead.EnumPistonType.STICKY), 34, 14);
mapBlock(new BlockFunction() {
public State getState(int id, int data) {
return Blocks.wool.getState().withProperty(BlockColored.COLOR, DyeColor.byMetadata(data));
return Blocks.wool.getState().withProperty(BlockWool.COLOR, DyeColor.byMetadata(data));
}
}, 35);
mapBlock(Blocks.stone, 36); // mapBlockData(Blocks.piston_extension, 36);
@ -738,7 +738,7 @@ public abstract class Converter {
mapBlockData(Blocks.dropper, 158);
mapBlock(new BlockFunction() {
public State getState(int id, int data) {
return Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.byMetadata(data));
return Blocks.stained_hardened_clay.getState().withProperty(BlockWool.COLOR, DyeColor.byMetadata(data));
}
}, 159);
mapBlock(new BlockFunction() {
@ -843,19 +843,19 @@ public abstract class Converter {
mapBlock(Blocks.glass, 217);
mapBlockData(Blocks.dropper, 218);
for(int id = 219; id <= 234; id++) {
mapBlock(Blocks.wool.getState().withProperty(BlockColored.COLOR, DyeColor.byMetadata(id - 219)), id);
mapBlock(Blocks.wool.getState().withProperty(BlockWool.COLOR, DyeColor.byMetadata(id - 219)), id);
}
for(int id = 235; id <= 250; id++) {
mapBlock(Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.byMetadata(id - 235)), id);
mapBlock(Blocks.stained_hardened_clay.getState().withProperty(BlockWool.COLOR, DyeColor.byMetadata(id - 235)), id);
}
mapBlock(new BlockFunction() {
public State getState(int id, int data) {
return Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.byMetadata(data));
return Blocks.stained_hardened_clay.getState().withProperty(BlockWool.COLOR, DyeColor.byMetadata(data));
}
}, 251);
mapBlock(new BlockFunction() {
public State getState(int id, int data) {
return Blocks.stained_hardened_clay.getState().withProperty(BlockColored.COLOR, DyeColor.byMetadata(data));
return Blocks.stained_hardened_clay.getState().withProperty(BlockWool.COLOR, DyeColor.byMetadata(data));
}
}, 252);
mapBlock(Blocks.obsidian, 255);

View file

@ -1,7 +1,8 @@
package server.worldgen.caves;
import common.block.Block;
import common.block.BlockColored;
import common.block.artificial.BlockWool;
import common.block.natural.BlockColoredClay;
import common.block.natural.BlockSand;
import common.color.DyeColor;
import common.init.Blocks;
@ -216,7 +217,7 @@ public class MapGenCaves extends MapGenBase
}
else if (iblockstate2.getBlock() == Blocks.red_sand)
{
p_180702_5_.set(j3, j2 + 1, i2, Blocks.orange_stained_hardened_clay.getState()); //TODO: check!
p_180702_5_.set(j3, j2 + 1, i2, Blocks.orange_clay.getState()); //TODO: check!
}
if (flag1 && p_180702_5_.get(j3, j2 - 1, i2).getBlock() == this.top)
@ -244,7 +245,7 @@ public class MapGenCaves extends MapGenBase
protected boolean func_175793_a(State p_175793_1_, State p_175793_2_)
{
return p_175793_1_.getBlock() == this.replace ? true : (p_175793_1_.getBlock() == this.top ? true : (p_175793_1_.getBlock() == this.surface ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : /* (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : */ (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == this.alt) && !p_175793_2_.getBlock().getMaterial().isColdLiquid()))))))); // );
return p_175793_1_.getBlock() == this.replace ? true : (p_175793_1_.getBlock() == this.top ? true : (p_175793_1_.getBlock() == this.surface ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() instanceof BlockColoredClay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : /* (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : */ (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == this.alt) && !p_175793_2_.getBlock().getMaterial().isColdLiquid()))))))); // );
}
/**

View file

@ -82,8 +82,6 @@ public class StructureScattered
int l2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 2);
int i3 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 0);
int l = this.getMetadataWithOffset(Blocks.sandstone_stairs, 1);
int i1 = ~DyeColor.ORANGE.getDyeDamage() & 15;
int j1 = ~DyeColor.BLUE.getDyeDamage() & 15;
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 9, 4, Blocks.sandstone.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 10, 1, 3, 10, 3, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 10, 0, structureBoundingBoxIn);
@ -154,40 +152,40 @@ public class StructureScattered
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), this.scatteredFeatureSizeX - 5, 2, k1, structureBoundingBoxIn);
}
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 9, 0, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 11, 0, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 8, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 12, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 7, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 13, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 9, 0, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 11, 0, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 13, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(j1), 10, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 0, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 0, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 8, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 12, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 7, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 13, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 0, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 0, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 13, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.blue_clay.getState(), 10, 0, 10, structureBoundingBoxIn);
for (int j3 = 0; j3 <= this.scatteredFeatureSizeX - 1; j3 += this.scatteredFeatureSizeX - 1)
{
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 2, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 2, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 3, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 4, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 4, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), j3, 4, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 4, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 4, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 5, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 5, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 5, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 5, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 6, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 6, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), j3, 6, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 6, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 7, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 7, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 7, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 6, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 3, structureBoundingBoxIn);
@ -196,23 +194,23 @@ public class StructureScattered
for (int k3 = 2; k3 <= this.scatteredFeatureSizeX - 3; k3 += this.scatteredFeatureSizeX - 3 - 2)
{
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 - 1, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), k3, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 + 1, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 - 1, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), k3, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 + 1, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 - 1, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 + 1, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 8, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3, 8, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 8, 0, structureBoundingBoxIn);
@ -221,9 +219,9 @@ public class StructureScattered
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 4, 0, 12, 6, 0, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false);
this.setBlockState(worldIn, Blocks.air.getState(), 8, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 12, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 9, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 10, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 11, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 5, 0, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -14, 8, 12, -11, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -10, 8, 12, -10, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -9, 8, 12, -9, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false);