From 3cdfa4b9718015769f58b8a9f526cb0163121666 Mon Sep 17 00:00:00 2001 From: asofold Date: Thu, 9 Jun 2016 13:27:43 +0200 Subject: [PATCH] [BLIND] Add block-info for MC 1.10. --- .../blocks/init/vanilla/BlocksMC1_10.java | 40 +++++++++++++++++++ .../blocks/init/vanilla/BlocksMC1_9.java | 3 +- .../init/vanilla/VanillaBlocksFactory.java | 1 + 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java new file mode 100644 index 00000000..58c82c93 --- /dev/null +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java @@ -0,0 +1,40 @@ +package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; + +import org.bukkit.Material; + +import fr.neatmonster.nocheatplus.compat.blocks.BlockPropertiesSetup; +import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit; +import fr.neatmonster.nocheatplus.config.WorldConfigProvider; +import fr.neatmonster.nocheatplus.logging.StaticLog; + +/** + * Blocks for Minecraft 1.10. + * + * @author asofold + * + */ +public class BlocksMC1_10 implements BlockPropertiesSetup { + + public BlocksMC1_10() { + BlockInit.assertMaterialNameMatch(213, "MAGMA"); + BlockInit.assertMaterialNameMatch(216, "BONE_BLOCK"); + BlockInit.assertMaterialNameMatch(217, "STRUCTURE_VOID"); + } + + @Override + public void setupBlockProperties(WorldConfigProvider worldConfigProvider) { + // 213 MAGMA + BlockInit.setAs(213, Material.STONE_PLATE); + // 214 NETHER_WART_BLOCK + BlockInit.setAs(214, Material.SKULL); + // 215 RED_NETHER_BRICK + BlockInit.setAs(215, Material.NETHER_BRICK); + // 216 BONE_BLOCK + BlockInit.setAs(216, Material.COBBLESTONE); + // 217 STRUCTURE_VOID + BlockInit.setAs(217, 255); // Like STRUCTURE_BLOCK. + + StaticLog.logInfo("Added block-info for Minecraft 1.10 blocks."); + } + +} diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java index 72704f0e..e4c041c0 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java @@ -22,8 +22,6 @@ public class BlocksMC1_9 implements BlockPropertiesSetup { @Override public void setupBlockProperties(WorldConfigProvider worldConfigProvider) { - // TODO: Actual similarly fast/slow breaking blocks ? - final long ground = BlockProperties.F_GROUND; final BlockProps instant = BlockProperties.instantType; @@ -81,6 +79,7 @@ public class BlocksMC1_9 implements BlockPropertiesSetup { BlockInit.setAs(255, Material.BEDROCK); // Special case activation. + // TODO: Is this the right place? BlockProperties.setSpecialCaseTrapDoorAboveLadder(true); StaticLog.logInfo("Added block-info for Minecraft 1.9 blocks."); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java index 22fcb96e..5af32414 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java @@ -20,6 +20,7 @@ public class VanillaBlocksFactory { setups.add(new BlocksMC1_7_2()); setups.add(new BlocksMC1_8()); setups.add(new BlocksMC1_9()); + setups.add(new BlocksMC1_10()); } catch(Throwable t){} for (final BlockPropertiesSetup setup : setups){