mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2024-12-22 16:05:03 +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/
|
|
@ -79,14 +79,12 @@ 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);
|
||||
// Try loading the player's data
|
||||
target = OpenInv.playerLoader.loadPlayer(name);
|
||||
|
||||
if (target == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Player " + name + " not found!");
|
||||
return true;
|
||||
}
|
||||
if (target == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Player " + name + " not found!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
@ -81,7 +73,7 @@ public class PlayerDataManager implements IPlayerDataManager {
|
|||
OfflinePlayer[] offlinePlayers = Bukkit.getOfflinePlayers();
|
||||
for (OfflinePlayer player : offlinePlayers) {
|
||||
String name = player.getName();
|
||||
|
||||
|
||||
if (name == null){
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -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