mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
8cbaba0a8a
By: Julian van den Berkmortel <julianvdberkmortel@outlook.com>
42 lines
1.8 KiB
Diff
42 lines
1.8 KiB
Diff
--- a/net/minecraft/world/inventory/ContainerAnvilAbstract.java
|
|
+++ b/net/minecraft/world/inventory/ContainerAnvilAbstract.java
|
|
@@ -11,13 +11,7 @@
|
|
public abstract class ContainerAnvilAbstract extends Container {
|
|
|
|
protected final InventoryCraftResult resultInventory = new InventoryCraftResult();
|
|
- protected final IInventory repairInventory = new InventorySubcontainer(2) {
|
|
- @Override
|
|
- public void update() {
|
|
- super.update();
|
|
- ContainerAnvilAbstract.this.a((IInventory) this);
|
|
- }
|
|
- };
|
|
+ protected final IInventory repairInventory; // CraftBukkit - instantiate repairInventory in the constructor
|
|
protected final ContainerAccess containerAccess;
|
|
protected final EntityHuman player;
|
|
|
|
@@ -31,6 +25,15 @@
|
|
super(containers, i);
|
|
this.containerAccess = containeraccess;
|
|
this.player = playerinventory.player;
|
|
+ // CraftBukkit start
|
|
+ this.repairInventory = new InventoryCrafting(this, 1, 2, player) {
|
|
+ @Override
|
|
+ public void update() {
|
|
+ super.update();
|
|
+ ContainerAnvilAbstract.this.a((IInventory) this);
|
|
+ }
|
|
+ };
|
|
+ // CraftBukkit end
|
|
this.a(new Slot(this.repairInventory, 0, 27, 47));
|
|
this.a(new Slot(this.repairInventory, 1, 76, 47));
|
|
this.a(new Slot(this.resultInventory, 2, 134, 47) {
|
|
@@ -85,6 +88,7 @@
|
|
|
|
@Override
|
|
public boolean canUse(EntityHuman entityhuman) {
|
|
+ if (!this.checkReachable) return true; // CraftBukkit
|
|
return (Boolean) this.containerAccess.a((world, blockposition) -> {
|
|
return !this.a(world.getType(blockposition)) ? false : entityhuman.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) <= 64.0D;
|
|
}, true);
|