Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c0f513177a | ||
|
b3a3947b03 | ||
|
c7bab7d451 |
@@ -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;
|
||||||
@@ -79,7 +79,6 @@ public class OpenEnderPluginCommand implements CommandExecutor {
|
|||||||
name = args[0];
|
name = args[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.GREEN + "Starting inventory lookup.");
|
|
||||||
final UUID senderID = player.getUniqueId();
|
final UUID senderID = player.getUniqueId();
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@@ -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;
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.lishid.openinv.internal.v1_8_R2;
|
package com.lishid.openinv.internal.v1_8_R3;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -23,21 +23,21 @@ import com.lishid.openinv.OpenInv;
|
|||||||
import com.lishid.openinv.internal.IAnySilentChest;
|
import com.lishid.openinv.internal.IAnySilentChest;
|
||||||
|
|
||||||
//Volatile
|
//Volatile
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R2.Block;
|
import net.minecraft.server.v1_8_R3.Block;
|
||||||
import net.minecraft.server.v1_8_R2.BlockPosition;
|
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||||
import net.minecraft.server.v1_8_R2.EntityPlayer;
|
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||||
import net.minecraft.server.v1_8_R2.IInventory;
|
import net.minecraft.server.v1_8_R3.IInventory;
|
||||||
import net.minecraft.server.v1_8_R2.ITileInventory;
|
import net.minecraft.server.v1_8_R3.ITileInventory;
|
||||||
import net.minecraft.server.v1_8_R2.InventoryLargeChest;
|
import net.minecraft.server.v1_8_R3.InventoryLargeChest;
|
||||||
import net.minecraft.server.v1_8_R2.PacketPlayOutOpenWindow;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutOpenWindow;
|
||||||
import net.minecraft.server.v1_8_R2.TileEntityChest;
|
import net.minecraft.server.v1_8_R3.TileEntityChest;
|
||||||
import net.minecraft.server.v1_8_R2.World;
|
import net.minecraft.server.v1_8_R3.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));
|
@@ -14,7 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.lishid.openinv.internal.v1_8_R2;
|
package com.lishid.openinv.internal.v1_8_R3;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
@@ -25,14 +25,14 @@ import com.lishid.openinv.OpenInv;
|
|||||||
import com.lishid.openinv.Permissions;
|
import com.lishid.openinv.Permissions;
|
||||||
import com.lishid.openinv.internal.IInventoryAccess;
|
import com.lishid.openinv.internal.IInventoryAccess;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventory;
|
|
||||||
|
|
||||||
//Volatile
|
//Volatile
|
||||||
import net.minecraft.server.v1_8_R2.IInventory;
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_8_R3.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) {
|
@@ -14,7 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.lishid.openinv.internal.v1_8_R2;
|
package com.lishid.openinv.internal.v1_8_R3;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -27,16 +27,16 @@ import com.lishid.openinv.OpenInv;
|
|||||||
import com.lishid.openinv.internal.IPlayerDataManager;
|
import com.lishid.openinv.internal.IPlayerDataManager;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
|
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R2.EntityPlayer;
|
|
||||||
//Volatile
|
//Volatile
|
||||||
import net.minecraft.server.v1_8_R2.MinecraftServer;
|
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||||
import net.minecraft.server.v1_8_R2.PlayerInteractManager;
|
|
||||||
|
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||||
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
|
import net.minecraft.server.v1_8_R3.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;
|
||||||
}
|
}
|
@@ -14,12 +14,12 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.lishid.openinv.internal.v1_8_R2;
|
package com.lishid.openinv.internal.v1_8_R3;
|
||||||
|
|
||||||
//Volatile
|
//Volatile
|
||||||
import net.minecraft.server.v1_8_R2.ContainerChest;
|
import net.minecraft.server.v1_8_R3.ContainerChest;
|
||||||
import net.minecraft.server.v1_8_R2.EntityHuman;
|
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||||
import net.minecraft.server.v1_8_R2.IInventory;
|
import net.minecraft.server.v1_8_R3.IInventory;
|
||||||
|
|
||||||
public class SilentContainerChest extends ContainerChest {
|
public class SilentContainerChest extends ContainerChest {
|
||||||
public IInventory inv;
|
public IInventory inv;
|
@@ -14,7 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.lishid.openinv.internal.v1_8_R2;
|
package com.lishid.openinv.internal.v1_8_R3;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -28,16 +28,16 @@ import org.bukkit.inventory.InventoryHolder;
|
|||||||
import com.lishid.openinv.OpenInv;
|
import com.lishid.openinv.OpenInv;
|
||||||
import com.lishid.openinv.internal.ISpecialEnderChest;
|
import com.lishid.openinv.internal.ISpecialEnderChest;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftHumanEntity;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventory;
|
|
||||||
|
|
||||||
//Volatile
|
//Volatile
|
||||||
import net.minecraft.server.v1_8_R2.EntityHuman;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHumanEntity;
|
||||||
import net.minecraft.server.v1_8_R2.IInventory;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
import net.minecraft.server.v1_8_R2.InventoryEnderChest;
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory;
|
||||||
import net.minecraft.server.v1_8_R2.InventorySubcontainer;
|
|
||||||
import net.minecraft.server.v1_8_R2.ItemStack;
|
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||||
|
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 net.minecraft.server.v1_8_R3.ItemStack;
|
||||||
|
|
||||||
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
|
public class SpecialEnderChest extends InventorySubcontainer implements IInventory, ISpecialEnderChest {
|
||||||
public List<HumanEntity> transaction = new ArrayList<HumanEntity>();
|
public List<HumanEntity> transaction = new ArrayList<HumanEntity>();
|
||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -14,7 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.lishid.openinv.internal.v1_8_R2;
|
package com.lishid.openinv.internal.v1_8_R3;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
@@ -23,13 +23,13 @@ import com.lishid.openinv.OpenInv;
|
|||||||
import com.lishid.openinv.internal.ISpecialPlayerInventory;
|
import com.lishid.openinv.internal.ISpecialPlayerInventory;
|
||||||
|
|
||||||
//Volatile
|
//Volatile
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftHumanEntity;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHumanEntity;
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventory;
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R2.EntityHuman;
|
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||||
import net.minecraft.server.v1_8_R2.ItemStack;
|
import net.minecraft.server.v1_8_R3.ItemStack;
|
||||||
import net.minecraft.server.v1_8_R2.PlayerInventory;
|
import net.minecraft.server.v1_8_R3.PlayerInventory;
|
||||||
|
|
||||||
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
|
public class SpecialPlayerInventory extends PlayerInventory implements ISpecialPlayerInventory {
|
||||||
CraftPlayer owner;
|
CraftPlayer owner;
|
@@ -1,6 +1,6 @@
|
|||||||
name: OpenInv
|
name: OpenInv
|
||||||
main: com.lishid.openinv.OpenInv
|
main: com.lishid.openinv.OpenInv
|
||||||
version: 2.2.7
|
version: 2.2.8
|
||||||
author: lishid
|
author: lishid
|
||||||
description: >
|
description: >
|
||||||
This plugin allows you to open a player's inventory as a chest and interact with it in real time.
|
This plugin allows you to open a player's inventory as a chest and interact with it in real time.
|
||||||
|
Reference in New Issue
Block a user