diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java index 33de5673a..fb44334be 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java @@ -71,6 +71,7 @@ public class CustomBlocksConfig extends ModConfigLoader{ int id = config.getInt(skillType + "." + blockName + ".ID", 0); byte data = (byte) config.getInt(skillType + "." + blockName + ".Data_Value", 0); int xp = config.getInt(skillType + "." + blockName + ".XP_Gain", 0); + int tier = config.getInt(skillType + "." + blockName + ".Tier", 1); boolean dropItem = config.getBoolean(skillType + "." + blockName + ".Drop_Item", false); int dropID = config.getInt(skillType + "." + blockName + ".Drop_Item_ID", 0); byte dropData = (byte) config.getInt(skillType + "." + blockName + ".Drop_Item_Data_Value", 0); @@ -97,7 +98,7 @@ public class CustomBlocksConfig extends ModConfigLoader{ itemDrop = new ItemStack(id, dropAmount, (short) 0, data); } - block = new CustomBlock(itemDrop, xp, data, id); + block = new CustomBlock(itemDrop, tier, xp, data, id); blockItem = new ItemStack(id, 1, (short) 0, data); if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) { diff --git a/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java b/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java index b7fa47229..00f0511e1 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java +++ b/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java @@ -6,12 +6,14 @@ public class CustomBlock { private int itemID; private byte dataValue; private int xpGain; + private int tier; private ItemStack itemDrop; - public CustomBlock(ItemStack itemDrop, int xpGain, byte dataValue, int itemID) { + public CustomBlock(ItemStack itemDrop, int tier, int xpGain, byte dataValue, int itemID) { this.itemID = itemID; this.dataValue = dataValue; this.xpGain = xpGain; + this.tier = tier; this.itemDrop = itemDrop; } @@ -39,6 +41,14 @@ public class CustomBlock { this.xpGain = xpGain; } + public int getTier() { + return tier; + } + + public void setTier(int tier) { + this.tier = tier; + } + public ItemStack getItemDrop() { return itemDrop; } diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java index 204efb03e..9ed86fe8d 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java @@ -251,6 +251,10 @@ public class Mining { FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); if (Config.getInstance().getBlockModsEnabled() && CustomBlocksConfig.getInstance().customItems.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) { + if (ModChecks.getCustomBlock(block).getTier() < tier) { + return; + } + if (mcMMO.placeStore.isTrue(block)) { return; } diff --git a/src/main/resources/blocks.yml b/src/main/resources/blocks.yml index 844d3e94f..b93b03f93 100644 --- a/src/main/resources/blocks.yml +++ b/src/main/resources/blocks.yml @@ -49,6 +49,7 @@ Mining: Data_Value: 0 XP_Gain: 99 Is_Ore: true + Tier: 1 Drop_Item: false Drop_Item_ID: 999 Drop_Item_Data_Value: 0 @@ -58,6 +59,7 @@ Mining: Data_Value: 0 XP_Gain: 99 Is_Ore: true + Tier: 1 Drop_Item: false Drop_Item_ID: 999 Drop_Item_Data_Value: 0