mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 09:26:08 +03:00
78 lines
2.7 KiB
Diff
78 lines
2.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java
|
|
@@ -1,7 +1,16 @@
|
|
package net.minecraft.entity.item;
|
|
|
|
+import java.util.List;
|
|
import java.util.Random;
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import net.minecraft.inventory.IInventory;
|
|
+import net.minecraft.world.*;
|
|
+import org.bukkit.Location;
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+import org.bukkit.inventory.InventoryHolder;
|
|
+
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.inventory.Container;
|
|
@@ -16,20 +25,50 @@
|
|
import net.minecraft.util.datafix.DataFixer;
|
|
import net.minecraft.util.datafix.FixTypes;
|
|
import net.minecraft.util.datafix.walkers.ItemStackDataLists;
|
|
-import net.minecraft.world.ILockableContainer;
|
|
-import net.minecraft.world.LockCode;
|
|
-import net.minecraft.world.World;
|
|
-import net.minecraft.world.WorldServer;
|
|
import net.minecraft.world.storage.loot.ILootContainer;
|
|
import net.minecraft.world.storage.loot.LootContext;
|
|
import net.minecraft.world.storage.loot.LootTable;
|
|
|
|
-public abstract class EntityMinecartContainer extends EntityMinecart implements ILockableContainer, ILootContainer
|
|
-{
|
|
- private ItemStack[] minecartContainerItems = new ItemStack[36];
|
|
+public abstract class EntityMinecartContainer extends EntityMinecart implements ILootContainer, IInventory, ILockableContainer, IInteractionObject {
|
|
+ private ItemStack[] minecartContainerItems = new ItemStack[27]; // CB - 36 -> 27
|
|
public boolean dropContentsWhenDead = true;
|
|
private ResourceLocation lootTable;
|
|
private long lootTableSeed;
|
|
+ // CraftBukkit start
|
|
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
|
+ private int maxStack = MAX_STACK;
|
|
+
|
|
+ public ItemStack[] getContents() {
|
|
+ return this.minecartContainerItems;
|
|
+ }
|
|
+
|
|
+ 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;
|
|
+ }
|
|
+
|
|
+ public void setMaxStackSize(int size) {
|
|
+ maxStack = size;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public Location getLocation() {
|
|
+ return getBukkitEntity().getLocation();
|
|
+ }
|
|
+ // CraftBukkit end
|
|
|
|
public EntityMinecartContainer(World worldIn)
|
|
{
|