mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 21:09:40 +00:00
Merge pull request #181 from KAMKEEL/codex/fix-item-duplication-on-pre-event-cancel
Fix recipe pre-event duplication bug
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -282,6 +282,7 @@ public class ContainerAnvilRepair extends Container {
|
||||
canPickup = !EventHooks.onRecipeScriptPre(player, recipe.getScriptHandler(), recipe, items);
|
||||
if (!canPickup) {
|
||||
container.updateRepairResult();
|
||||
preChecked = false; // reset for next attempt
|
||||
}
|
||||
} else {
|
||||
canPickup = true;
|
||||
|
||||
@@ -147,8 +147,8 @@ public class ContainerCarpentryBench extends Container {
|
||||
}
|
||||
|
||||
// Update client-side inventory
|
||||
if (!this.worldObj.isRemote && player instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP) player).sendContainerToPlayer(this);
|
||||
if (!this.worldObj.isRemote && par1EntityPlayer instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP) par1EntityPlayer).sendContainerToPlayer(this);
|
||||
}
|
||||
|
||||
return var2;
|
||||
@@ -183,6 +183,7 @@ public class ContainerCarpentryBench extends Container {
|
||||
canPickup = !EventHooks.onRecipeScriptPre(player, recipe.getScriptHandler(), recipe, items);
|
||||
if (!canPickup) {
|
||||
container.onCraftMatrixChanged(matrix);
|
||||
preChecked = false; // reset for next attempt
|
||||
}
|
||||
} else {
|
||||
canPickup = true;
|
||||
|
||||
Reference in new issue
Block a user