mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
This should make us AntiCheat friendly.
This commit is contained in:
parent
6637758ad0
commit
e3e400f376
@ -8,6 +8,7 @@ Key:
|
||||
- Removal
|
||||
|
||||
Version 1.3.09
|
||||
+ Added compatibility with AntiCheat (Which I highly recommend to prevent cheating)
|
||||
+ Added several permission nodes to give individual users special perks (Double/Triple/Quadruple XP)
|
||||
+ Added API for plugins to add custom tools directly via Spout
|
||||
= Fixed issue with NoCheatPlus and Serrated Strikes / Skull Splitter (fight.noswing)
|
||||
|
@ -12,4 +12,4 @@ public class FakeBlockBreakEvent extends BlockBreakEvent {
|
||||
public FakeBlockBreakEvent(Block theBlock, Player player) {
|
||||
super(theBlock, player);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class FakeBlockDamageEvent extends BlockDamageEvent {
|
||||
|
||||
public FakeBlockDamageEvent(Player player, Block block,
|
||||
ItemStack itemInHand, boolean instaBreak) {
|
||||
super(player, block, itemInHand, instaBreak);
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
|
||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
||||
|
||||
@ -110,14 +111,15 @@ public class Misc {
|
||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(armswing);
|
||||
}
|
||||
|
||||
FakeBlockDamageEvent damageEvent = new FakeBlockDamageEvent(player, block, player.getItemInHand(), true);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(damageEvent);
|
||||
FakeBlockBreakEvent breakEvent = new FakeBlockBreakEvent(block, player);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(breakEvent);
|
||||
|
||||
FakeBlockBreakEvent event = new FakeBlockBreakEvent(block, player);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (!damageEvent.isCancelled() || !breakEvent.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user