mirror of
https://github.com/kiranhart/Auction-House.git
synced 2024-11-26 06:05:25 +01:00
Meteor Client Dupe Fix regarding crafting packet
Took 1 minute
This commit is contained in:
parent
0e8cc591cf
commit
fce9b5b753
@ -25,10 +25,26 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.event.inventory.PrepareItemCraftEvent;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public final class MeteorClientListeners implements Listener {
|
public final class MeteorClientListeners implements Listener {
|
||||||
|
|
||||||
|
static boolean isCancelled = false;
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onCraftDuringSell(final PrepareItemCraftEvent event) {
|
||||||
|
final Player player = (Player) event.getView().getPlayer();
|
||||||
|
|
||||||
|
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player) && !isCancelled) {
|
||||||
|
isCancelled = true;
|
||||||
|
event.getInventory().setMatrix(new ItemStack[0]);
|
||||||
|
event.getInventory().setResult(null);
|
||||||
|
isCancelled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerPlaceItemIntoFrame(final PlayerInteractEntityEvent event) {
|
public void onPlayerPlaceItemIntoFrame(final PlayerInteractEntityEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
@ -42,16 +58,14 @@ public final class MeteorClientListeners implements Listener {
|
|||||||
public void onItemDropDuringSell(final PlayerDropItemEvent event) {
|
public void onItemDropDuringSell(final PlayerDropItemEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player))
|
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player)) event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onHotbarSwapDuringSell(final PlayerItemHeldEvent event) {
|
public void onHotbarSwapDuringSell(final PlayerItemHeldEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player))
|
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player)) event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -78,8 +92,7 @@ public final class MeteorClientListeners implements Listener {
|
|||||||
public void onCommandDuringSell(final PlayerCommandPreprocessEvent event) {
|
public void onCommandDuringSell(final PlayerCommandPreprocessEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player))
|
if (AuctionHouse.getInstance().getAuctionPlayerManager().isInSellProcess(player)) event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
Loading…
Reference in New Issue
Block a user