Created
June 23, 2013 23:23
-
-
Save mooman219/5846908 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void a(Packet102WindowClick packet102windowclick) { | |
... | |
// TODO check on updates | |
Container oldContainer = player.activeContainer; // Cow | |
if (packet102windowclick.shift != 5) { | |
if (click == ClickType.NUMBER_KEY) { | |
event = new InventoryClickEvent(inventory, type, packet102windowclick.slot, click, action, packet102windowclick.button); | |
} else { | |
event = new InventoryClickEvent(inventory, type, packet102windowclick.slot, click, action); | |
} | |
org.bukkit.inventory.Inventory top = inventory.getTopInventory(); | |
if (packet102windowclick.slot == 0 && top instanceof CraftingInventory) { | |
org.bukkit.inventory.Recipe recipe = ((CraftingInventory) top).getRecipe(); | |
if (recipe != null) { | |
if (click == ClickType.NUMBER_KEY) { | |
event = new CraftItemEvent(recipe, inventory, type, packet102windowclick.slot, click, action, packet102windowclick.button); | |
} else { | |
event = new CraftItemEvent(recipe, inventory, type, packet102windowclick.slot, click, action); | |
} | |
} | |
} | |
server.getPluginManager().callEvent(event); | |
// Cow | |
if(!oldContainer.equals(this.player.activeContainer)) { | |
event.setResult(Result.DENY); | |
} | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment