mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2024-12-23 00:15:08 +00:00
Fixed silent chest issues
This commit is contained in:
parent
7d56a04283
commit
bc709336e1
5 changed files with 20 additions and 27 deletions
14
.gitignore
vendored
14
.gitignore
vendored
|
@ -1,7 +1,9 @@
|
|||
.classpath
|
||||
.project
|
||||
.idea
|
||||
/.settings
|
||||
/.gitignore
|
||||
/.project
|
||||
/.classpath
|
||||
/.idea
|
||||
/bin
|
||||
/lib
|
||||
/out
|
||||
*.iml
|
||||
bin/
|
||||
lib/
|
||||
out/
|
|
@ -78,7 +78,6 @@ public class OpenInvPluginCommand implements CommandExecutor {
|
|||
|
||||
target = this.plugin.getServer().getPlayer(name);
|
||||
|
||||
if (target == null) {
|
||||
if (target == null) {
|
||||
// Try loading the player's data
|
||||
target = OpenInv.playerLoader.loadPlayer(name);
|
||||
|
@ -88,7 +87,6 @@ public class OpenInvPluginCommand implements CommandExecutor {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Permissions checks
|
||||
if (!OpenInv.hasPermission(player, Permissions.PERM_OVERRIDE) && OpenInv.hasPermission(target, Permissions.PERM_EXEMPT)) {
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
package com.lishid.openinv.internal.v1_8_R1;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -41,12 +39,6 @@ public class PlayerDataManager implements IPlayerDataManager {
|
|||
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);
|
||||
if (player == 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)));
|
||||
|
||||
// Get the bukkit entity
|
||||
Player target = (entity == null) ? null : entity.getBukkitEntity();
|
||||
Player target = entity.getBukkitEntity();
|
||||
if (target != null) {
|
||||
// Load data
|
||||
target.loadData();
|
||||
|
|
|
@ -71,12 +71,12 @@ public class SilentInventory implements ITileInventory {
|
|||
|
||||
@Override
|
||||
public void startOpen(EntityHuman entityHuman) {
|
||||
inv.startOpen(entityHuman);
|
||||
//Don't do anything
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeContainer(EntityHuman entityHuman) {
|
||||
inv.closeContainer(entityHuman);
|
||||
//Don't do anything
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -151,7 +151,8 @@ public class SilentInventory implements ITileInventory {
|
|||
|
||||
@Override
|
||||
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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: OpenInv
|
||||
main: com.lishid.openinv.OpenInv
|
||||
version: 2.2.7
|
||||
version: 2.2.8
|
||||
author: lishid
|
||||
description: >
|
||||
This plugin allows you to open a player's inventory as a chest and interact with it in real time.
|
||||
|
|
Loading…
Reference in a new issue