Updates and Bugfixes

This commit is contained in:
GeorgH93 2015-09-17 15:10:00 +02:00
parent c12bfb006e
commit 95f6a4d09b
6 changed files with 40 additions and 24 deletions

5
.gitignore vendored
View File

@ -56,7 +56,4 @@ Temporary Items
/target/
/bin/
*.iml
/.idea/
jar_libs/bukkit.jar
/.idea/

View File

@ -43,6 +43,7 @@ Database:
# true: Only to use if your server is running in online mode and your minecraft version is 1.7.5 or newer
# false: In offline mode or for minecraft version below 1.7.5
# Should be configured automaticaly based on your minecraft version and online mode settings
# If you are using BungeeCord please set this setting based on your BungeeCord's online mode.
UseUUIDs: true
# Defines the storage format for UUIDs for compatibility with other plugins (shared tables)
# true: format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@ -74,5 +75,5 @@ Database:
# Enables/Disables the auto-update function of the plugin.
auto-update: true
# Config File Version. Don't touch it!
# Config file version. Don't touch it!
Version: 9

View File

@ -1,4 +1,3 @@
Version: 3
Language:
Console:
Enabled: MinePacks wurde aktiviert!
@ -6,16 +5,19 @@ Language:
NotFromConsole: Befehlt nicht von der Console aus verwendbar.
LangUpdated: Sprachdatei wurde aktualisiert.
UpdateUUIDs: Starte Datenbank Update auf UUIDs ...
UpdatedUUIDs: '%s Datensätze wurden auf UUIDs geupdated.'
UpdatedUUIDs: '%s Datens<EFBFBD>tze wurden auf UUIDs geupdated.'
Ingame:
NoPermission: 'Dir fehlen die Rechte dafür.'
NoPermission: 'Dir fehlen die Rechte daf<EFBFBD>r.'
OwnBackPackClose: 'Rucksack geschlossen!'
PlayerBackPackClose: "%s's Rucksack geschlossen!"
InvalidBackpack: Rucksack fehlerhaft.
BackpackCleaned: Rucksack gelehrt.
Cooldown: 'Bitte warte etwas bis du deinen Rucksack erneut öffnest.'
Cooldown: 'Bitte warte etwas bis du deinen Rucksack erneut <EFBFBD>ffnest.'
Description:
Backpack: Öffnet deinen Rucksack.
Backpack: <EFBFBD>ffnet deinen Rucksack.
Clean: Leert deinen Rucksack.
CleanOther: Leert den Rucksack von Spielern.
View: Zeigt den Rucksack von anderen Spielern.
View: Zeigt den Rucksack von anderen Spielern.
# Language file version. Don't touch it!
Version: 3

View File

@ -1,4 +1,3 @@
Version: 3
Language:
Console:
Enabled: MinePacks has been enabled!
@ -18,4 +17,7 @@ Language:
Backpack: Opens your backpack.
Clean: Cleans your backpack.
CleanOther: Cleans the backpack of other players.
View: Shows the backpack of other player.
View: Shows the backpack of other player.
# Language file version. Don't touch it!
Version: 3

View File

@ -37,26 +37,36 @@ public Config(JavaPlugin plugin)
@Override
protected boolean newConfigCreated()
{
config.set("Database.UseUUIDs", Bukkit.getServer().getOnlineMode() && isBukkitVersionUUIDCompatible());
return true;
config.set("Database.UseUUIDs", plugin.getServer().getOnlineMode() && isBukkitVersionUUIDCompatible());
return !(plugin.getServer().getOnlineMode() && isBukkitVersionUUIDCompatible());
}
@Override
protected void doUpdate(int version)
protected void doUpdate()
{
// Nothing to update yet
}
@Override
protected void doUpgrade(Configuration oldConfiguration)
protected void doUpgrade(Configuration oldConfig)
{
Set<String> keys = oldConfiguration.getConfig().getKeys(true);
Set<String> keys = oldConfig.getConfig().getKeys(true);
for(String key : keys)
{
if(key.equals("Database.UseUUIDs") || key.equals("UseUUIDs")) continue;
config.set(key, oldConfiguration.getConfig().get(key));
if(key.equals("UseUUIDs") || key.equals("Version")) continue;
config.set(key, oldConfig.getConfig().get(key));
}
if(!oldConfig.getConfig().isSet("Database.UseUUIDs"))
{
if(oldConfig.getConfig().isSet("UseUUIDs"))
{
config.set("Database.UseUUIDs", config.getBoolean("UseUUIDs"));
}
else
{
config.set("Database.UseUUIDs", Bukkit.getServer().getOnlineMode() && isBukkitVersionUUIDCompatible());
}
}
config.set("Database.UseUUIDs", Bukkit.getServer().getOnlineMode() && isBukkitVersionUUIDCompatible());
}
// Getter

View File

@ -33,9 +33,9 @@
public class MinePacks extends JavaPlugin
{
public final Logger log = getLogger();
public final Config config = new Config(this);
public final Language lang = new Language(this);
public Logger log;
public Config config;
public Language lang;
public Database DB;
public HashMap<Player, Long> cooldowns = new HashMap<>();
@ -46,6 +46,10 @@ public class MinePacks extends JavaPlugin
@Override
public void onEnable()
{
log = getLogger();
config = new Config(this);
lang = new Language(this);
lang.load(config.getLanguage(), config.getLanguageUpdateMode());
DB = Database.getDatabase(this);
getCommand("backpack").setExecutor(new OnCommand(this));