From 0111d992eb14791eb8fccadb8e03eb7e1f5a05e8 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 11 Mar 2011 23:51:08 -0800 Subject: [PATCH] All changes up to 0.8.21 --- mcMMO/Changelog.txt | 4 ++++ mcMMO/com/gmail/nossr50/mcBlockListener.java | 9 +++++++++ mcMMO/com/gmail/nossr50/mcCombat.java | 15 --------------- mcMMO/com/gmail/nossr50/mcMMO.java | 1 + mcMMO/com/gmail/nossr50/mcPlayerListener.java | 4 ---- mcMMO/plugin.yml | 2 +- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index 22ddd8cec..f9554b5b0 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,5 +1,9 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code# +Version 0.8.21 + Fixed bug where axe criticals would dupe items +Version 0.8.20 + 99.99% sure I fixed anvils that suddenly stop working Version 0.8.19 Fixed being able to excavate placed blocks Added toggle option to mining requiring a pickaxe diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index 0e73a87d9..2629e9950 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -12,6 +12,7 @@ import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.BlockListener; import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.BlockRightClickEvent; import org.bukkit.inventory.ItemStack; public class mcBlockListener extends BlockListener { @@ -34,6 +35,14 @@ public class mcBlockListener extends BlockListener { if(block.getTypeId() == 42 && mcLoadProperties.anvilmessages) event.getPlayer().sendMessage(ChatColor.DARK_RED+"You have placed an anvil, anvils can repair tools and armor."); } + public void onBlockRightClick(BlockRightClickEvent event) { + Block block = event.getBlock(); + Player player = event.getPlayer(); + ItemStack is = player.getItemInHand(); + if(block != null && player != null && mcPermissions.getInstance().repair(player) && block.getTypeId() == 42){ + mcRepair.getInstance().repairCheck(player, is, block); + } + } //put all Block related code here public void onBlockDamage(BlockDamageEvent event) { //STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2); diff --git a/mcMMO/com/gmail/nossr50/mcCombat.java b/mcMMO/com/gmail/nossr50/mcCombat.java index 9b930a275..d2a443d2d 100644 --- a/mcMMO/com/gmail/nossr50/mcCombat.java +++ b/mcMMO/com/gmail/nossr50/mcCombat.java @@ -757,21 +757,6 @@ public class mcCombat { } } } - if(x instanceof Player){ - Player defender = (Player)x; - if(defender.getHealth()<= 0 && !mcUsers.getProfile(defender).isDead()){ - mcUsers.getProfile(defender).setDead(true); - event.setCancelled(true); //SEE IF THIS HELPS - for(ItemStack herp : defender.getInventory().getContents()){ - if(herp != null && herp.getTypeId() != 0) - defender.getLocation().getWorld().dropItemNaturally(defender.getLocation(), herp); - } - for(Player derp : plugin.getServer().getOnlinePlayers()){ - derp.sendMessage(ChatColor.GRAY+attacker.getName() + " has " +ChatColor.DARK_RED+"chopped "+ChatColor.GRAY+defender.getName() + " to death."); - mcUsers.getProfile(defender).setDead(true); - } - } - } } } public void parryCheck(Player defender, EntityDamageByEntityEvent event, Entity y){ diff --git a/mcMMO/com/gmail/nossr50/mcMMO.java b/mcMMO/com/gmail/nossr50/mcMMO.java index 1c713c7b5..ecbabd32a 100644 --- a/mcMMO/com/gmail/nossr50/mcMMO.java +++ b/mcMMO/com/gmail/nossr50/mcMMO.java @@ -77,6 +77,7 @@ public class mcMMO extends JavaPlugin { pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_ITEM_HELD, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Normal, this); + pm.registerEvent(Event.Type.BLOCK_RIGHTCLICKED, blockListener, Priority.Normal, this); //pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this); //Displays a message when plugin is loaded PluginDescriptionFile pdfFile = this.getDescription(); diff --git a/mcMMO/com/gmail/nossr50/mcPlayerListener.java b/mcMMO/com/gmail/nossr50/mcPlayerListener.java index cc09e62bc..2482c2b3e 100644 --- a/mcMMO/com/gmail/nossr50/mcPlayerListener.java +++ b/mcMMO/com/gmail/nossr50/mcPlayerListener.java @@ -91,10 +91,6 @@ public class mcPlayerListener extends PlayerListener { //STEW, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS mcHerbalism.getInstance().stewCheck(player, is); } - if(block != null && player != null && mcPermissions.getInstance().repair(player) && block.getTypeId() == 42){ - //REPAIRCHECK, CHECKS TO MAKE SURE PLAYER IS RIGHT CLICKING AN ANVIL, PLAYER HAS ENOUGH RESOURCES, AND THE ITEM IS NOT AT FULL DURABILITY. - mcRepair.getInstance().repairCheck(player, is, block); - } } public void onPlayerCommandPreprocess(PlayerChatEvent event){ Player player = event.getPlayer(); diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index 22fb745a4..a3acd4756 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,3 +1,3 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 0.8.19 \ No newline at end of file +version: 0.8.20 \ No newline at end of file