Revert API changes, fix SpecialPlayerInventory implementation

This commit is contained in:
Jikoo 2019-05-05 12:40:47 -04:00
parent e4d0020296
commit 185f037254
51 changed files with 121 additions and 1091 deletions

View file

@ -17,20 +17,18 @@
package com.lishid.openinv.internal;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface ISpecialEnderChest {
/**
* Gets the InventoryView associated with this ISpecialEnderChest.
* Gets the Inventory associated with this ISpecialEnderChest.
*
* @param viewer the Player opening the ISpecialEnderChest
* @return the InventoryView
* @return the Inventory
*/
@NotNull
InventoryView getBukkitView(@Nullable Player viewer);
Inventory getBukkitInventory();
/**
* Sets the Player associated with this ISpecialEnderChest online.

View file

@ -17,20 +17,18 @@
package com.lishid.openinv.internal;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface ISpecialPlayerInventory {
/**
* Gets the InventoryView associated with this ISpecialPlayerInventory.
* Gets the Inventory associated with this ISpecialPlayerInventory.
*
* @param viewer the Player opening the ISpecialPlayerInventory
* @return the InventoryView
* @return the Inventory
*/
@NotNull
InventoryView getBukkitView(@Nullable Player viewer);
Inventory getBukkitInventory();
/**
* Sets the Player associated with this ISpecialPlayerInventory online.

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_4_5.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_4_5.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -55,27 +53,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_4_5.ItemStack;
import net.minecraft.server.v1_4_5.PlayerInventory;
import org.bukkit.craftbukkit.v1_4_5.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_4_6.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -55,27 +53,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_4_6.ItemStack;
import net.minecraft.server.v1_4_6.PlayerInventory;
import org.bukkit.craftbukkit.v1_4_6.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -25,11 +25,8 @@ import net.minecraft.server.v1_10_R1.InventoryEnderChest;
import net.minecraft.server.v1_10_R1.InventorySubcontainer;
import net.minecraft.server.v1_10_R1.ItemStack;
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -69,27 +66,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
}
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -23,11 +23,8 @@ import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.ItemStack;
import net.minecraft.server.v1_10_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -79,27 +76,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
}
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -26,11 +26,8 @@ import net.minecraft.server.v1_11_R1.InventoryEnderChest;
import net.minecraft.server.v1_11_R1.InventorySubcontainer;
import net.minecraft.server.v1_11_R1.ItemStack;
import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -70,27 +67,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
}
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -26,11 +26,8 @@ import net.minecraft.server.v1_11_R1.ItemStack;
import net.minecraft.server.v1_11_R1.NonNullList;
import net.minecraft.server.v1_11_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -81,27 +78,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
}
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -26,11 +26,8 @@ import net.minecraft.server.v1_12_R1.InventoryEnderChest;
import net.minecraft.server.v1_12_R1.InventorySubcontainer;
import net.minecraft.server.v1_12_R1.ItemStack;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer
@ -51,27 +48,9 @@ public class SpecialEnderChest extends InventorySubcontainer
this.setItemLists(this, this.enderChest.getContents());
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -26,11 +26,8 @@ import net.minecraft.server.v1_12_R1.ItemStack;
import net.minecraft.server.v1_12_R1.NonNullList;
import net.minecraft.server.v1_12_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -50,27 +47,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
return true;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -26,11 +26,8 @@ import net.minecraft.server.v1_13_R1.InventoryEnderChest;
import net.minecraft.server.v1_13_R1.InventorySubcontainer;
import net.minecraft.server.v1_13_R1.ItemStack;
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer
@ -48,27 +45,9 @@ public class SpecialEnderChest extends InventorySubcontainer
this.setItemLists(this, this.enderChest.getContents());
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -28,11 +28,8 @@ import net.minecraft.server.v1_13_R1.ItemStack;
import net.minecraft.server.v1_13_R1.NonNullList;
import net.minecraft.server.v1_13_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -52,27 +49,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
return true;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -35,52 +35,29 @@ import org.bukkit.craftbukkit.v1_13_R2.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest implements IInventory, ISpecialEnderChest, AutoRecipeOutput {
private EntityPlayer owner;
private final IChatBaseComponent displayName;
private final CraftInventory inventory;
private NonNullList<ItemStack> items;
private final CraftInventory inventory = new CraftInventory(this);
private boolean playerOnline;
public SpecialEnderChest(final Player player, final Boolean online) {
this.owner = PlayerDataManager.getHandle(player);
this.displayName = this.owner.getEnderChest().getDisplayName();
this.playerOnline = online;
this.inventory = new CraftInventory(this);
this.items = this.owner.getEnderChest().items;
this.playerOnline = online;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@NotNull
@Override
public Inventory getTopInventory() {
return inventory;
}
@NotNull
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@NotNull
@Override
public HumanEntity getPlayer() {
return viewer;
}
@NotNull
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return this.inventory;
}
@Override

View file

@ -47,10 +47,8 @@ import org.bukkit.craftbukkit.v1_13_R2.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -88,31 +86,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
return true;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@NotNull
@Override
public Inventory getTopInventory() {
return inventory;
}
@NotNull
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@NotNull
@Override
public HumanEntity getPlayer() {
return viewer;
}
@NotNull
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -31,10 +31,8 @@ import org.bukkit.craftbukkit.v1_14_R1.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventoryEnderChest implements ISpecialEnderChest {
@ -52,36 +50,9 @@ public class SpecialEnderChest extends InventoryEnderChest implements ISpecialEn
this.items = this.owner.getEnderChest().items;
}
@NotNull
@Override
public InventoryView getBukkitView(Player viewer) {
return new InventoryView() {
@NotNull
@Override
public Inventory getTopInventory() {
return inventory;
}
@NotNull
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@NotNull
@Override
public HumanEntity getPlayer() {
return viewer;
}
@NotNull
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
@NotNull
@Override
public String getTitle() {
return viewer != null && viewer.equals(owner.getBukkitEntity()) ? InventoryType.ENDER_CHEST.getDefaultTitle() : owner.getName() + "'s Ender Chest";
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -22,7 +22,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import net.minecraft.server.v1_14_R1.AutoRecipeStackManager;
import net.minecraft.server.v1_14_R1.ChatMessage;
import net.minecraft.server.v1_14_R1.ContainerUtil;
@ -51,12 +50,12 @@ import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
private final CraftInventory inventory = new CraftInventory(this);
private final CraftInventory inventory;
private boolean playerOnline;
private EntityHuman player;
private NonNullList<ItemStack> items, armor, extraSlots;
@ -64,7 +63,15 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
public SpecialPlayerInventory(final Player bukkitPlayer, final Boolean online) {
super(PlayerDataManager.getHandle(bukkitPlayer));
this.inventory = new CraftInventory(this) {
@NotNull
@Override
public InventoryType getType() {
return InventoryType.CHEST;
}
};
this.playerOnline = online;
this.player = super.player;
this.items = this.player.inventory.items;
this.armor = this.player.inventory.armor;
this.extraSlots = this.player.inventory.extraSlots;
@ -72,7 +79,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
}
@Override
public void setPlayerOnline(@org.jetbrains.annotations.NotNull final Player player) {
public void setPlayerOnline(@NotNull final Player player) {
if (!this.playerOnline) {
EntityPlayer entityPlayer = PlayerDataManager.getHandle(player);
entityPlayer.inventory.transaction.addAll(this.transaction);
@ -90,36 +97,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
return true;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@NotNull
@Override
public Inventory getTopInventory() {
return inventory;
}
@NotNull
@Override
public Inventory getBottomInventory() {
return viewer == null ? player.getBukkitEntity().getInventory() : viewer.getInventory();
}
@NotNull
@Override
public HumanEntity getPlayer() {
return viewer == null ? player.getBukkitEntity() : viewer;
}
@NotNull
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
@NotNull
@Override
public String getTitle() {
return (player.getName() != null ? player.getName() : player.getUniqueID().toString()) + "'s Inventory";
}
};
public @NotNull Inventory getBukkitInventory() {
return this.inventory;
}
@Override
@ -182,7 +162,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
@Override
public int getSize() {
return super.getSize() + 4;
return 45;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -55,27 +53,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_4_R1.ItemStack;
import net.minecraft.server.v1_4_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_5_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_5_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_5_R2.ItemStack;
import net.minecraft.server.v1_5_R2.PlayerInventory;
import org.bukkit.craftbukkit.v1_5_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_5_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_5_R3.ItemStack;
import net.minecraft.server.v1_5_R3.PlayerInventory;
import org.bukkit.craftbukkit.v1_5_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_6_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_6_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_6_R1.ItemStack;
import net.minecraft.server.v1_6_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_6_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_6_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_6_R2.ItemStack;
import net.minecraft.server.v1_6_R2.PlayerInventory;
import org.bukkit.craftbukkit.v1_6_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_6_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_6_R3.ItemStack;
import net.minecraft.server.v1_6_R3.PlayerInventory;
import org.bukkit.craftbukkit.v1_6_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_7_R1.ItemStack;
import net.minecraft.server.v1_7_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_7_R2.ItemStack;
import net.minecraft.server.v1_7_R2.PlayerInventory;
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_7_R3.ItemStack;
import net.minecraft.server.v1_7_R3.PlayerInventory;
import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -30,10 +30,8 @@ import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -56,27 +54,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_7_R4.ItemStack;
import net.minecraft.server.v1_7_R4.PlayerInventory;
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -23,11 +23,8 @@ import net.minecraft.server.v1_8_R1.IInventory;
import net.minecraft.server.v1_8_R1.InventoryEnderChest;
import net.minecraft.server.v1_8_R1.InventorySubcontainer;
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -47,27 +44,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_8_R1.ItemStack;
import net.minecraft.server.v1_8_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -23,11 +23,8 @@ import net.minecraft.server.v1_8_R2.IInventory;
import net.minecraft.server.v1_8_R2.InventoryEnderChest;
import net.minecraft.server.v1_8_R2.InventorySubcontainer;
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -47,27 +44,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_8_R2.ItemStack;
import net.minecraft.server.v1_8_R2.PlayerInventory;
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -23,11 +23,8 @@ import net.minecraft.server.v1_8_R3.IInventory;
import net.minecraft.server.v1_8_R3.InventoryEnderChest;
import net.minecraft.server.v1_8_R3.InventorySubcontainer;
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -47,27 +44,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -20,11 +20,8 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
import net.minecraft.server.v1_8_R3.ItemStack;
import net.minecraft.server.v1_8_R3.PlayerInventory;
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -40,27 +37,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.armor = player.inventory.armor;
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -23,11 +23,8 @@ import net.minecraft.server.v1_9_R1.IInventory;
import net.minecraft.server.v1_9_R1.InventoryEnderChest;
import net.minecraft.server.v1_9_R1.InventorySubcontainer;
import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -47,27 +44,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -22,11 +22,8 @@ import java.lang.reflect.Modifier;
import net.minecraft.server.v1_9_R1.ItemStack;
import net.minecraft.server.v1_9_R1.PlayerInventory;
import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -78,27 +75,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
}
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -23,11 +23,8 @@ import net.minecraft.server.v1_9_R2.IInventory;
import net.minecraft.server.v1_9_R2.InventoryEnderChest;
import net.minecraft.server.v1_9_R2.InventorySubcontainer;
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
@ -47,27 +44,9 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
this.items = enderChest.getContents();
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.ENDER_CHEST;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -22,11 +22,8 @@ import java.lang.reflect.Modifier;
import net.minecraft.server.v1_9_R2.ItemStack;
import net.minecraft.server.v1_9_R2.PlayerInventory;
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
@ -78,27 +75,9 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
}
}
@NotNull
@Override
public InventoryView getBukkitView(final Player viewer) {
return new InventoryView() {
@Override
public Inventory getTopInventory() {
return inventory;
}
@Override
public Inventory getBottomInventory() {
return viewer.getInventory();
}
@Override
public HumanEntity getPlayer() {
return viewer;
}
@Override
public InventoryType getType() {
return InventoryType.PLAYER;
}
};
public @NotNull Inventory getBukkitInventory() {
return inventory;
}
@Override

View file

@ -91,7 +91,7 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
// Check if inventory is stored, and if it is, remove it and eject all viewers
if (OpenInv.this.inventories.containsKey(key)) {
Inventory inv = OpenInv.this.inventories.remove(key).getBukkitView(null).getTopInventory();
Inventory inv = OpenInv.this.inventories.remove(key).getBukkitInventory();
List<HumanEntity> viewers = inv.getViewers();
for (HumanEntity entity : viewers.toArray(new HumanEntity[0])) {
entity.closeInventory();
@ -100,7 +100,7 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
// Check if ender chest is stored, and if it is, remove it and eject all viewers
if (OpenInv.this.enderChests.containsKey(key)) {
Inventory inv = OpenInv.this.enderChests.remove(key).getBukkitView(null).getTopInventory();
Inventory inv = OpenInv.this.enderChests.remove(key).getBukkitInventory();
List<HumanEntity> viewers = inv.getViewers();
for (HumanEntity entity : viewers.toArray(new HumanEntity[0])) {
entity.closeInventory();
@ -131,7 +131,7 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
}
if (this.inventories.containsKey(key)) {
Iterator<HumanEntity> iterator = this.inventories.get(key).getBukkitView(null).getTopInventory().getViewers().iterator();
Iterator<HumanEntity> iterator = this.inventories.get(key).getBukkitInventory().getViewers().iterator();
while (iterator.hasNext()) {
HumanEntity human = iterator.next();
// If player has permission or is in the same world, allow continued access
@ -145,7 +145,7 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
}
if (this.enderChests.containsKey(key)) {
Iterator<HumanEntity> iterator = this.enderChests.get(key).getBukkitView(null).getTopInventory().getViewers().iterator();
Iterator<HumanEntity> iterator = this.enderChests.get(key).getBukkitInventory().getViewers().iterator();
while (iterator.hasNext()) {
HumanEntity human = iterator.next();
if (Permissions.CROSSWORLD.hasPermission(human) || human.getWorld() == null

View file

@ -142,7 +142,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
}
// Open the inventory
player.openInventory(chest.getBukkitView(player));
player.openInventory(chest.getBukkitInventory());
}
}

View file

@ -151,7 +151,7 @@ public class OpenInvPluginCommand implements CommandExecutor {
}
// Open the inventory
player.openInventory(inv.getBukkitView(player));
player.openInventory(inv.getBukkitInventory());
}
}