Fixed silent chest issues

This commit is contained in:
lishid 2015-01-05 21:15:35 -05:00
parent 7d56a04283
commit bc709336e1
5 changed files with 20 additions and 27 deletions

14
.gitignore vendored
View file

@ -1,7 +1,9 @@
.classpath /.settings
.project /.gitignore
.idea /.project
/.classpath
/.idea
/bin
/lib
/out
*.iml *.iml
bin/
lib/
out/

View file

@ -78,7 +78,6 @@ public class OpenInvPluginCommand implements CommandExecutor {
target = this.plugin.getServer().getPlayer(name); target = this.plugin.getServer().getPlayer(name);
if (target == null) {
if (target == null) { if (target == null) {
// Try loading the player's data // Try loading the player's data
target = OpenInv.playerLoader.loadPlayer(name); target = OpenInv.playerLoader.loadPlayer(name);
@ -88,7 +87,6 @@ public class OpenInvPluginCommand implements CommandExecutor {
return true; return true;
} }
} }
}
// Permissions checks // Permissions checks
if (!OpenInv.hasPermission(player, Permissions.PERM_OVERRIDE) && OpenInv.hasPermission(target, Permissions.PERM_EXEMPT)) { if (!OpenInv.hasPermission(player, Permissions.PERM_OVERRIDE) && OpenInv.hasPermission(target, Permissions.PERM_EXEMPT)) {

View file

@ -16,8 +16,6 @@
package com.lishid.openinv.internal.v1_8_R1; package com.lishid.openinv.internal.v1_8_R1;
import java.io.File;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -41,12 +39,6 @@ public class PlayerDataManager implements IPlayerDataManager {
return null; return null;
} }
// Default player folder
File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "playerdata");
if (!playerfolder.exists()) {
return null;
}
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid); OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
if (player == null) { if (player == null) {
return null; return null;
@ -57,7 +49,7 @@ public class PlayerDataManager implements IPlayerDataManager {
EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), profile, new PlayerInteractManager(server.getWorldServer(0))); EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), profile, new PlayerInteractManager(server.getWorldServer(0)));
// Get the bukkit entity // Get the bukkit entity
Player target = (entity == null) ? null : entity.getBukkitEntity(); Player target = entity.getBukkitEntity();
if (target != null) { if (target != null) {
// Load data // Load data
target.loadData(); target.loadData();

View file

@ -71,12 +71,12 @@ public class SilentInventory implements ITileInventory {
@Override @Override
public void startOpen(EntityHuman entityHuman) { public void startOpen(EntityHuman entityHuman) {
inv.startOpen(entityHuman); //Don't do anything
} }
@Override @Override
public void closeContainer(EntityHuman entityHuman) { public void closeContainer(EntityHuman entityHuman) {
inv.closeContainer(entityHuman); //Don't do anything
} }
@Override @Override
@ -151,7 +151,8 @@ public class SilentInventory implements ITileInventory {
@Override @Override
public Container createContainer(PlayerInventory playerInventory, EntityHuman entityHuman) { public Container createContainer(PlayerInventory playerInventory, EntityHuman entityHuman) {
return inv.createContainer(playerInventory, entityHuman); //Don't let the chest itself create the container.
return new ContainerChest(playerInventory, this, entityHuman);
} }
@Override @Override

View file

@ -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.