diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch new file mode 100644 index 0000000000..31135f280a --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch @@ -0,0 +1,74 @@ +--- a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java ++++ b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +@@ -16,6 +17,13 @@ + import net.minecraft.world.inventory.AbstractContainerMenu; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.Level; ++// CraftBukkit start ++import java.util.List; ++import org.bukkit.Location; ++import org.bukkit.craftbukkit.entity.CraftHumanEntity; ++import org.bukkit.entity.HumanEntity; ++import org.bukkit.inventory.InventoryHolder; ++// CraftBukkit end + + public abstract class AbstractMinecartContainer extends AbstractMinecart implements ContainerEntity { + private NonNullList<ItemStack> itemStacks = NonNullList.withSize(36, ItemStack.EMPTY); +@@ -23,12 +32,55 @@ + private ResourceLocation lootTable; + private long lootTableSeed; + ++ // CraftBukkit start ++ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); ++ private int maxStack = MAX_STACK; ++ ++ public List<ItemStack> getContents() { ++ return this.itemStacks; ++ } ++ ++ public void onOpen(CraftHumanEntity who) { ++ transaction.add(who); ++ } ++ ++ public void onClose(CraftHumanEntity who) { ++ transaction.remove(who); ++ } ++ ++ public List<HumanEntity> getViewers() { ++ return transaction; ++ } ++ ++ public InventoryHolder getOwner() { ++ org.bukkit.entity.Entity cart = getBukkitEntity(); ++ if(cart instanceof InventoryHolder) return (InventoryHolder) cart; ++ return null; ++ } ++ ++ @Override ++ public int getMaxStackSize() { ++ return maxStack; ++ } ++ ++ public void setMaxStackSize(int size) { ++ maxStack = size; ++ } ++ ++ @Override ++ public Location getLocation() { ++ return getBukkitEntity().getLocation(); ++ } ++ // CraftBukkit end ++ + protected AbstractMinecartContainer(EntityType<?> entityType, Level level) { + super(entityType, level); ++ this.itemStacks = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY); // CraftBukkit - SPIGOT-3513 + } + +- protected AbstractMinecartContainer(EntityType<?> entityType, double x, double y, double z, Level level) { +- super(entityType, level, x, y, z); ++ protected AbstractMinecartContainer(EntityType<?> entityType, double x, double d1, double y, Level world) { ++ super(entityType, world, x, d1, y); ++ this.itemStacks = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY); // CraftBukkit - SPIGOT-3513 + } + + @Override |