block cleanup #4
This commit is contained in:
parent
a836d7a2a5
commit
84611eef7f
21 changed files with 139 additions and 108 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue