mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 06:52:21 +00:00
Show recipe banner with overlay
This commit is contained in:
1 parent
1585aa8e55
commit
62e11d8caa
5 files changed
+52
-2
No files matched your search
@@ -11,6 +11,8 @@ import noppes.npcs.api.handler.data.IAnvilRecipe;
|
||||
import noppes.npcs.controllers.RecipeController;
|
||||
import noppes.npcs.controllers.data.RecipeAnvil;
|
||||
import noppes.npcs.scripted.event.RecipeScriptEvent;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.packets.data.script.ScriptOverlayClosePacket;
|
||||
|
||||
public class ContainerAnvilRepair extends Container {
|
||||
// A 2-slot crafting matrix: slot 0 = damaged item, slot 1 = repair material.
|
||||
@@ -212,6 +214,7 @@ public class ContainerAnvilRepair extends Container {
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
if (!this.worldObj.isRemote) {
|
||||
PacketHandler.Instance.sendToPlayer(new ScriptOverlayClosePacket(EventHooks.RECIPE_OVERLAY_ID), (EntityPlayerMP) player);
|
||||
for (int i = 0; i < this.anvilMatrix.getSizeInventory(); i++) {
|
||||
ItemStack stack = this.anvilMatrix.getStackInSlotOnClosing(i);
|
||||
if (stack != null) {
|
||||
@@ -228,6 +231,10 @@ public class ContainerAnvilRepair extends Container {
|
||||
(double) this.posZ + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
public boolean canPickupResult() {
|
||||
return this.resultCanPickup;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack copy = null;
|
||||
|
||||
Reference in new issue
Block a user