Newest version 1.7.4

This commit is contained in:
lishid 2012-02-06 13:13:54 -05:00
parent faed001041
commit 2c7655424c
4 changed files with 49 additions and 19 deletions

View file

@ -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 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/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/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"/>

View file

@ -1,5 +1,6 @@
package lishid.openinv.commands;
import java.io.File;
import java.util.HashMap;
import lishid.openinv.PermissionRelay;
@ -10,6 +11,7 @@ import net.minecraft.server.EntityPlayer;
import net.minecraft.server.ItemInWorldManager;
import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -79,25 +81,39 @@ public class OpenInvPluginCommand implements CommandExecutor {
//Offline inv here...
try{
//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!");
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)
{

View file

@ -1,5 +1,4 @@
package lishid.openinv.utils;
/*
* Copyright 2011 Tyler Blair. All rights reserved.
*
@ -72,6 +71,12 @@ public class Metrics {
*/
public abstract int getValue();
/**
* Called after the website graphs have been updated
*/
public void reset() {
}
@Override
public int hashCode() {
return getColumnName().hashCode() + getValue();
@ -92,7 +97,7 @@ public class Metrics {
/**
* The metrics revision number
*/
private final static int REVISION = 3;
private final static int REVISION = 4;
/**
* The base url of the metrics domain
@ -242,6 +247,15 @@ public class Metrics {
if (response.startsWith("ERR")){
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
}

View file

@ -1,6 +1,6 @@
name: OpenInv
main: lishid.openinv.OpenInv
version: 1.7.3
version: 1.7.4
author: lishid
website: http://forums.bukkit.org/threads/15379/
description: >