Compare commits

..

No commits in common. "bc74b3a29d24a9ddbbb8483842a86cbf9de4bc3a" and "9930d1bb6d0fce01e921ecdb42738c73ebb21ebc" have entirely different histories.

6 changed files with 355 additions and 395 deletions

View file

@ -1929,7 +1929,8 @@ public class Client implements IThreadListener {
} }
StringBuilder str = new StringBuilder( StringBuilder str = new StringBuilder(
"Schaue auf: " + BlockRegistry.getNameFromBlock(block.getBlock()) + "\n" + "Schaue auf: " + BlockRegistry.getNameFromBlock(block.getBlock()) + " [" + BlockRegistry.getIdFromBlock(block.getBlock()) +
":" + block.getBlock().getMetaFromState(block) + "]" + "\n" +
String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ()) String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ())
); );
for(Entry<IProperty, Comparable> entry : block.getProperties().entrySet()) { for(Entry<IProperty, Comparable> entry : block.getProperties().entrySet()) {

View file

@ -136,8 +136,6 @@ public abstract class BlockRegistry {
private static final String AIR_ID = "air"; private static final String AIR_ID = "air";
public static final RegistryNamespacedDefaultedByKey<String, Block> REGISTRY = new RegistryNamespacedDefaultedByKey(AIR_ID); public static final RegistryNamespacedDefaultedByKey<String, Block> REGISTRY = new RegistryNamespacedDefaultedByKey(AIR_ID);
public static final ObjectIntIdentityMap<State> STATEMAP = new ObjectIntIdentityMap(); public static final ObjectIntIdentityMap<State> STATEMAP = new ObjectIntIdentityMap();
private static int nextBlockId = 1;
public static int getIdFromBlock(Block block) { public static int getIdFromBlock(Block block) {
return REGISTRY.getIDForObject(block); return REGISTRY.getIDForObject(block);
@ -213,238 +211,280 @@ public abstract class BlockRegistry {
} }
} }
private static void registerBlock(String name, Block block) { private static void registerBlock(int id, String name, Block block) {
BlockRegistry.REGISTRY.register(nextBlockId++, name, block); BlockRegistry.REGISTRY.register(id, name, block);
} }
private static void registerFluid(String name, String display, boolean infinite, LiquidType type, boolean opaque, int light, int rate, private static void registerFluid(int idd, int ids, String name, String display, boolean infinite, LiquidType type, boolean opaque,
float radiation, Object still, Object flowing) { int light, int rate, float radiation, Object still, Object flowing) {
BlockDynamicLiquid dy = (BlockDynamicLiquid)(new BlockDynamicLiquid(type.material, infinite, opaque, rate)).setHardness(100.0F) BlockDynamicLiquid dy = (BlockDynamicLiquid)(new BlockDynamicLiquid(type.material, infinite, opaque, rate)).setHardness(100.0F)
.setLightOpacity(opaque ? 0 : 3).setLightLevel((float)light / 15.0f).setDisplay(display) .setLightOpacity(opaque ? 0 : 3).setLightLevel((float)light / 15.0f).setDisplay(display)
.setRadiation(radiation); .setRadiation(radiation);
registerBlock("flowing_" + name, dy); registerBlock(idd, "flowing_" + name, dy);
BlockStaticLiquid st = (BlockStaticLiquid)(new BlockStaticLiquid(type.material, opaque, rate)).setHardness(100.0F) BlockStaticLiquid st = (BlockStaticLiquid)(new BlockStaticLiquid(type.material, opaque, rate)).setHardness(100.0F)
.setLightOpacity(opaque ? 0 : 3).setLightLevel((float)light / 15.0f).setDisplay(display) .setLightOpacity(opaque ? 0 : 3).setLightLevel((float)light / 15.0f).setDisplay(display)
.setRadiation(radiation); .setRadiation(radiation);
registerBlock(name, st); registerBlock(ids, name, st);
FluidRegistry.registerFluid(st, dy, still, flowing); FluidRegistry.registerFluid(st, dy, still, flowing);
} }
private static void registerBlocks() { private static void registerBlocks() {
Block stone = (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Stein"); Block stone = (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Stein");
registerBlock("stone", stone); registerBlock(1, "stone", stone);
registerBlock("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setStepSound(SoundType.STONE) registerBlock(2, "bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setStepSound(SoundType.STONE)
.setDisplay("Grundgestein").setTab(CheatTab.NATURE).setMiningLevel(6)); .setDisplay("Grundgestein").setTab(CheatTab.NATURE).setMiningLevel(6));
registerBlock("rock", (new BlockRock()).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Felsen")); registerBlock(3, "rock",
registerBlock("hellrock", (new BlockHellRock()).setHardness(0.4F).setStepSound(SoundType.STONE).setDisplay("Höllenstein")); (new BlockRock()).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Felsen"));
registerBlock("cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F) registerBlock(4, "hellrock", (new BlockHellRock()).setHardness(0.4F).setStepSound(SoundType.STONE).setDisplay("Höllenstein"));
registerBlock(5, "cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F)
.setStepSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.NATURE)); .setStepSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.NATURE));
registerBlock("moon_rock", (new Block(Material.SOLID)).setHardness(2.5F).setResistance(10.0F) registerBlock(6, "moon_rock", (new Block(Material.SOLID)).setHardness(2.5F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Mondgestein").setTab(CheatTab.NATURE)); .setStepSound(SoundType.STONE).setDisplay("Mondgestein").setTab(CheatTab.NATURE));
Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bruchstein").setTab(CheatTab.NATURE); .setDisplay("Bruchstein").setTab(CheatTab.NATURE);
registerBlock("cobblestone", cobblestone); registerBlock(7, "cobblestone", cobblestone);
registerBlock("mossy_cobblestone", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) registerBlock(8, "mossy_cobblestone", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bemooster Bruchstein").setTab(CheatTab.NATURE)); .setDisplay("Bemooster Bruchstein").setTab(CheatTab.NATURE));
Block sandstone = (new BlockSandStone()).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein"); Block sandstone = (new BlockSandStone()).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein");
registerBlock("sandstone", sandstone); registerBlock(9, "sandstone", sandstone);
registerBlock("obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(SoundType.STONE) registerBlock(10, "obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(SoundType.STONE)
.setDisplay("Obsidian").setMiningLevel(3)); .setDisplay("Obsidian").setMiningLevel(3));
registerBlock("clay", (new BlockClay()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable()); registerBlock(11, "clay",
registerBlock("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(SoundType.STONE).setDisplay("Gebrannter Ton")); (new BlockClay()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable());
registerBlock("stained_hardened_clay", (new BlockColored(Material.SOLID)).setHardness(1.25F).setResistance(7.0F) registerBlock(12, "hardened_clay",
(new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(SoundType.STONE).setDisplay("Gebrannter Ton"));
registerBlock(13, "stained_hardened_clay", (new BlockColored(Material.SOLID)).setHardness(1.25F).setResistance(7.0F)
.setStepSound(SoundType.STONE).setDisplay("gefärbter Ton").setTab(CheatTab.NATURE)); .setStepSound(SoundType.STONE).setDisplay("gefärbter Ton").setTab(CheatTab.NATURE));
registerBlock("coal_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) registerBlock(14, "coal_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Kohleblock").setTab(CheatTab.NATURE)); .setStepSound(SoundType.STONE).setDisplay("Kohleblock").setTab(CheatTab.NATURE));
registerBlock("sand", (new BlockSand()).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable()); registerBlock(15, "sand", (new BlockSand()).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable());
registerBlock("gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable()); registerBlock(16, "gravel",
registerBlock("ash", (new Block(Material.LOOSE)).setHardness(0.2F).setStepSound(SoundType.SAND).setDisplay("Asche") (new BlockGravel()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable());
.setTab(CheatTab.NATURE).setShovelHarvestable()); registerBlock(17, "ash",
registerBlock("snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(SoundType.SNOW).setDisplay("Schnee").setLightOpacity(0) (new Block(Material.LOOSE)).setHardness(0.2F).setStepSound(SoundType.SAND).setDisplay("Asche")
.setTab(CheatTab.NATURE).setShovelHarvestable());
registerBlock(18, "snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(SoundType.SNOW).setDisplay("Schnee").setLightOpacity(0)
.setShovelHarvestable()); .setShovelHarvestable());
registerBlock("snow", (new BlockSnowBlock()).setHardness(0.2F).setStepSound(SoundType.SNOW).setDisplay("Schnee").setShovelHarvestable()); registerBlock(19, "snow",
registerBlock("ice", (new BlockIce()).setHardness(0.5F).setLightOpacity(3).setStepSound(SoundType.GLASS).setDisplay("Eis").setMiningLevel(0)); (new BlockSnowBlock()).setHardness(0.2F).setStepSound(SoundType.SNOW).setDisplay("Schnee").setShovelHarvestable());
registerBlock("packed_ice", (new BlockPackedIce()).setHardness(0.5F).setStepSound(SoundType.GLASS).setDisplay("Packeis").setMiningLevel(0)); registerBlock(20, "ice",
registerBlock("soul_sand", (new BlockSoulSand()).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Seelensand").setShovelHarvestable()); (new BlockIce()).setHardness(0.5F).setLightOpacity(3).setStepSound(SoundType.GLASS).setDisplay("Eis").setMiningLevel(0));
registerBlock("glowstone", (new BlockGlowstone(Material.TRANSLUCENT)).setHardness(0.3F).setStepSound(SoundType.GLASS).setLightLevel(1.0F) registerBlock(21, "packed_ice",
(new BlockPackedIce()).setHardness(0.5F).setStepSound(SoundType.GLASS).setDisplay("Packeis").setMiningLevel(0));
registerBlock(22, "soul_sand",
(new BlockSoulSand()).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Seelensand").setShovelHarvestable());
registerBlock(23, "glowstone", (new BlockGlowstone(Material.TRANSLUCENT)).setHardness(0.3F).setStepSound(SoundType.GLASS).setLightLevel(1.0F)
.setDisplay("Glowstone")); .setDisplay("Glowstone"));
registerBlock("blackened_stone", (new BlockBlackenedStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarzstein")); registerBlock(24, "blackened_stone", (new BlockBlackenedStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarzstein"));
registerBlock("blackened_cobble", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) registerBlock(25, "blackened_cobble", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Schwarzbruchstein").setTab(CheatTab.NATURE)); .setDisplay("Schwarzbruchstein").setTab(CheatTab.NATURE));
registerFluid("water", "Wasser", true, LiquidType.WATER, false, 0, 5, 0.0f, "water", "waterflow"); registerFluid(32, 33, "water", "Wasser", true, LiquidType.WATER, false, 0, 5, 0.0f, "water", "waterflow");
registerFluid("lava", "Lava", false, LiquidType.LAVA, true, 15, -30, 0.0f, 2, 3); registerFluid(34, 35, "lava", "Lava", false, LiquidType.LAVA, true, 15, -30, 0.0f, 2, 3);
registerFluid("magma", "Magma", false, LiquidType.HOT, true, 15, 40, 0.0f, "lava", "lavaflow"); registerFluid(36, 37, "magma", "Magma", false, LiquidType.HOT, true, 15, 40, 0.0f, "lava", "lavaflow");
registerFluid("mercury", "Quecksilber", false, LiquidType.COLD, true, 0, 40, 0.0f, 8, 4); registerFluid(38, 39, "mercury", "Quecksilber", false, LiquidType.COLD, true, 0, 40, 0.0f, 8, 4);
registerFluid("hydrogen", "Wasserstoff", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4); registerFluid(40, 41, "hydrogen", "Wasserstoff", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4);
registerFluid("acid", "Säure", false, LiquidType.HOT, false, 0, 5, 0.0f, 1, 1); registerFluid(42, 43, "acid", "Säure", false, LiquidType.HOT, false, 0, 5, 0.0f, 1, 1);
registerFluid("slime", "Schleim", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4); registerFluid(44, 45, "slime", "Schleim", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4);
registerFluid("goo", "Klebrige Masse", false, LiquidType.COLD, true, 0, 60, 0.0f, 10, 5); registerFluid(46, 47, "goo", "Klebrige Masse", false, LiquidType.COLD, true, 0, 60, 0.0f, 10, 5);
registerFluid("nukage", "Radioaktive Masse", false, LiquidType.COLD, true, 10, 10, 4.0f, 2, 2); registerFluid(48, 49, "nukage", "Radioaktive Masse", false, LiquidType.COLD, true, 10, 10, 4.0f, 2, 2);
registerFluid("blood", "Blut", false, LiquidType.COLD, false, 0, 10, 0.0f, 2, 1); registerFluid(50, 51, "blood", "Blut", false, LiquidType.COLD, false, 0, 10, 0.0f, 2, 1);
registerFluid("springwater", "Klares Wasser", true, LiquidType.COLD, false, 0, 5, 0.0f, 1, 1); registerFluid(52, 53, "springwater", "Klares Wasser", true, LiquidType.COLD, false, 0, 5, 0.0f, 1, 1);
registerBlock("coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE).setDisplay("Steinkohle")); registerBlock(60, "coal_ore",
registerBlock("lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE).setDisplay("Steinkohle"));
registerBlock(61, "lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay("Lapislazulierz").setMiningLevel(1)); .setDisplay("Lapislazulierz").setMiningLevel(1));
registerBlock("emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) registerBlock(62, "emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay("Smaragderz").setMiningLevel(2)); .setDisplay("Smaragderz").setMiningLevel(2));
registerBlock("quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) registerBlock(63, "quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay("Quarzerz")); .setDisplay("Quarzerz"));
registerBlock("black_quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) registerBlock(64, "black_quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay("Schwarzes Quarzerz")); .setDisplay("Schwarzes Quarzerz"));
registerBlock("redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) registerBlock(68, "redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay("Redstone-Erz").setTab(CheatTab.GEMS).setMiningLevel(2)); .setDisplay("Redstone-Erz").setTab(CheatTab.GEMS).setMiningLevel(2));
registerBlock("lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F) registerBlock(69, "lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F)
.setStepSound(SoundType.STONE).setDisplay("Redstone-Erz").setMiningLevel(2)); .setStepSound(SoundType.STONE).setDisplay("Redstone-Erz").setMiningLevel(2));
int bid = 70;
for(MetalType metal : MetalType.values()) { for(MetalType metal : MetalType.values()) {
// String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1); // String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1);
registerBlock(metal.name + "_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) registerBlock(bid++, metal.name + "_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay(metal.display + "erz").setMiningLevel(1).setLightLevel(metal.radioactivity > 0.0F ? 0.25F : 0.0F) .setDisplay(metal.display + "erz").setMiningLevel(1).setLightLevel(metal.radioactivity > 0.0F ? 0.25F : 0.0F)
.setRadiation(metal.radioactivity * 0.5f)); .setRadiation(metal.radioactivity * 0.5f));
} }
bid = 110;
for(OreType ore : OreType.values()) { for(OreType ore : OreType.values()) {
// String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1); // String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1);
registerBlock(ore.name + "_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) registerBlock(bid++, ore.name + "_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay(ore.display + "erz").setMiningLevel(ore.material.getHarvestLevel() - 1)); .setDisplay(ore.display + "erz").setMiningLevel(ore.material.getHarvestLevel() - 1));
} }
registerBlock("dirt", (new BlockDirt()).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Erde").setShovelHarvestable()); registerBlock(128, "dirt",
registerBlock("grass", (new BlockGrass()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShovelHarvestable()); (new BlockDirt()).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Erde").setShovelHarvestable());
registerBlock("mycelium", (new BlockMycelium()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Myzel").setShovelHarvestable()); registerBlock(129, "grass",
registerBlock("tian", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE) (new BlockGrass()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShovelHarvestable());
registerBlock(130, "mycelium",
(new BlockMycelium()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Myzel").setShovelHarvestable());
registerBlock(131, "tian", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE)
.setDisplay("Tian").setTab(CheatTab.NATURE)); .setDisplay("Tian").setTab(CheatTab.NATURE));
registerBlock("tian_soil", (new BlockTianSoil()).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE) registerBlock(132, "tian_soil", (new BlockTianSoil()).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE)
.setDisplay("Tianerde").setTab(CheatTab.NATURE)); .setDisplay("Tianerde").setTab(CheatTab.NATURE));
registerBlock("moon_cheese", (new BlockTreasure(Material.SOFT)).setHardness(1.5F).setResistance(5.0F) registerBlock(133, "moon_cheese", (new BlockTreasure(Material.SOFT)).setHardness(1.5F).setResistance(5.0F)
.setStepSound(SoundType.CLOTH).setDisplay("Mondkäse").setTab(CheatTab.NATURE)); .setStepSound(SoundType.CLOTH).setDisplay("Mondkäse").setTab(CheatTab.NATURE));
registerBlock("slime_block", (new BlockSlime()).setDisplay("Schleimblock").setStepSound(SoundType.SLIME)); registerBlock(134, "slime_block", (new BlockSlime()).setDisplay("Schleimblock").setStepSound(SoundType.SLIME));
registerBlock("blackened_dirt", (new BlockBlackenedDirt()).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Schwarzerde").setShovelHarvestable()); registerBlock(135, "blackened_dirt",
registerBlock("blackened_soil", (new BlockBlackenedSoil()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwarzgrund").setShovelHarvestable()); (new BlockBlackenedDirt()).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Schwarzerde").setShovelHarvestable());
registerBlock(136, "blackened_soil",
(new BlockBlackenedSoil()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwarzgrund").setShovelHarvestable());
registerBlock("tallgrass", (new BlockTallGrass()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShearsEfficiency(0)); registerBlock(140, "tallgrass",
registerBlock("deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Toter Busch")); (new BlockTallGrass()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShearsEfficiency(0));
registerBlock("flower", (new BlockBaseFlower()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Blume")); registerBlock(141, "deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Toter Busch"));
registerBlock("double_plant", new BlockDoublePlant().setDisplay("Pflanze")); registerBlock(142, "flower", (new BlockBaseFlower()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Blume"));
registerBlock("cactus", (new BlockCactus()).setHardness(0.4F).setStepSound(SoundType.CLOTH).setDisplay("Kaktus")); registerBlock(143, "double_plant", new BlockDoublePlant().setDisplay("Pflanze"));
registerBlock("reeds", (new BlockReed()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Zuckerrohr")); registerBlock(144, "cactus", (new BlockCactus()).setHardness(0.4F).setStepSound(SoundType.CLOTH).setDisplay("Kaktus"));
registerBlock("vine", (new BlockVine()).setHardness(0.2F).setStepSound(SoundType.GRASS).setDisplay("Ranken").setShearsEfficiency(0)); registerBlock(145, "reeds", (new BlockReed()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Zuckerrohr"));
registerBlock("waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Seerosenblatt")); registerBlock(146, "vine",
registerBlock("cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay("Kakao")); (new BlockVine()).setHardness(0.2F).setStepSound(SoundType.GRASS).setDisplay("Ranken").setShearsEfficiency(0));
registerBlock(147, "waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Seerosenblatt"));
registerBlock(148, "cocoa",
(new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay("Kakao"));
Block brownMushroom = (new BlockMushroom()).setHardness(0.0F).setStepSound(SoundType.GRASS).setLightLevel(0.125F) Block brownMushroom = (new BlockMushroom()).setHardness(0.0F).setStepSound(SoundType.GRASS).setLightLevel(0.125F)
.setDisplay("Pilz"); .setDisplay("Pilz");
registerBlock("brown_mushroom", brownMushroom); registerBlock(160, "brown_mushroom", brownMushroom);
registerBlock("brown_mushroom_block", (new BlockHugeMushroom(Material.WOOD, brownMushroom)).setHardness(0.2F) registerBlock(161, "brown_mushroom_block", (new BlockHugeMushroom(Material.WOOD, brownMushroom)).setHardness(0.2F)
.setStepSound(SoundType.WOOD).setDisplay("Pilzblock").setTab(CheatTab.PLANTS)); .setStepSound(SoundType.WOOD).setDisplay("Pilzblock").setTab(CheatTab.PLANTS));
Block redMushrooom = (new BlockMushroom()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Pilz"); Block redMushrooom = (new BlockMushroom()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Pilz");
registerBlock("red_mushroom", redMushrooom); registerBlock(162, "red_mushroom", redMushrooom);
registerBlock("red_mushroom_block", (new BlockHugeMushroom(Material.WOOD, redMushrooom)).setHardness(0.2F) registerBlock(163, "red_mushroom_block", (new BlockHugeMushroom(Material.WOOD, redMushrooom)).setHardness(0.2F)
.setStepSound(SoundType.WOOD).setDisplay("Pilzblock").setTab(CheatTab.PLANTS)); .setStepSound(SoundType.WOOD).setDisplay("Pilzblock").setTab(CheatTab.PLANTS));
registerBlock("blue_mushroom", (new BlockBlueShroom()).setHardness(0.0F).setStepSound(SoundType.GRASS).setLightLevel(0.5F) registerBlock(164, "blue_mushroom", (new BlockBlueShroom()).setHardness(0.0F).setStepSound(SoundType.GRASS).setLightLevel(0.5F)
.setDisplay("Tianpilz")); .setDisplay("Tianpilz"));
Block pumpkin = (new BlockPumpkin()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbis"); Block pumpkin = (new BlockPumpkin()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbis");
registerBlock("pumpkin", pumpkin); registerBlock(170, "pumpkin", pumpkin);
registerBlock("pumpkin_stem", (new BlockStem(pumpkin)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbisstamm")); registerBlock(172, "pumpkin_stem", (new BlockStem(pumpkin)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbisstamm"));
Block melon = (new BlockMelon()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Melone"); Block melon = (new BlockMelon()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Melone");
registerBlock("melon_block", melon); registerBlock(173, "melon_block", melon);
registerBlock("melon_stem", (new BlockStem(melon)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Melonenstamm")); registerBlock(174, "melon_stem", (new BlockStem(melon)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Melonenstamm"));
registerBlock("dry_leaves", (new BlockDryLeaves()).setDisplay("Vertrocknetes Laub")); registerBlock(179, "dry_leaves", (new BlockDryLeaves()).setDisplay("Vertrocknetes Laub"));
bid = 180;
for(WoodType wood : WoodType.values()) { for(WoodType wood : WoodType.values()) {
registerBlock(wood.getName() + "_log", (new BlockLog()).setDisplay(wood.getDisplay() + "holz")); registerBlock(bid++, wood.getName() + "_log", (new BlockLog()).setDisplay(wood.getDisplay() + "holz"));
registerBlock(wood.getName() + "_leaves", (new BlockLeaves(wood)).setDisplay(wood.getDisplay() + "laub")); registerBlock(bid++, wood.getName() + "_leaves", (new BlockLeaves(wood)).setDisplay(wood.getDisplay() + "laub"));
registerBlock(wood.getName() + "_sapling", (new BlockSapling(wood)).setHardness(0.0F).setStepSound(SoundType.GRASS) registerBlock(bid++, wood.getName() + "_sapling", (new BlockSapling(wood)).setHardness(0.0F).setStepSound(SoundType.GRASS)
.setDisplay(wood.getDisplay() + "setzling")); .setDisplay(wood.getDisplay() + "setzling"));
} }
registerBlock("soul_fire", (new BlockSoulFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(SoundType.CLOTH).setDisplay("Feuer der Seelen")); registerBlock(252, "soul_fire",
registerBlock("black_fire", (new BlockTintedFire(0x202020)).setHardness(0.0F).setLightLevel(1.0F).setStepSound(SoundType.CLOTH).setDisplay("Dunkles Feuer")); (new BlockSoulFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(SoundType.CLOTH).setDisplay("Feuer der Seelen"));
registerBlock("web", (new BlockWeb()).setLightOpacity(1).setHardness(4.0F).setDisplay("Spinnennetz")); registerBlock(253, "black_fire",
registerBlock("fire", (new BlockFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(SoundType.CLOTH).setDisplay("Feuer")); (new BlockTintedFire(0x202020)).setHardness(0.0F).setLightLevel(1.0F).setStepSound(SoundType.CLOTH).setDisplay("Dunkles Feuer"));
registerBlock(254, "web", (new BlockWeb()).setLightOpacity(1).setHardness(4.0F).setDisplay("Spinnennetz"));
registerBlock(255, "fire",
(new BlockFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(SoundType.CLOTH).setDisplay("Feuer"));
registerBlock("lapis_block", (new Block(Material.SOLID)).setHardness(3.0F).setResistance(5.0F) registerBlock(256, "lapis_block", (new Block(Material.SOLID)).setHardness(3.0F).setResistance(5.0F)
.setStepSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningLevel(1)); .setStepSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningLevel(1));
registerBlock("emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) registerBlock(257, "emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningLevel(2)); .setStepSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningLevel(2));
registerBlock("redstone_block", (new BlockCompressedPowered(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) registerBlock(258, "redstone_block", (new BlockCompressedPowered(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Redstone-Block").setTab(CheatTab.TECHNOLOGY)); .setStepSound(SoundType.STONE).setDisplay("Redstone-Block").setTab(CheatTab.TECHNOLOGY));
registerBlock("glass", (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas")); registerBlock(270, "glass",
registerBlock("stained_glass", (new BlockStainedGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("gefärbtes Glas")); (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas"));
registerBlock("glass_pane", (new BlockPane(Material.TRANSLUCENT, false)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glasscheibe")); registerBlock(271, "stained_glass",
registerBlock("stained_glass_pane", (new BlockStainedGlassPane()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("gefärbte Glasscheibe")); (new BlockStainedGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("gefärbtes Glas"));
registerBlock(272, "glass_pane",
(new BlockPane(Material.TRANSLUCENT, false)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glasscheibe"));
registerBlock(273, "stained_glass_pane",
(new BlockStainedGlassPane()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("gefärbte Glasscheibe"));
registerBlock("wool", (new BlockColored(Material.BURNABLE)).setHardness(0.8F).setStepSound(SoundType.CLOTH).setDisplay("Wolle") registerBlock(280, "wool", (new BlockColored(Material.BURNABLE)).setHardness(0.8F).setStepSound(SoundType.CLOTH).setDisplay("Wolle")
.setShearsEfficiency(1)); .setShearsEfficiency(1));
registerBlock("carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(SoundType.CLOTH).setDisplay("Teppich").setLightOpacity(0)); registerBlock(281, "carpet",
(new BlockCarpet()).setHardness(0.1F).setStepSound(SoundType.CLOTH).setDisplay("Teppich").setLightOpacity(0));
bid = 282;
for(DyeColor color : BlockBed.COLORS) { for(DyeColor color : BlockBed.COLORS) {
registerBlock(color.getName() + "_bed", (new BlockBed(color)).setStepSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett")); registerBlock(bid++, color.getName() + "_bed", (new BlockBed(color)).setStepSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett"));
} }
registerBlock("ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(SoundType.LADDER).setDisplay("Leiter").setAxeHarvestable()); registerBlock(300, "ladder",
registerBlock("torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(SoundType.WOOD).setDisplay("Fackel")); (new BlockLadder()).setHardness(0.4F).setStepSound(SoundType.LADDER).setDisplay("Leiter").setAxeHarvestable());
registerBlock("lamp", (new Block(Material.TRANSLUCENT)).setHardness(0.3F).setStepSound(SoundType.GLASS).setLightLevel(1.0F) registerBlock(301, "torch",
(new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(SoundType.WOOD).setDisplay("Fackel"));
registerBlock(302, "lamp", (new Block(Material.TRANSLUCENT)).setHardness(0.3F).setStepSound(SoundType.GLASS).setLightLevel(1.0F)
.setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY)); .setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY));
registerBlock("bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(SoundType.WOOD).setDisplay("Bücherregal")); registerBlock(304, "bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(SoundType.WOOD).setDisplay("Bücherregal"));
registerBlock("cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen")); registerBlock(305, "cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen"));
registerBlock("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE) registerBlock(306, "dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE)
.setLightLevel(0.125F).setDisplay("Drachenei").setTab(CheatTab.DECORATION)); .setLightLevel(0.125F).setDisplay("Drachenei").setTab(CheatTab.DECORATION));
registerBlock("flower_pot", (new BlockFlowerPot()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Blumentopf")); registerBlock(307, "flower_pot", (new BlockFlowerPot()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Blumentopf"));
registerBlock("sponge", (new Block(Material.LOOSE)).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwamm") registerBlock(308, "sponge", (new Block(Material.LOOSE)).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwamm")
.setTab(CheatTab.DECORATION)); .setTab(CheatTab.DECORATION));
registerBlock("skull", (new BlockSkull()).setHardness(1.0F).setStepSound(SoundType.STONE).setDisplay("Schädel").setTab(CheatTab.DECORATION)); registerBlock(309, "skull", (new BlockSkull()).setHardness(1.0F).setStepSound(SoundType.STONE).setDisplay("Schädel").setTab(CheatTab.DECORATION));
registerBlock("lit_pumpkin", (new BlockPumpkin()).setHardness(1.0F).setStepSound(SoundType.WOOD).setLightLevel(1.0F).setDisplay("Kürbislaterne")); registerBlock(310, "lit_pumpkin",
registerBlock("hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(SoundType.GRASS).setDisplay("Strohballen") (new BlockPumpkin()).setHardness(1.0F).setStepSound(SoundType.WOOD).setLightLevel(1.0F).setDisplay("Kürbislaterne"));
registerBlock(311, "hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(SoundType.GRASS).setDisplay("Strohballen")
.setTab(CheatTab.DECORATION)); .setTab(CheatTab.DECORATION));
registerBlock("sign", (new BlockStandingSign()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Schild")); registerBlock(312, "sign",
registerBlock("wall_sign", (new BlockWallSign()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Schild")); (new BlockStandingSign()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Schild"));
registerBlock("banner", (new BlockBannerStanding()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Banner")); registerBlock(313, "wall_sign",
registerBlock("wall_banner", (new BlockBannerHanging()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Banner")); (new BlockWallSign()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Schild"));
registerBlock(314, "banner",
(new BlockBannerStanding()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Banner"));
registerBlock(315, "wall_banner",
(new BlockBannerHanging()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Banner"));
registerBlock("portal", (new BlockPortal()).setHardness(0.0F).setStepSound(SoundType.GLASS).setLightLevel(0.75F).setDisplay("Portal")); registerBlock(390, "portal",
registerBlock("floor_portal", (new BlockFloorPortal(Material.PORTAL)).setHardness(0.0F).setDisplay("Portal")); (new BlockPortal()).setHardness(0.0F).setStepSound(SoundType.GLASS).setLightLevel(0.75F).setDisplay("Portal"));
registerBlock("portal_frame", (new BlockPortalFrame()).setStepSound(SoundType.GLASS).setLightLevel(0.125F).setHardness(5.0F) registerBlock(391, "floor_portal", (new BlockFloorPortal(Material.PORTAL)).setHardness(0.0F).setDisplay("Portal"));
registerBlock(392, "portal_frame", (new BlockPortalFrame()).setStepSound(SoundType.GLASS).setLightLevel(0.125F).setHardness(5.0F)
.setDisplay("Portalrahmen").setResistance(2000.0F).setTab(CheatTab.TECHNOLOGY)); .setDisplay("Portalrahmen").setResistance(2000.0F).setTab(CheatTab.TECHNOLOGY));
registerBlock("farmland", (new BlockFarmland()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ackerboden") registerBlock(400, "farmland", (new BlockFarmland()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ackerboden")
.setShovelHarvestable().setTab(CheatTab.PLANTS)); .setShovelHarvestable().setTab(CheatTab.PLANTS));
registerBlock("wheat", (new BlockCrops()).setDisplay("Getreide")); registerBlock(401, "wheat", (new BlockCrops()).setDisplay("Getreide"));
registerBlock("carrot", (new BlockCarrot()).setDisplay("Karotten")); registerBlock(402, "carrot", (new BlockCarrot()).setDisplay("Karotten"));
registerBlock("potato", (new BlockPotato()).setDisplay("Kartoffeln")); registerBlock(403, "potato", (new BlockPotato()).setDisplay("Kartoffeln"));
registerBlock("soul_wart", (new BlockWart()).setDisplay("Seelenwarze")); registerBlock(404, "soul_wart", (new BlockWart()).setDisplay("Seelenwarze"));
bid = 500;
for(MetalType metal : MetalType.values()) { for(MetalType metal : MetalType.values()) {
// String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1); // String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1);
registerBlock(metal.name + "_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F).setStepSound(SoundType.STONE) registerBlock(bid++, metal.name + "_block",
.setDisplay(metal.display + "block").setTab(CheatTab.GEMS).setMiningLevel(1) (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setLightLevel(metal.radioactivity > 0.0F ? 0.25F : 0.0F).setRadiation(metal.radioactivity * 2.0f)); .setDisplay(metal.display + "block").setTab(CheatTab.GEMS).setMiningLevel(1)
.setLightLevel(metal.radioactivity > 0.0F ? 0.25F : 0.0F).setRadiation(metal.radioactivity * 2.0f));
} }
bid = 540;
for(OreType ore : OreType.values()) { for(OreType ore : OreType.values()) {
// String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1); // String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1);
registerBlock(ore.name + "_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F).setStepSound(SoundType.STONE) registerBlock(bid++, ore.name + "_block",
.setDisplay(ore.display + "block").setTab(CheatTab.GEMS) (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setMiningLevel(ore.material.getHarvestLevel() - 1)); .setDisplay(ore.display + "block").setTab(CheatTab.GEMS)
.setMiningLevel(ore.material.getHarvestLevel() - 1));
} }
@ -452,173 +492,206 @@ public abstract class BlockRegistry {
registerBlock("stone_slab", (new BlockSlab(Material.SOLID, "stone_slab_side", "double_stone_top", "double_stone_top")) registerBlock(600, "stone_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Steinstufe")); (new BlockSlab(Material.SOLID, "stone_slab_side", "double_stone_top", "double_stone_top"))
registerBlock("stone_stairs", (new BlockStairs(stone.getState())).setDisplay("Steintreppe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Steinstufe"));
registerBlock(601, "stone_stairs", (new BlockStairs(stone.getState())).setDisplay("Steintreppe"));
registerBlock("cobblestone_slab", (new BlockSlab(Material.SOLID, "cobblestone")) registerBlock(610, "cobblestone_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Bruchsteinstufe")); (new BlockSlab(Material.SOLID, "cobblestone"))
registerBlock("cobblestone_stairs", (new BlockStairs(cobblestone.getState())).setDisplay("Bruchsteintreppe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Bruchsteinstufe"));
registerBlock("cobblestone_wall", (new BlockWall(cobblestone)).setDisplay("Bruchsteinmauer")); registerBlock(611, "cobblestone_stairs", (new BlockStairs(cobblestone.getState())).setDisplay("Bruchsteintreppe"));
registerBlock(612, "cobblestone_wall", (new BlockWall(cobblestone)).setDisplay("Bruchsteinmauer"));
registerBlock("sandstone_slab", (new BlockSlab(Material.SOLID, "sandstone_normal", "sandstone_bottom", "sandstone_all")) registerBlock(620, "sandstone_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Sandsteinstufe")); (new BlockSlab(Material.SOLID, "sandstone_normal", "sandstone_bottom", "sandstone_all"))
registerBlock("sandstone_stairs", (new BlockStairs(sandstone.getState().withProperty(BlockSandStone.TYPE, BlockSandStone.EnumType.DEFAULT), .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Sandsteinstufe"));
"sandstone_bottom", "sandstone_all")) // fix type registerBlock(621, "sandstone_stairs",
.setDisplay("Sandsteintreppe")); (new BlockStairs(sandstone.getState().withProperty(BlockSandStone.TYPE, BlockSandStone.EnumType.DEFAULT),
"sandstone_bottom", "sandstone_all")) // fix type
.setDisplay("Sandsteintreppe"));
Block quartz = (new BlockQuartz("")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Quarzblock"); Block quartz = (new BlockQuartz("")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Quarzblock");
registerBlock("quartz_block", quartz); registerBlock(630, "quartz_block", quartz);
registerBlock("quartz_slab", (new BlockSlab(Material.SOLID, "quartz_block_side", "quartz_block_bottom", "quartz_top")) registerBlock(631, "quartz_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Quarzstufe")); (new BlockSlab(Material.SOLID, "quartz_block_side", "quartz_block_bottom", "quartz_top"))
registerBlock("quartz_stairs", (new BlockStairs(quartz.getState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT), .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Quarzstufe"));
"quartz_block_bottom", "quartz_top")) registerBlock(632, "quartz_stairs",
.setDisplay("Quarztreppe")); (new BlockStairs(quartz.getState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT),
"quartz_block_bottom", "quartz_top"))
.setDisplay("Quarztreppe"));
registerBlock("iron_bars", (new BlockPane(Material.SOLID, true)).setHardness(5.0F).setResistance(10.0F).setStepSound(SoundType.STONE) registerBlock(640, "iron_bars", (new BlockPane(Material.SOLID, true)).setHardness(5.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Eisengitter")); .setDisplay("Eisengitter"));
registerBlock("iron_door", (new BlockDoor(Material.SOLID)).setHardness(5.0F).setStepSound(SoundType.STONE).setDisplay("Eisentür")); registerBlock(641, "iron_door",
registerBlock("iron_trapdoor", (new BlockTrapDoor(Material.SOLID)).setHardness(5.0F).setStepSound(SoundType.STONE).setDisplay("Eisenfalltür")); (new BlockDoor(Material.SOLID)).setHardness(5.0F).setStepSound(SoundType.STONE).setDisplay("Eisentür"));
registerBlock(642, "iron_trapdoor",
(new BlockTrapDoor(Material.SOLID)).setHardness(5.0F).setStepSound(SoundType.STONE).setDisplay("Eisenfalltür"));
Block brick = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block brick = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Ziegelsteine").setTab(CheatTab.BLOCKS); .setDisplay("Ziegelsteine").setTab(CheatTab.BLOCKS);
registerBlock("brick_block", brick); registerBlock(650, "brick_block", brick);
registerBlock("brick_slab", (new BlockSlab(Material.SOLID, "brick_block")) registerBlock(651, "brick_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Ziegelstufe")); (new BlockSlab(Material.SOLID, "brick_block"))
registerBlock("brick_stairs", (new BlockStairs(brick.getState())).setDisplay("Ziegeltreppe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Ziegelstufe"));
registerBlock(652, "brick_stairs", (new BlockStairs(brick.getState())).setDisplay("Ziegeltreppe"));
Block stonebrick = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE) Block stonebrick = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Steinziegel"); .setDisplay("Steinziegel");
registerBlock("stonebrick", stonebrick); registerBlock(660, "stonebrick", stonebrick);
registerBlock("stonebrick_slab", (new BlockSlab(Material.SOLID, "stonebrick_default")) registerBlock(661, "stonebrick_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Steinziegelstufe")); (new BlockSlab(Material.SOLID, "stonebrick_default"))
registerBlock("stonebrick_stairs", (new BlockStairs(stonebrick.getState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.DEFAULT))) .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Steinziegelstufe"));
.setDisplay("Steinziegeltreppe")); registerBlock(662, "stonebrick_stairs",
(new BlockStairs(stonebrick.getState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.DEFAULT)))
.setDisplay("Steinziegeltreppe"));
Block bloodBrick = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block bloodBrick = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Blutrote Ziegel").setTab(CheatTab.BLOCKS); .setDisplay("Blutrote Ziegel").setTab(CheatTab.BLOCKS);
registerBlock("blood_brick", bloodBrick); registerBlock(670, "blood_brick", bloodBrick);
registerBlock("blood_brick_slab", (new BlockSlab(Material.SOLID, "blood_brick")) registerBlock(671, "blood_brick_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Blutrote Ziegelstufe")); (new BlockSlab(Material.SOLID, "blood_brick"))
registerBlock("blood_brick_fence", (new BlockFence(Material.SOLID, "blood_brick")).setHardness(2.0F).setResistance(10.0F) .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Blutrote Ziegelstufe"));
registerBlock(672, "blood_brick_fence", (new BlockFence(Material.SOLID, "blood_brick")).setHardness(2.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Blutroter Ziegelzaun")); .setStepSound(SoundType.STONE).setDisplay("Blutroter Ziegelzaun"));
registerBlock("blood_brick_stairs", (new BlockStairs(bloodBrick.getState())).setDisplay("Blutrote Ziegeltreppe")); registerBlock(673, "blood_brick_stairs", (new BlockStairs(bloodBrick.getState())).setDisplay("Blutrote Ziegeltreppe"));
Block blackBrick = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block blackBrick = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Schwarze Ziegel").setTab(CheatTab.BLOCKS); .setDisplay("Schwarze Ziegel").setTab(CheatTab.BLOCKS);
registerBlock("black_brick", blackBrick); registerBlock(680, "black_brick", blackBrick);
registerBlock("black_brick_slab", (new BlockSlab(Material.SOLID, "black_brick")) registerBlock(681, "black_brick_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarze Ziegelstufe")); (new BlockSlab(Material.SOLID, "black_brick"))
registerBlock("black_brick_stairs", (new BlockStairs(blackBrick.getState())).setDisplay("Schwarze Ziegeltreppe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarze Ziegelstufe"));
registerBlock("black_brick_fence", (new BlockFence(Material.SOLID, "black_brick")).setHardness(2.0F).setResistance(10.0F) registerBlock(682, "black_brick_stairs", (new BlockStairs(blackBrick.getState())).setDisplay("Schwarze Ziegeltreppe"));
registerBlock(683, "black_brick_fence", (new BlockFence(Material.SOLID, "black_brick")).setHardness(2.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Schwarzer Ziegelzaun")); .setStepSound(SoundType.STONE).setDisplay("Schwarzer Ziegelzaun"));
Block bquartz = (new BlockQuartz("black_")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Schwarzer Quarzblock"); Block bquartz = (new BlockQuartz("black_")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Schwarzer Quarzblock");
registerBlock("black_quartz_block", bquartz); registerBlock(690, "black_quartz_block", bquartz);
registerBlock("black_quartz_slab", (new BlockSlab(Material.SOLID, "black_quartz_block_side", "black_quartz_block_bottom", "black_quartz_top")) registerBlock(691, "black_quartz_slab",
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarze Quarzstufe")); (new BlockSlab(Material.SOLID, "black_quartz_block_side", "black_quartz_block_bottom", "black_quartz_top"))
registerBlock("black_quartz_stairs", (new BlockStairs(bquartz.getState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT), .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarze Quarzstufe"));
"black_quartz_block_bottom", "black_quartz_top")) registerBlock(692, "black_quartz_stairs",
.setDisplay("Schwarze Quarztreppe")); (new BlockStairs(bquartz.getState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT),
"black_quartz_block_bottom", "black_quartz_top"))
.setDisplay("Schwarze Quarztreppe"));
bid = 700;
for(DecoType deco : DecoType.values()) { for(DecoType deco : DecoType.values()) {
registerBlock(deco.name, (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F) registerBlock(bid++, deco.name, (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay(deco.display).setTab(CheatTab.BLOCKS)); .setStepSound(SoundType.STONE).setDisplay(deco.display).setTab(CheatTab.BLOCKS));
} }
registerBlock("trapdoor", (new BlockTrapDoor(Material.WOOD)).setHardness(3.0F).setStepSound(SoundType.WOOD).setDisplay("Holzfalltür")); registerBlock(1000, "trapdoor",
(new BlockTrapDoor(Material.WOOD)).setHardness(3.0F).setStepSound(SoundType.WOOD).setDisplay("Holzfalltür"));
bid = 1100;
for(WoodType wood : WoodType.values()) { for(WoodType wood : WoodType.values()) {
Block planks = (new Block(Material.WOOD)).setHardness(2.0F).setResistance(5.0F).setStepSound(SoundType.WOOD) Block planks = (new Block(Material.WOOD)).setHardness(2.0F).setResistance(5.0F).setStepSound(SoundType.WOOD)
.setDisplay(wood.getDisplay() + "holzbretter").setTab(CheatTab.WOOD); .setDisplay(wood.getDisplay() + "holzbretter").setTab(CheatTab.WOOD);
registerBlock(wood.getName() + "_planks", planks); registerBlock(bid++, wood.getName() + "_planks", planks);
registerBlock(wood.getName() + "_stairs", (new BlockStairs(planks.getState())) registerBlock(bid++, wood.getName() + "_stairs", (new BlockStairs(planks.getState()))
.setDisplay(wood.getDisplay() + "holztreppe")); .setDisplay(wood.getDisplay() + "holztreppe"));
registerBlock(wood.getName() + "_slab", (new BlockSlab(Material.WOOD, wood.getName() + "_planks")) registerBlock(bid++, wood.getName() + "_slab", (new BlockSlab(Material.WOOD, wood.getName() + "_planks"))
.setHardness(2.0F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay(wood.getDisplay() + "holzstufe")); .setHardness(2.0F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay(wood.getDisplay() + "holzstufe"));
registerBlock(wood.getName() + "_fence", (new BlockFence(Material.WOOD, wood.getName() + "_planks")) registerBlock(bid++, wood.getName() + "_fence", (new BlockFence(Material.WOOD, wood.getName() + "_planks"))
.setHardness(2.0F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay(wood.getDisplay() + "holzzaun")); .setHardness(2.0F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay(wood.getDisplay() + "holzzaun"));
registerBlock(wood.getName() + "_fence_gate", (new BlockFenceGate(wood)).setHardness(2.0F).setResistance(5.0F) registerBlock(bid++, wood.getName() + "_fence_gate", (new BlockFenceGate(wood)).setHardness(2.0F).setResistance(5.0F)
.setStepSound(SoundType.WOOD).setDisplay(wood.getDisplay() + "holzzauntor")); .setStepSound(SoundType.WOOD).setDisplay(wood.getDisplay() + "holzzauntor"));
registerBlock(wood.getName() + "_door", (new BlockDoor(Material.WOOD)).setHardness(3.0F).setStepSound(SoundType.WOOD) registerBlock(bid++, wood.getName() + "_door", (new BlockDoor(Material.WOOD)).setHardness(3.0F).setStepSound(SoundType.WOOD)
.setDisplay(wood.getDisplay() + "holztür")); .setDisplay(wood.getDisplay() + "holztür"));
} }
registerBlock("core", new BlockCore().setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE) registerBlock(2000, "core", new BlockCore().setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Chunk-Lade-Kern")); .setDisplay("Chunk-Lade-Kern"));
registerBlock("mob_spawner", (new BlockMobSpawner()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Mob-Spawner")); registerBlock(2001, "mob_spawner",
registerBlock("workbench", (new BlockWorkbench(3)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Werkbank")); (new BlockMobSpawner()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Mob-Spawner"));
registerBlock("furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(SoundType.STONE).setDisplay("Ofen") registerBlock(2002, "workbench", (new BlockWorkbench(3)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Werkbank"));
registerBlock(2003, "furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(SoundType.STONE).setDisplay("Ofen")
.setTab(CheatTab.TECHNOLOGY)); .setTab(CheatTab.TECHNOLOGY));
registerBlock("lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(SoundType.STONE).setLightLevel(0.875F) registerBlock(2004, "lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(SoundType.STONE).setLightLevel(0.875F)
.setDisplay("Ofen (Gefeuert)").setTab(CheatTab.TECHNOLOGY)); .setDisplay("Ofen (Gefeuert)").setTab(CheatTab.TECHNOLOGY));
registerBlock("anvil", (new BlockAnvil()).setHardness(5.0F).setStepSound(SoundType.ANVIL).setResistance(2000.0F).setDisplay("Amboss")); registerBlock(2005, "anvil",
registerBlock("enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setDisplay("Zaubertisch")); (new BlockAnvil()).setHardness(5.0F).setStepSound(SoundType.ANVIL).setResistance(2000.0F).setDisplay("Amboss"));
registerBlock("brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setDisplay("Braustand")); registerBlock(2006, "enchanting_table",
registerBlock("cauldron", (new BlockCauldron()).setHardness(2.0F).setDisplay("Kessel")); (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setDisplay("Zaubertisch"));
registerBlock("beacon", (new BlockBeacon()).setDisplay("Leuchtfeuer").setLightLevel(1.0F)); registerBlock(2007, "brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setDisplay("Braustand"));
registerBlock("noteblock", (new BlockNote()).setHardness(0.8F).setDisplay("Notenblock")); registerBlock(2008, "cauldron", (new BlockCauldron()).setHardness(2.0F).setDisplay("Kessel"));
registerBlock("jukebox", (new BlockJukebox()).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Plattenspieler")); registerBlock(2009, "beacon", (new BlockBeacon()).setDisplay("Leuchtfeuer").setLightLevel(1.0F));
registerBlock("construction_table", (new BlockWorkbench(4)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Konstruktionstisch")); registerBlock(2010, "noteblock", (new BlockNote()).setHardness(0.8F).setDisplay("Notenblock"));
registerBlock("assembly_unit", (new BlockWorkbench(5)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Fertigungseinheit")); registerBlock(2011, "jukebox",
(new BlockJukebox()).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Plattenspieler"));
registerBlock(2012, "construction_table", (new BlockWorkbench(4)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Konstruktionstisch"));
registerBlock(2013, "assembly_unit", (new BlockWorkbench(5)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Fertigungseinheit"));
registerBlock("chest", (new BlockChest(0)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Truhe")); registerBlock(2100, "chest", (new BlockChest(0)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Truhe"));
registerBlock("trapped_chest", (new BlockChest(1)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Redstonetruhe")); registerBlock(2101, "trapped_chest", (new BlockChest(1)).setHardness(2.5F).setStepSound(SoundType.WOOD).setDisplay("Redstonetruhe"));
registerBlock("warp_chest", (new BlockWarpChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(SoundType.STONE) registerBlock(2102, "warp_chest", (new BlockWarpChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(SoundType.STONE)
.setDisplay("Warptruhe").setLightLevel(0.5F)); .setDisplay("Warptruhe").setLightLevel(0.5F));
registerBlock("tnt", (new BlockTNT()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("TNT")); registerBlock(2200, "tnt", (new BlockTNT()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("TNT"));
registerBlock("nuke", (new BlockNuke()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("T-17")); registerBlock(2201, "nuke", (new BlockNuke()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("T-17"));
registerBlock("piston", (new BlockPistonBase(false)).setDisplay("Kolben")); registerBlock(2300, "piston", (new BlockPistonBase(false)).setDisplay("Kolben"));
registerBlock("sticky_piston", (new BlockPistonBase(true)).setDisplay("Klebriger Kolben")); registerBlock(2301, "sticky_piston", (new BlockPistonBase(true)).setDisplay("Klebriger Kolben"));
registerBlock("piston_head", (new BlockPistonHead()).setDisplay("Kolben")); registerBlock(2302, "piston_head", (new BlockPistonHead()).setDisplay("Kolben"));
registerBlock("piston_extension", new BlockPistonMoving().setDisplay("Kolben")); registerBlock(2303, "piston_extension", new BlockPistonMoving().setDisplay("Kolben"));
registerBlock("dispenser", (new BlockDispenser()).setHardness(3.5F).setStepSound(SoundType.STONE).setDisplay("Werfer")); registerBlock(2304, "dispenser", (new BlockDispenser()).setHardness(3.5F).setStepSound(SoundType.STONE).setDisplay("Werfer"));
registerBlock("dropper", (new BlockDropper()).setHardness(3.5F).setStepSound(SoundType.STONE).setDisplay("Spender")); registerBlock(2305, "dropper", (new BlockDropper()).setHardness(3.5F).setStepSound(SoundType.STONE).setDisplay("Spender"));
registerBlock("hopper", (new BlockHopper()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Trichter")); registerBlock(2306, "hopper",
registerBlock("tian_reactor", (new BlockTianReactor()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Tianreaktor")); (new BlockHopper()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Trichter"));
registerBlock(2307, "tian_reactor",
(new BlockTianReactor()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Tianreaktor"));
registerBlock("rail", (new BlockRail()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Schiene").setMiningLevel(0)); registerBlock(2400, "rail", (new BlockRail()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Schiene").setMiningLevel(0));
registerBlock("golden_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Antriebsschiene").setMiningLevel(0)); registerBlock(2401, "golden_rail",
registerBlock("detector_rail", (new BlockRailDetector()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Sensorschiene").setMiningLevel(0)); (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Antriebsschiene").setMiningLevel(0));
registerBlock("activator_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Aktivierungsschiene").setMiningLevel(0)); registerBlock(2402, "detector_rail",
(new BlockRailDetector()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Sensorschiene").setMiningLevel(0));
registerBlock(2403, "activator_rail",
(new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Aktivierungsschiene").setMiningLevel(0));
registerBlock("lever", (new BlockLever()).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Hebel")); registerBlock(2500, "lever", (new BlockLever()).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Hebel"));
registerBlock("stone_pressure_plate", (new BlockPressurePlate(Material.SOLID, BlockPressurePlate.Sensitivity.MOBS)).setHardness(0.5F) registerBlock(2510, "stone_pressure_plate", (new BlockPressurePlate(Material.SOLID, BlockPressurePlate.Sensitivity.MOBS)).setHardness(0.5F)
.setStepSound(SoundType.STONE).setDisplay("Steindruckplatte")); .setStepSound(SoundType.STONE).setDisplay("Steindruckplatte"));
registerBlock("wooden_pressure_plate", (new BlockPressurePlate(Material.WOOD, BlockPressurePlate.Sensitivity.EVERYTHING)) registerBlock(2511, "wooden_pressure_plate", (new BlockPressurePlate(Material.WOOD, BlockPressurePlate.Sensitivity.EVERYTHING))
.setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Holzdruckplatte")); .setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Holzdruckplatte"));
registerBlock("light_weighted_pressure_plate", (new BlockPressurePlateWeighted(Material.SOLID, 15)).setHardness(0.5F) registerBlock(2512, "light_weighted_pressure_plate", (new BlockPressurePlateWeighted(Material.SOLID, 15)).setHardness(0.5F)
.setStepSound(SoundType.WOOD).setDisplay("Wägeplatte (niedrige Gewichte)")); .setStepSound(SoundType.WOOD).setDisplay("Wägeplatte (niedrige Gewichte)"));
registerBlock("heavy_weighted_pressure_plate", (new BlockPressurePlateWeighted(Material.SOLID, 150)).setHardness(0.5F) registerBlock(2513, "heavy_weighted_pressure_plate", (new BlockPressurePlateWeighted(Material.SOLID, 150)).setHardness(0.5F)
.setStepSound(SoundType.WOOD).setDisplay("Wägeplatte (hohe Gewichte)")); .setStepSound(SoundType.WOOD).setDisplay("Wägeplatte (hohe Gewichte)"));
registerBlock("stone_button", (new BlockButton(false, 20, "stone")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf")); registerBlock(2520, "stone_button", (new BlockButton(false, 20, "stone")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf"));
registerBlock("wooden_button", (new BlockButton(true, 30, "oak_planks")).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Knopf")); registerBlock(2521, "wooden_button", (new BlockButton(true, 30, "oak_planks")).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Knopf"));
registerBlock("red_button", (new BlockButton(true, 10, "red_button")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf")); registerBlock(2522, "red_button", (new BlockButton(true, 10, "red_button")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf"));
registerBlock("redstone", (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Redstone-Staub")); registerBlock(2600, "redstone",
registerBlock("unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Fackel")); (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Redstone-Staub"));
registerBlock("redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(SoundType.WOOD) registerBlock(2601, "unlit_redstone_torch",
(new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Fackel"));
registerBlock(2602, "redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(SoundType.WOOD)
.setDisplay("Redstone-Fackel").setTab(CheatTab.TECHNOLOGY)); .setDisplay("Redstone-Fackel").setTab(CheatTab.TECHNOLOGY));
registerBlock("repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker")); registerBlock(2603, "repeater",
registerBlock("powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker")); (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker"));
registerBlock("comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator")); registerBlock(2604, "powered_repeater",
registerBlock("powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F) (new BlockRedstoneRepeater(true)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker"));
registerBlock(2605, "comparator",
(new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator"));
registerBlock(2606, "powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F)
.setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator")); .setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator"));
registerBlock("redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS) registerBlock(2607, "redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS)
.setDisplay("Redstone-Lampe").setTab(CheatTab.TECHNOLOGY)); .setDisplay("Redstone-Lampe").setTab(CheatTab.TECHNOLOGY));
registerBlock("lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Redstone-Lampe")); registerBlock(2608, "lit_redstone_lamp",
registerBlock("daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor")); (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Redstone-Lampe"));
registerBlock("daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor")); registerBlock(2609, "daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor"));
registerBlock("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken")); registerBlock(2610, "daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor"));
registerBlock("string", (new BlockTripWire()).setDisplay("Stolperdraht").setShearsEfficiency(0)); registerBlock(2611, "tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken"));
registerBlock(2612, "string", (new BlockTripWire()).setDisplay("Stolperdraht").setShearsEfficiency(0));
} }
} }

View file

@ -771,6 +771,16 @@ public final class ItemStack
// { // {
String s1 = ""; String s1 = "";
if(this.item.getBlock() != null) {
Block block = this.item.getBlock();
int j = BlockRegistry.getIdFromBlock(block);
// if(j != i) {
s1 = s1 + String.format("#%04d%s", j, this.getHasSubtypes() ? "/" : "");
// }
}
// int i = ItemRegistry.getIdFromItem(this.item);
if (this.getHasSubtypes()) if (this.getHasSubtypes())
{ {
s1 = s1 + String.format("%d", this.meta); s1 = s1 + String.format("%d", this.meta);

View file

@ -404,7 +404,6 @@ public final class Server implements IThreadListener, Executor {
} }
public void run(long time) { public void run(long time) {
Region.loadMap();
Converter.convert(this); Converter.convert(this);
long wtime = this.loadServerConfig(); long wtime = this.loadServerConfig();
if(this.keyPair == null) { if(this.keyPair == null) {

View file

@ -1091,7 +1091,6 @@ public abstract class Converter {
NbtTag[] sects = tag.getTagList("Sections"); NbtTag[] sects = tag.getTagList("Sections");
entities = Lists.newArrayList(); entities = Lists.newArrayList();
char[] mapping = Region.getEncodeMap();
for(NbtTag sect : sects) { for(NbtTag sect : sects) {
TagObject nsect = new TagObject(); TagObject nsect = new TagObject();
nsect.setInt("Y", sect.getByte("Y")); nsect.setInt("Y", sect.getByte("Y"));
@ -1105,22 +1104,34 @@ public abstract class Converter {
int cz = c >> 4 & 15; int cz = c >> 4 & 15;
int ca = adddata != null ? adddata.get(cx, cy, cz) : 0; int ca = adddata != null ? adddata.get(cx, cy, cz) : 0;
char block = (char)((ca << 8) | (blocks[c] & 255)); char block = (char)((ca << 8) | (blocks[c] & 255));
if(block == 0) // if(block == 0)
continue; // continue;
int dt = block == 111 ? RANDOM.zrange(4) : data.get(cx, cy, cz); //// else if(block <= 197) {
char cd = mapping[block >= 256 ? BLOCK_MAP[1 << 4] : BLOCK_MAP[(block << 4) | dt]]; //// if((blocks[c] = BLOCK_MAP[block]) != (byte)block)
if(cd >> 12 != 0) { //// data.set(cx, cy, cz, DATA_MAP[block]);
if(adddata == null) //// }
adddata = new NibbleArray(); if(block >= 256) {
adddata.set(cx, cy, cz, cd >> 12); blocks[c] = (byte)1;
data.set(cx, cy, cz, 0);
}
else if(block > 0) {
int dt = block == 111 ? RANDOM.zrange(4) : data.get(cx, cy, cz);
char cd = BLOCK_MAP[(block << 4) | dt];
// if(cd == (char)0x000f)
// cd = (char)BlockRegistry.STATEMAP.get(BLOCK_FUNCS.get((char)((block << 4) | dt)).getState(block, dt));
if(cd >> 12 != 0) {
if(adddata == null)
adddata = new NibbleArray();
adddata.set(cx, cy, cz, cd >> 12);
}
blocks[c] = (byte)(cd >> 4 & 255);
data.set(cx, cy, cz, cd & 15);
} }
blocks[c] = (byte)(cd & 255);
data.set(cx, cy, cz, cd >> 8 & 15);
} }
nsect.setByteArray("Dat0", blocks); nsect.setByteArray("Blocks", blocks);
nsect.setByteArray("Dat1", data.getData()); nsect.setByteArray("Data", data.getData());
if(adddata != null) if(adddata != null)
nsect.setByteArray("Dat2", adddata.getData()); nsect.setByteArray("Add", adddata.getData());
entities.add(nsect); entities.add(nsect);
} }
ntag.setList("Sections", entities); ntag.setList("Sections", entities);

View file

@ -14,7 +14,6 @@ import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.zip.DeflaterOutputStream; import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream; import java.util.zip.InflaterInputStream;
@ -22,150 +21,19 @@ import java.util.zip.InflaterInputStream;
import common.block.Block; import common.block.Block;
import common.collect.Lists; import common.collect.Lists;
import common.collect.Maps; import common.collect.Maps;
import common.collect.Sets;
import common.entity.Entity; import common.entity.Entity;
import common.init.BlockRegistry; import common.init.BlockRegistry;
import common.init.Blocks; import common.init.Blocks;
import common.init.EntityRegistry; import common.init.EntityRegistry;
import common.log.Log; import common.log.Log;
import common.properties.IProperty;
import common.tags.TagObject; import common.tags.TagObject;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.NibbleArray; import common.util.NibbleArray;
import common.util.Util; import common.util.Util;
import common.world.BlockArray; import common.world.BlockArray;
import common.world.State;
public class Region { public class Region {
private static Set<IProperty> getSavedProperties(Block block) {
Set<IProperty> stored = Sets.newHashSet();
Map<IProperty, Comparable> map = Maps.newHashMap();
for(int z = 0; z < 16; z++) {
State sub = block.getStateFromMeta(z);
for(Entry<IProperty, Comparable> entry : sub.getProperties().entrySet()) {
if(map.containsKey(entry.getKey())) {
if(!map.get(entry.getKey()).equals(entry.getValue()))
stored.add(entry.getKey());
}
else {
map.put(entry.getKey(), entry.getValue());
}
}
}
for(int z = 0; z < 16; z++) {
State sub = block.getStateFromMeta(z);
Map<IProperty, Comparable> smap = sub.getProperties();
for(IProperty prop : map.keySet()) {
if(!smap.containsKey(prop))
stored.add(prop);
}
}
return stored;
}
private static String filterProperties(State state, Set<IProperty> stored) {
StringBuilder sb = new StringBuilder(BlockRegistry.getNameFromBlock(state.getBlock()));
for(Entry<IProperty, Comparable> entry : state.getProperties().entrySet()) {
if(stored.contains(entry.getKey()))
sb.append(',').append(entry.getKey().getName()).append('=').append(entry.getKey().getName(entry.getValue()));
}
return sb.toString();
}
private static boolean makeMap(TagObject tag) {
Map<String, Character> mapping = Maps.newHashMap();
Map<String, List<Character>> current = Maps.newHashMap();
Set<Character> taken = Sets.newHashSet();
List<String> missing = Lists.newArrayList();
for(int z = 0; z < 4096; z++) {
Block block = BlockRegistry.getBlockById(z);
if(block != Blocks.air) {
Set<IProperty> stored = getSavedProperties(block);
for(int n = 0; n < 16; n++) {
State state = block.getStateFromMeta(n);
String id = filterProperties(state, stored);
List<Character> ids = current.get(id);
char mid = (char)BlockRegistry.STATEMAP.get(state);
if(ids == null) {
current.put(id, Lists.newArrayList(mid));
}
else {
ids.add(mid);
continue;
}
if(tag.hasChar(id)) {
char bid = tag.getChar(id);
if(bid == 0) {
missing.add(id);
continue;
}
mapping.put(id, bid);
taken.add(bid);
tag.remove(id);
Log.IO.debug("Bestehende Block-ID %d = %s", (int)bid, id);
}
else {
missing.add(id);
}
}
}
}
char bid = 1;
for(String id : missing) {
while(taken.contains(bid)) {
++bid;
}
mapping.put(id, bid);
tag.setChar(id, bid);
taken.add(bid);
Log.IO.debug("Neue Block-ID %d = %s", (int)bid, id);
}
for(Entry<String, Character> entry : mapping.entrySet()) {
bid = entry.getValue();
List<Character> ids = current.get(entry.getKey());
DECODE_MAP[bid] = ids.get(0);
for(char id : ids) {
ENCODE_MAP[id] = bid;
}
}
for(String id : tag.keySet()) {
if(tag.hasChar(id))
Log.IO.debug("Entfernte Block-ID %d = %s", (int)tag.getChar(id), id);
}
return !missing.isEmpty() || !tag.isEmpty();
}
public static void loadMap() {
File mapFile = new File("blocks.cdt");
TagObject tag;
if(mapFile.exists()) {
try {
tag = TagObject.readGZip(mapFile);
}
catch(Exception e) {
tag = new TagObject();
Log.IO.error(e, "Fehler beim Lesen von %s", mapFile);
}
}
else {
tag = new TagObject();
}
if(makeMap(tag)) {
Log.IO.info("Block-IDs haben sich geändert, schreibe %s", mapFile);
try {
TagObject.writeGZip(tag, mapFile);
}
catch(Exception e) {
Log.IO.error(e, "Fehler beim Schreiben von %s", mapFile);
}
}
}
public static char[] getEncodeMap() {
return ENCODE_MAP;
}
private static class ChunkBuffer extends ByteArrayOutputStream { private static class ChunkBuffer extends ByteArrayOutputStream {
public ChunkBuffer() { public ChunkBuffer() {
super(8096); super(8096);
@ -190,8 +58,6 @@ public class Region {
private static final Map<String, Region> CACHE = Maps.<String, Region>newHashMap(); private static final Map<String, Region> CACHE = Maps.<String, Region>newHashMap();
private static final List<WorldServer> QUEUE = Collections.<WorldServer>synchronizedList(Lists.<WorldServer>newArrayList()); private static final List<WorldServer> QUEUE = Collections.<WorldServer>synchronizedList(Lists.<WorldServer>newArrayList());
private static final char[] DECODE_MAP = new char[65536];
private static final char[] ENCODE_MAP = new char[65536];
private static volatile long queued; private static volatile long queued;
private static volatile long saved; private static volatile long saved;
@ -501,7 +367,6 @@ public class Region {
Log.IO.warn("Chunk-Datei bei " + x + "," + z + " hat keine Block-Daten, überspringe"); Log.IO.warn("Chunk-Datei bei " + x + "," + z + " hat keine Block-Daten, überspringe");
return null; return null;
} }
int version = tag.getInt("Version");
ChunkServer chunk = new ChunkServer(world, x, z); ChunkServer chunk = new ChunkServer(world, x, z);
chunk.setHeights(tag.getIntArray("HeightMap")); chunk.setHeights(tag.getIntArray("HeightMap"));
chunk.setTerrainPopulated(tag.getBool("TerrainPopulated")); chunk.setTerrainPopulated(tag.getBool("TerrainPopulated"));
@ -515,9 +380,9 @@ public class Region {
TagObject sect = sects.get(n); TagObject sect = sects.get(n);
int y = sect.getInt("Y"); int y = sect.getInt("Y");
BlockArray storage = new BlockArray(y << 4, light, null); BlockArray storage = new BlockArray(y << 4, light, null);
byte[] blocks = sect.getByteArray("Dat0"); byte[] blocks = sect.getByteArray("Blocks");
NibbleArray data = new NibbleArray(sect.getByteArray("Dat1")); NibbleArray data = new NibbleArray(sect.getByteArray("Data"));
NibbleArray adddata = sect.hasByteArray("Dat2") ? new NibbleArray(sect.getByteArray("Dat2")) : null; NibbleArray adddata = sect.hasByteArray("Add") ? new NibbleArray(sect.getByteArray("Add")) : null;
char[] seg = new char[blocks.length]; char[] seg = new char[blocks.length];
for(int c = 0; c < seg.length; ++c) { for(int c = 0; c < seg.length; ++c) {
@ -525,7 +390,7 @@ public class Region {
int cy = c >> 8 & 15; int cy = c >> 8 & 15;
int cz = c >> 4 & 15; int cz = c >> 4 & 15;
int ca = adddata != null ? adddata.get(cx, cy, cz) : 0; int ca = adddata != null ? adddata.get(cx, cy, cz) : 0;
seg[c] = DECODE_MAP[ca << 12 | data.get(cx, cy, cz) << 8 | (blocks[c] & 255)]; seg[c] = (char)(ca << 12 | (blocks[c] & 255) << 4 | data.get(cx, cy, cz));
} }
storage.setData(seg); storage.setData(seg);
@ -612,6 +477,7 @@ public class Region {
public static TagObject writeChunk(WorldServer world, ChunkServer chunk) { public static TagObject writeChunk(WorldServer world, ChunkServer chunk) {
TagObject tag = new TagObject(); TagObject tag = new TagObject();
// tag.setShort("V", (short)Config.PROTOCOL);
tag.setLong("LastUpdate", world.getTime()); tag.setLong("LastUpdate", world.getTime());
tag.setIntArray("HeightMap", chunk.getHeights()); tag.setIntArray("HeightMap", chunk.getHeights());
tag.setBool("TerrainPopulated", chunk.isTerrainPopulated()); tag.setBool("TerrainPopulated", chunk.isTerrainPopulated());
@ -630,7 +496,7 @@ public class Region {
NibbleArray adddata = null; NibbleArray adddata = null;
for(int c = 0; c < storage.getData().length; ++c) { for(int c = 0; c < storage.getData().length; ++c) {
char cd = ENCODE_MAP[storage.getData()[c]]; char cd = storage.getData()[c];
int cx = c & 15; int cx = c & 15;
int cy = c >> 8 & 15; int cy = c >> 8 & 15;
int cz = c >> 4 & 15; int cz = c >> 4 & 15;
@ -643,15 +509,15 @@ public class Region {
adddata.set(cx, cy, cz, cd >> 12); adddata.set(cx, cy, cz, cd >> 12);
} }
blocks[c] = (byte)(cd & 255); blocks[c] = (byte)(cd >> 4 & 255);
data.set(cx, cy, cz, cd >> 8 & 15); data.set(cx, cy, cz, cd & 15);
} }
sect.setByteArray("Dat0", blocks); sect.setByteArray("Blocks", blocks);
sect.setByteArray("Dat1", data.getData()); sect.setByteArray("Data", data.getData());
if(adddata != null) { if(adddata != null) {
sect.setByteArray("Dat2", adddata.getData()); sect.setByteArray("Add", adddata.getData());
} }
sect.setByteArray("BlockLight", storage.getBlocklight().getData()); sect.setByteArray("BlockLight", storage.getBlocklight().getData());