Compare commits

..

4 commits

Author SHA1 Message Date
Sen
bc74b3a29d
temp fixed block id removal 2025-06-19 19:49:45 +02:00
Sen
7c8a51bcac
temp fixed block id removal 2025-06-19 18:33:54 +02:00
Sen
dd3ac39530
add block map properly 2025-06-19 18:28:10 +02:00
Sen
64cff6a171
add block map (will reimplement this) 2025-06-19 16:21:15 +02:00
6 changed files with 395 additions and 355 deletions

View file

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

View file

@ -771,16 +771,6 @@ 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,6 +404,7 @@ 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,6 +1091,7 @@ 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"));
@ -1104,34 +1105,22 @@ 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;
//// else if(block <= 197) { int dt = block == 111 ? RANDOM.zrange(4) : data.get(cx, cy, cz);
//// if((blocks[c] = BLOCK_MAP[block]) != (byte)block) char cd = mapping[block >= 256 ? BLOCK_MAP[1 << 4] : BLOCK_MAP[(block << 4) | dt]];
//// data.set(cx, cy, cz, DATA_MAP[block]); if(cd >> 12 != 0) {
//// } if(adddata == null)
if(block >= 256) { adddata = new NibbleArray();
blocks[c] = (byte)1; adddata.set(cx, cy, cz, cd >> 12);
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("Blocks", blocks); nsect.setByteArray("Dat0", blocks);
nsect.setByteArray("Data", data.getData()); nsect.setByteArray("Dat1", data.getData());
if(adddata != null) if(adddata != null)
nsect.setByteArray("Add", adddata.getData()); nsect.setByteArray("Dat2", adddata.getData());
entities.add(nsect); entities.add(nsect);
} }
ntag.setList("Sections", entities); ntag.setList("Sections", entities);

View file

@ -14,6 +14,7 @@ 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;
@ -21,19 +22,150 @@ 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);
@ -58,6 +190,8 @@ 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;
@ -367,6 +501,7 @@ 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"));
@ -380,9 +515,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("Blocks"); byte[] blocks = sect.getByteArray("Dat0");
NibbleArray data = new NibbleArray(sect.getByteArray("Data")); NibbleArray data = new NibbleArray(sect.getByteArray("Dat1"));
NibbleArray adddata = sect.hasByteArray("Add") ? new NibbleArray(sect.getByteArray("Add")) : null; NibbleArray adddata = sect.hasByteArray("Dat2") ? new NibbleArray(sect.getByteArray("Dat2")) : 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) {
@ -390,7 +525,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] = (char)(ca << 12 | (blocks[c] & 255) << 4 | data.get(cx, cy, cz)); seg[c] = DECODE_MAP[ca << 12 | data.get(cx, cy, cz) << 8 | (blocks[c] & 255)];
} }
storage.setData(seg); storage.setData(seg);
@ -477,7 +612,6 @@ 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());
@ -496,7 +630,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 = storage.getData()[c]; char cd = ENCODE_MAP[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;
@ -509,15 +643,15 @@ public class Region {
adddata.set(cx, cy, cz, cd >> 12); adddata.set(cx, cy, cz, cd >> 12);
} }
blocks[c] = (byte)(cd >> 4 & 255); blocks[c] = (byte)(cd & 255);
data.set(cx, cy, cz, cd & 15); data.set(cx, cy, cz, cd >> 8 & 15);
} }
sect.setByteArray("Blocks", blocks); sect.setByteArray("Dat0", blocks);
sect.setByteArray("Data", data.getData()); sect.setByteArray("Dat1", data.getData());
if(adddata != null) { if(adddata != null) {
sect.setByteArray("Add", adddata.getData()); sect.setByteArray("Dat2", adddata.getData());
} }
sect.setByteArray("BlockLight", storage.getBlocklight().getData()); sect.setByteArray("BlockLight", storage.getBlocklight().getData());