add single item crafting
This commit is contained in:
parent
5c68feedbb
commit
f6b036b517
9 changed files with 106 additions and 158 deletions
|
@ -2809,6 +2809,22 @@ public class Player extends User implements ICrafting, Executor, IPlayer
|
|||
if(this.isAdmin())
|
||||
this.profiling = false;
|
||||
break;
|
||||
|
||||
case CRAFT_ITEM: {
|
||||
if(this.entity.inventory.getItemStack() == null) {
|
||||
Slot slot = this.entity.openContainer.getSlot(packetIn.getAuxData());
|
||||
if(slot != null && slot.canCheatItem() && slot.getHasStack()) {
|
||||
ItemStack stack = this.entity.inventoryContainer.getSingleRecipe(slot.getStack());
|
||||
if(stack != null) {
|
||||
slot.putStack(this.entity.inventoryContainer.craftSingleRecipe(slot.getStack()));
|
||||
this.entity.inventory.setItemStack(stack);
|
||||
this.entity.openContainer.detectAndSendChanges();
|
||||
this.updateHeldItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("Ungültige Aktion!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue