ADapt 1.7.x pickaxe block break timings.

This commit is contained in:
asofold 2015-01-19 22:39:36 +01:00
parent a2438537db
commit a09917571b
2 changed files with 29 additions and 13 deletions

View File

@ -6,8 +6,11 @@ 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;
import fr.neatmonster.nocheatplus.utilities.BlockProperties;
import fr.neatmonster.nocheatplus.utilities.BlockProperties.BlockProps;
@SuppressWarnings("deprecation")
public class BlocksMC1_7_2 implements BlockPropertiesSetup{
public BlocksMC1_7_2() {
@ -17,6 +20,8 @@ public class BlocksMC1_7_2 implements BlockPropertiesSetup{
@Override
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
// Block shapes.
// Stained glass
BlockInit.setAs(95, Material.GLASS);
// Stained glass pane
@ -34,6 +39,23 @@ public class BlocksMC1_7_2 implements BlockPropertiesSetup{
// Large flowers
BlockInit.setAs(175, Material.YELLOW_FLOWER);
// Block breaking.
final long[] ironTimes = BlockProperties.secToMs(15, 7.5, 1.15, 0.75, 0.56, 1.25);
final BlockProps ironType = new BlockProps(BlockProperties.woodPickaxe, 3, ironTimes);
for (Material mat : new Material[]{
Material.LAPIS_ORE, Material.LAPIS_BLOCK, Material.IRON_ORE,
}) {
BlockProperties.setBlockProps(BlockProperties.getId(mat), ironType);
}
final long[] diamondTimes = BlockProperties.secToMs(15, 7.5, 3.75, 0.75, 0.56, 1.25);
final BlockProps diamondType = new BlockProps(BlockProperties.woodPickaxe, 3, diamondTimes);
for (Material mat : new Material[]{
Material.REDSTONE_ORE, Material.GLOWING_REDSTONE_ORE,
Material.EMERALD_ORE, Material.GOLD_ORE, Material.DIAMOND_ORE,
}) {
BlockProperties.setBlockProps(BlockProperties.getId(mat), diamondType);
}
StaticLog.logInfo("[NoCheatPlus] Added block-info for Minecraft 1.7.2 blocks.");
}

View File

@ -213,13 +213,8 @@ public class BlockProperties {
public static final long[] woodTimes = secToMs(3, 1.5, 0.75, 0.5, 0.4, 0.25);
public static final long[] ironTimes = secToMs(15, 15, 1.15, 0.75, 0.6, 15);
public static final long[] diamondTimes = secToMs(15, 15, 15, 0.75, 0.6, 15);
private static final long[] indestructibleTimes = new long[] {indestructible, indestructible, indestructible, indestructible, indestructible, indestructible};
/** Instantly breakable. */
public static final BlockProps instantType = new BlockProps(noTool, 0, instantTimes);
@ -235,10 +230,6 @@ public class BlockProperties {
public static final BlockProps coalType = new BlockProps(woodPickaxe, 3);
public static final BlockProps ironType = new BlockProps(stonePickaxe, 3, ironTimes);
public static final BlockProps diamondType = new BlockProps(ironPickaxe, 3, diamondTimes);
public static final BlockProps goldBlockType = new BlockProps(woodPickaxe, 3, secToMs(15, 7.5, 3.75, 0.7, 0.55, 1.2));
public static final BlockProps ironBlockType = new BlockProps(woodPickaxe, 5, secToMs(25, 12.5, 2.0, 1.25, 0.95, 2.0));
@ -488,10 +479,11 @@ public class BlockProperties {
}
private static void initBlocks(final MCAccess mcAccess, final WorldConfigProvider<?> worldConfigProvider) {
// Reset tool props.
Arrays.fill(blocks, null);
// Initalize block flags
// Initialize block flags
// Generic initialization.
for (int i = 0; i <maxBlocks; i++) {
for (int i = 0; i < maxBlocks; i++) {
blockFlags[i] = 0;
if (mcAccess.isBlockLiquid(i).decide()) {
@ -749,16 +741,18 @@ public class BlockProperties {
}) {
blocks[mat.getId()] = coalType;
}
final long[] ironTimes = secToMs(15, 15, 1.15, 0.75, 0.6, 15);
final BlockProps ironType = new BlockProps(stonePickaxe, 3, ironTimes);
for (Material mat : new Material[]{
Material.LAPIS_ORE, Material.LAPIS_BLOCK, Material.IRON_ORE,
}) {
blocks[mat.getId()] = ironType;
}
final long[] diamondTimes = secToMs(15, 15, 15, 0.75, 0.6, 15);
final BlockProps diamondType = new BlockProps(ironPickaxe, 3, diamondTimes);
for (Material mat : new Material[]{
Material.REDSTONE_ORE, Material.GLOWING_REDSTONE_ORE,
Material.EMERALD_ORE, Material.GOLD_ORE, Material.DIAMOND_ORE,
}) {
blocks[mat.getId()] = diamondType;
}