Fix NoCheat conflict. Updated changelog.

Closes #104
This commit is contained in:
gmcferrin 2012-02-05 15:24:44 -05:00
parent 598c507849
commit 43e3dd7977
5 changed files with 49 additions and 4 deletions

View File

@ -2,6 +2,14 @@ Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Version 2.0-dev
- Fixed issue with receiving Woodcutting XP for all blocks broken (Issue #103)
- Fixed issue with Spout images & sounds not working (Issue #93)
- Fixed typo with repairing Leather Armor & Bows
- Fixed issue with Silk Touch & Double/Triple drops not working properly
- Fixed conflict with NoCheat plugin & Super Breaker/Giga Drill Breaker/Berserk/Leaf Blower (Issue #104)
- Fixed counter-attacking non-LivingEntity (Issue #100 & Issue #107)
- Added Monitor & ignoreCancelledEvents to onBlockPlace
- Made Anvil ID configurable
Version 1.2.09
- Fixed issue with Repair Mastery (Issue #47)

View File

@ -25,6 +25,7 @@ import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Statistic;
import org.bukkit.block.Block;
@ -36,6 +37,7 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer;
@ -58,7 +60,7 @@ public class mcBlockListener implements Listener
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockPlace(BlockPlaceEvent event)
{
{
if(event.isCancelled()) return;
//Setup some basic vars
@ -340,6 +342,9 @@ public class mcBlockListener implements Listener
&& mcPermissions.getInstance().unarmedAbility(player))
{
event.setInstaBreak(true);
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}

View File

@ -17,12 +17,16 @@
package com.gmail.nossr50.skills;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.player.PlayerAnimationEvent;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.Users;
@ -266,6 +270,8 @@ public class Excavation
if(block.getData() != (byte)5)
{
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);

View File

@ -16,6 +16,7 @@
*/
package com.gmail.nossr50.skills;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Statistic;
@ -24,6 +25,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.sound.SoundEffect;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.player.PlayerAnimationEvent;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
@ -277,10 +279,12 @@ public class Mining
//Pre-processing
int id = block.getTypeId();
int xp = 0;
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
//STONE
if(id == 1 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -288,6 +292,7 @@ public class Mining
//SANDSTONE
else if(id == 24 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.msandstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -295,6 +300,7 @@ public class Mining
//NETHERRACK
else if(id == 87 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mnetherrack;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -302,6 +308,7 @@ public class Mining
//GLOWSTONE
else if(id == 89 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mglowstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -309,6 +316,7 @@ public class Mining
//COAL
else if(id == 16 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mcoal;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -316,6 +324,7 @@ public class Mining
//GOLD
else if(id == 14 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mgold;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -323,6 +332,7 @@ public class Mining
//OBSIDIAN
else if(id == 49 && m.getTier(player) >= 4 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mobsidian;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -330,6 +340,7 @@ public class Mining
//DIAMOND
else if(id == 56 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mdiamond;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -337,6 +348,7 @@ public class Mining
//IRON
else if(id == 15 && m.getTier(player) >= 2 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.miron;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -344,6 +356,7 @@ public class Mining
//REDSTONE
else if((id == 73 || id == 74) && m.getTier(player) >= 3 && !plugin.misc.blockWatchList.contains(block))
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mredstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -351,6 +364,7 @@ public class Mining
//LAPIS
else if(id == 21 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mlapis;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -358,6 +372,7 @@ public class Mining
//NETHER BRICK
else if(id == 112 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mnetherbrick;
blockProcCheck(block, player);
blockProcCheck(block, player);
@ -365,18 +380,23 @@ public class Mining
//END STONE
else if(id == 121 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mendstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//MOSS STONE
else if(id == 48 && block.getData() != (byte) 5){
else if(id == 48 && block.getData() != (byte) 5)
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mmossstone;
blockProcCheck(block, player);
blockProcCheck(block, player);
}
//STONE BRICK
else if(id == 98 && !plugin.misc.blockWatchList.contains(block)){
else if(id == 98 && !plugin.misc.blockWatchList.contains(block))
{
Bukkit.getPluginManager().callEvent(armswing);
xp += LoadProperties.mstonebrick;
blockProcCheck(block, player);
blockProcCheck(block, player);

View File

@ -25,6 +25,8 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.Statistic;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.Bukkit;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
@ -201,7 +203,11 @@ public class WoodCutting
}
public static void leafBlower(Player player, Block block){
if(LoadProperties.toolsLoseDurabilityFromAbilities)
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);