Reintroduce full OpenInv #20
@@ -43,7 +43,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
|
sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
|
||||||
return true;
|
return true;
|
||||||
|
@@ -43,7 +43,7 @@ public class OpenInvPluginCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
|
sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
|
||||||
return true;
|
return true;
|
||||||
|
@@ -37,7 +37,7 @@ import net.minecraft.server.v1_8_R2.World;
|
|||||||
|
|
||||||
public class AnySilentChest implements IAnySilentChest {
|
public class AnySilentChest implements IAnySilentChest {
|
||||||
@Override
|
@Override
|
||||||
public boolean IsAnyChestNeeded(Player p, int x, int y, int z) {
|
public boolean IsAnyChestNeeded(Player p, int x, int y, int z) {
|
||||||
// FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest
|
// FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest
|
||||||
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
@@ -61,7 +61,7 @@ public class AnySilentChest implements IAnySilentChest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean ActivateChest(Player p, boolean anychest, boolean silentchest, int x, int y, int z) {
|
public boolean ActivateChest(Player p, boolean anychest, boolean silentchest, int x, int y, int z) {
|
||||||
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
Object chest = world.getTileEntity(new BlockPosition(x, y, z));
|
Object chest = world.getTileEntity(new BlockPosition(x, y, z));
|
||||||
|
@@ -32,7 +32,7 @@ import net.minecraft.server.v1_8_R2.IInventory;
|
|||||||
|
|
||||||
public class InventoryAccess implements IInventoryAccess {
|
public class InventoryAccess implements IInventoryAccess {
|
||||||
@Override
|
@Override
|
||||||
public boolean check(Inventory inventory, HumanEntity player) {
|
public boolean check(Inventory inventory, HumanEntity player) {
|
||||||
IInventory inv = grabInventory(inventory);
|
IInventory inv = grabInventory(inventory);
|
||||||
|
|
||||||
if (inv instanceof SpecialPlayerInventory) {
|
if (inv instanceof SpecialPlayerInventory) {
|
||||||
|
@@ -36,7 +36,7 @@ import net.minecraft.server.v1_8_R2.PlayerInteractManager;
|
|||||||
|
|
||||||
public class PlayerDataManager implements IPlayerDataManager {
|
public class PlayerDataManager implements IPlayerDataManager {
|
||||||
@Override
|
@Override
|
||||||
public Player loadPlayer(String name) {
|
public Player loadPlayer(String name) {
|
||||||
try {
|
try {
|
||||||
UUID uuid = matchUser(name);
|
UUID uuid = matchUser(name);
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
@@ -110,7 +110,7 @@ public class PlayerDataManager implements IPlayerDataManager {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Player loadPlayer(UUID uuid) {
|
public Player loadPlayer(UUID uuid) {
|
||||||
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
|
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
|
||||||
if (player == null || !player.hasPlayedBefore()) {
|
if (player == null || !player.hasPlayedBefore()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -57,12 +57,12 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Inventory getBukkitInventory() {
|
public Inventory getBukkitInventory() {
|
||||||
return inventory;
|
return inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void InventoryRemovalCheck() {
|
public void InventoryRemovalCheck() {
|
||||||
owner.saveData();
|
owner.saveData();
|
||||||
if (transaction.isEmpty() && !playerOnline) {
|
if (transaction.isEmpty() && !playerOnline) {
|
||||||
OpenInv.enderChests.remove(owner.getName().toLowerCase());
|
OpenInv.enderChests.remove(owner.getName().toLowerCase());
|
||||||
@@ -70,7 +70,7 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void PlayerGoOnline(Player p) {
|
public void PlayerGoOnline(Player p) {
|
||||||
if (!playerOnline) {
|
if (!playerOnline) {
|
||||||
try {
|
try {
|
||||||
InventoryEnderChest playerEnderChest = ((CraftPlayer) p).getHandle().getEnderChest();
|
InventoryEnderChest playerEnderChest = ((CraftPlayer) p).getHandle().getEnderChest();
|
||||||
@@ -85,48 +85,48 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void PlayerGoOffline() {
|
public void PlayerGoOffline() {
|
||||||
playerOnline = false;
|
playerOnline = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack[] getContents() {
|
public ItemStack[] getContents() {
|
||||||
return this.items;
|
return this.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOpen(CraftHumanEntity who) {
|
public void onOpen(CraftHumanEntity who) {
|
||||||
transaction.add(who);
|
transaction.add(who);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClose(CraftHumanEntity who) {
|
public void onClose(CraftHumanEntity who) {
|
||||||
transaction.remove(who);
|
transaction.remove(who);
|
||||||
this.InventoryRemovalCheck();
|
this.InventoryRemovalCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HumanEntity> getViewers() {
|
public List<HumanEntity> getViewers() {
|
||||||
return transaction;
|
return transaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InventoryHolder getOwner() {
|
public InventoryHolder getOwner() {
|
||||||
return this.owner;
|
return this.owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMaxStackSize(int size) {
|
public void setMaxStackSize(int size) {
|
||||||
maxStack = size;
|
maxStack = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackSize() {
|
public int getMaxStackSize() {
|
||||||
return maxStack;
|
return maxStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean a(EntityHuman entityhuman) {
|
public boolean a(EntityHuman entityhuman) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
enderChest.update();
|
enderChest.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user