Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-29 09:30:07 +01:00
71 Zeilen
2.6 KiB
Diff
71 Zeilen
2.6 KiB
Diff
--- a/net/minecraft/server/ContainerFurnace.java
|
|
+++ b/net/minecraft/server/ContainerFurnace.java
|
|
@@ -1,5 +1,10 @@
|
|
package net.minecraft.server;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
+// CraftBukkit end
|
|
+
|
|
public abstract class ContainerFurnace extends ContainerRecipeBook<IInventory> {
|
|
|
|
private final IInventory furnace;
|
|
@@ -7,6 +12,22 @@
|
|
protected final World c;
|
|
private final Recipes<? extends RecipeCooking> f;
|
|
|
|
+ // CraftBukkit start
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
+ private PlayerInventory player;
|
|
+
|
|
+ @Override
|
|
+ public CraftInventoryView getBukkitView() {
|
|
+ if (bukkitEntity != null) {
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+
|
|
+ CraftInventoryFurnace inventory = new CraftInventoryFurnace((TileEntityFurnace) this.furnace);
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
protected ContainerFurnace(Containers<?> containers, Recipes<? extends RecipeCooking> recipes, int i, PlayerInventory playerinventory) {
|
|
this(containers, recipes, i, playerinventory, new InventorySubcontainer(3), new ContainerProperties(4));
|
|
}
|
|
@@ -22,6 +43,7 @@
|
|
this.a(new Slot(iinventory, 0, 56, 17));
|
|
this.a((Slot) (new SlotFurnaceFuel(this, iinventory, 1, 56, 53)));
|
|
this.a((Slot) (new SlotFurnaceResult(playerinventory.player, iinventory, 2, 116, 35)));
|
|
+ this.player = playerinventory; // CraftBukkit - save player
|
|
|
|
int j;
|
|
|
|
@@ -53,7 +75,7 @@
|
|
|
|
@Override
|
|
public void a(boolean flag, IRecipe<?> irecipe, EntityPlayer entityplayer) {
|
|
- (new AutoRecipeFurnace<>(this)).a(entityplayer, irecipe, flag);
|
|
+ (new AutoRecipeFurnace(this)).a(entityplayer, irecipe, flag); // CraftBukkit - decompile error
|
|
}
|
|
|
|
@Override
|
|
@@ -78,6 +100,7 @@
|
|
|
|
@Override
|
|
public boolean canUse(EntityHuman entityhuman) {
|
|
+ if (!this.checkReachable) return true; // CraftBukkit
|
|
return this.furnace.a(entityhuman);
|
|
}
|
|
|
|
@@ -133,7 +156,7 @@
|
|
}
|
|
|
|
protected boolean a(ItemStack itemstack) {
|
|
- return this.c.getCraftingManager().craft(this.f, new InventorySubcontainer(new ItemStack[]{itemstack}), this.c).isPresent();
|
|
+ return this.c.getCraftingManager().craft((Recipes<RecipeCooking>) this.f, new InventorySubcontainer(new ItemStack[]{itemstack}), this.c).isPresent(); // Eclipse fail
|
|
}
|
|
|
|
protected boolean b(ItemStack itemstack) {
|