mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2025-01-03 13:38:21 +00:00
Newest version 1.7.4
This commit is contained in:
parent
faed001041
commit
2c7655424c
4 changed files with 49 additions and 19 deletions
|
@ -4,7 +4,7 @@
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
<classpathentry combineaccessrules="false" kind="src" path="/Orebfuscator"/>
|
<classpathentry combineaccessrules="false" kind="src" path="/Orebfuscator"/>
|
||||||
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/bukkit.jar" sourcepath="D:/Dropbox/Projects/Workspace/Bukkit-Source.zip"/>
|
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/bukkit.jar" sourcepath="D:/Dropbox/Projects/Workspace/Bukkit-Source.zip"/>
|
||||||
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/craftbukkit.jar" sourcepath="D:/Dropbox/Projects/Workspace/craftbukkit.jar"/>
|
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/craftbukkit.jar" sourcepath="D:/Dropbox/Projects/Workspace/CraftBukkit-source.zip"/>
|
||||||
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/FakePermissions.jar"/>
|
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/FakePermissions.jar"/>
|
||||||
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/Spout.jar" sourcepath="D:/Dropbox/Projects/Workspace/Spout.zip"/>
|
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/Spout.jar" sourcepath="D:/Dropbox/Projects/Workspace/Spout.zip"/>
|
||||||
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/SpoutAPI.jar" sourcepath="D:/Dropbox/Projects/Workspace/SpoutAPI.zip"/>
|
<classpathentry kind="lib" path="D:/Dropbox/Projects/Workspace/SpoutAPI.jar" sourcepath="D:/Dropbox/Projects/Workspace/SpoutAPI.zip"/>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lishid.openinv.commands;
|
package lishid.openinv.commands;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import lishid.openinv.PermissionRelay;
|
import lishid.openinv.PermissionRelay;
|
||||||
|
@ -10,6 +11,7 @@ import net.minecraft.server.EntityPlayer;
|
||||||
import net.minecraft.server.ItemInWorldManager;
|
import net.minecraft.server.ItemInWorldManager;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
@ -79,25 +81,39 @@ public class OpenInvPluginCommand implements CommandExecutor {
|
||||||
//Offline inv here...
|
//Offline inv here...
|
||||||
try{
|
try{
|
||||||
//See if the player has data files
|
//See if the player has data files
|
||||||
if(!this.plugin.getServer().getOfflinePlayer(name).hasPlayedBefore())
|
|
||||||
|
// Find the player folder
|
||||||
|
File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players");
|
||||||
|
|
||||||
|
// Find player name
|
||||||
|
for (File playerfile : playerfolder.listFiles())
|
||||||
|
{
|
||||||
|
String filename = playerfile.getName();
|
||||||
|
String playername = filename.substring(0, filename.length() - 4);
|
||||||
|
|
||||||
|
if(playername.trim().equalsIgnoreCase(name))
|
||||||
|
{
|
||||||
|
//Create an entity to load the player data
|
||||||
|
MinecraftServer server = ((CraftServer)this.plugin.getServer()).getServer();
|
||||||
|
EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), playername, new ItemInWorldManager(server.getWorldServer(0)));
|
||||||
|
target = (entity == null) ? null : (Player) entity.getBukkitEntity();
|
||||||
|
if(target != null)
|
||||||
|
{
|
||||||
|
Offline = true;
|
||||||
|
target.loadData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!Offline)
|
||||||
{
|
{
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//Create an entity to load the player data
|
|
||||||
MinecraftServer server = ((CraftServer)this.plugin.getServer()).getServer();
|
|
||||||
EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), name, new ItemInWorldManager(server.getWorldServer(0)));
|
|
||||||
target = (entity == null) ? null : (Player) entity.getBukkitEntity();
|
|
||||||
if(target != null)
|
|
||||||
{
|
|
||||||
Offline = true;
|
|
||||||
target.loadData();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
package lishid.openinv.utils;
|
package lishid.openinv.utils;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Tyler Blair. All rights reserved.
|
* Copyright 2011 Tyler Blair. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -72,6 +71,12 @@ public class Metrics {
|
||||||
*/
|
*/
|
||||||
public abstract int getValue();
|
public abstract int getValue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called after the website graphs have been updated
|
||||||
|
*/
|
||||||
|
public void reset() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return getColumnName().hashCode() + getValue();
|
return getColumnName().hashCode() + getValue();
|
||||||
|
@ -92,7 +97,7 @@ public class Metrics {
|
||||||
/**
|
/**
|
||||||
* The metrics revision number
|
* The metrics revision number
|
||||||
*/
|
*/
|
||||||
private final static int REVISION = 3;
|
private final static int REVISION = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base url of the metrics domain
|
* The base url of the metrics domain
|
||||||
|
@ -242,6 +247,15 @@ public class Metrics {
|
||||||
|
|
||||||
if (response.startsWith("ERR")){
|
if (response.startsWith("ERR")){
|
||||||
throw new IOException(response); //Throw the exception
|
throw new IOException(response); //Throw the exception
|
||||||
|
} else {
|
||||||
|
// Is this the first update this hour?
|
||||||
|
if (response.contains("OK This is your first update this hour")) {
|
||||||
|
if (plotters != null) {
|
||||||
|
for (Plotter plotter : plotters) {
|
||||||
|
plotter.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//if (response.startsWith("OK")) - We should get "OK" followed by an optional description if everything goes right
|
//if (response.startsWith("OK")) - We should get "OK" followed by an optional description if everything goes right
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: OpenInv
|
name: OpenInv
|
||||||
main: lishid.openinv.OpenInv
|
main: lishid.openinv.OpenInv
|
||||||
version: 1.7.3
|
version: 1.7.4
|
||||||
author: lishid
|
author: lishid
|
||||||
website: http://forums.bukkit.org/threads/15379/
|
website: http://forums.bukkit.org/threads/15379/
|
||||||
description: >
|
description: >
|
||||||
|
|
Loading…
Reference in a new issue