mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 14:42:22 -07:00
net/minecraft/world + Tadpole?
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
--- a/net/minecraft/world/CompoundContainer.java
|
||||
+++ b/net/minecraft/world/CompoundContainer.java
|
||||
@@ -7,6 +_,48 @@
|
||||
private final Container container1;
|
||||
private final Container container2;
|
||||
|
||||
+ // Paper start - add fields and methods
|
||||
+ public java.util.List<org.bukkit.entity.HumanEntity> transaction = new java.util.ArrayList<org.bukkit.entity.HumanEntity>();
|
||||
+
|
||||
+ public java.util.List<ItemStack> getContents() {
|
||||
+ java.util.List<ItemStack> result = new java.util.ArrayList<>(this.getContainerSize());
|
||||
+ for (int i = 0; i < this.getContainerSize(); i++) {
|
||||
+ result.add(this.getItem(i));
|
||||
+ }
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ public void onOpen(org.bukkit.craftbukkit.entity.CraftHumanEntity who) {
|
||||
+ this.container1.onOpen(who);
|
||||
+ this.container2.onOpen(who);
|
||||
+ this.transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(org.bukkit.craftbukkit.entity.CraftHumanEntity who) {
|
||||
+ this.container1.onClose(who);
|
||||
+ this.container2.onClose(who);
|
||||
+ this.transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public java.util.List<org.bukkit.entity.HumanEntity> getViewers() {
|
||||
+ return this.transaction;
|
||||
+ }
|
||||
+
|
||||
+ public org.bukkit.inventory.InventoryHolder getOwner() {
|
||||
+ return null; // This method won't be called since CraftInventoryDoubleChest doesn't defer to here
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size) {
|
||||
+ this.container1.setMaxStackSize(size);
|
||||
+ this.container2.setMaxStackSize(size);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public org.bukkit.Location getLocation() {
|
||||
+ return this.container1.getLocation(); // TODO: right?
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public CompoundContainer(Container container1, Container container2) {
|
||||
this.container1 = container1;
|
||||
this.container2 = container2;
|
||||
@@ -58,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
- return this.container1.getMaxStackSize();
|
||||
+ return Math.min(this.container1.getMaxStackSize(), this.container2.getMaxStackSize()); // Paper - check both sides
|
||||
}
|
||||
|
||||
@Override
|
Reference in New Issue
Block a user