From 7190bb247263607d84b8025a4f161deb958fb035 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 20 Aug 2011 22:58:25 -0700 Subject: [PATCH] version 1.1.09 --- mcMMO/Changelog.txt | 9 ++++++++ .../gmail/nossr50/config/LoadProperties.java | 23 +++---------------- .../nossr50/datatypes/PlayerProfile.java | 2 +- .../listeners/mcSpoutInputListener.java | 3 +-- mcMMO/com/gmail/nossr50/mcMMO.java | 1 + mcMMO/com/gmail/nossr50/skills/Repair.java | 16 ++++++------- mcMMO/com/gmail/nossr50/spout/SpoutStuff.java | 21 +++++++++++++++++ mcMMO/plugin.yml | 2 +- 8 files changed, 45 insertions(+), 32 deletions(-) diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index e7cd2b2cf..db9b8a07b 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,5 +1,14 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code +Version 1.1.09 +Fixed mcMMO to run fine without Spout :) + +Version 1.1.08 +Fixed repair being 10x slower to level than normal + +Version 1.1.07 +Fixed the default HUD being set to RETRO instead of STANDARD + Version 1.1.06 mcMMO menu implemented! Default is 'M', change this in config Retro HUD implemented! diff --git a/mcMMO/com/gmail/nossr50/config/LoadProperties.java b/mcMMO/com/gmail/nossr50/config/LoadProperties.java index 0ca5454c0..c29e66e82 100644 --- a/mcMMO/com/gmail/nossr50/config/LoadProperties.java +++ b/mcMMO/com/gmail/nossr50/config/LoadProperties.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.config; import java.io.File; import org.bukkit.util.config.Configuration; -import org.getspout.spoutapi.keyboard.Keyboard; public class LoadProperties { @@ -34,10 +33,8 @@ public class LoadProperties public String directory = "plugins/mcMMO/"; - public static Keyboard keypress; - File file = new File(directory + File.separator + "config.yml"); - Configuration config = null; + static Configuration config = null; public void configCheck() { @@ -87,13 +84,14 @@ public class LoadProperties return result; } - private String readString(String root, String def) + public static String readString(String root, String def) { //Configuration config = load(); String result = config.getString(root, def); config.save(); return result; } + private Configuration load() { try { @@ -329,21 +327,6 @@ public class LoadProperties { System.out.println("Loading Config File..."); - String temp = readString("Spout.Menu.Key", "KEY_M"); - - for(Keyboard x : Keyboard.values()) - { - if(x.toString().equalsIgnoreCase(temp)) - { - keypress = x; - } - } - - if(keypress == null) - { - System.out.println("Invalid KEY for Spout.Menu.Key, using KEY_M"); - keypress = Keyboard.KEY_M; - } donateMessage = readBoolean("Commands.mcmmo.Donate_Message", true); xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled", false); diff --git a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java index e62d9839b..266e85b6d 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -24,7 +24,7 @@ public class PlayerProfile protected final Logger log = Logger.getLogger("Minecraft"); //HUD - private HUDType hud = HUDType.RETRO; + private HUDType hud = HUDType.STANDARD; //MISC private String party, myspawn, myspawnworld, invite; diff --git a/mcMMO/com/gmail/nossr50/listeners/mcSpoutInputListener.java b/mcMMO/com/gmail/nossr50/listeners/mcSpoutInputListener.java index 0e8dd1a75..01710d681 100644 --- a/mcMMO/com/gmail/nossr50/listeners/mcSpoutInputListener.java +++ b/mcMMO/com/gmail/nossr50/listeners/mcSpoutInputListener.java @@ -7,7 +7,6 @@ import org.getspout.spoutapi.player.SpoutPlayer; import com.gmail.nossr50.Users; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.popups.PopupMMO; import com.gmail.nossr50.spout.SpoutStuff; @@ -29,7 +28,7 @@ public class mcSpoutInputListener extends InputListener SpoutPlayer sPlayer = event.getPlayer(); - if(event.getKey() == LoadProperties.keypress) + if(event.getKey() == SpoutStuff.keypress) { if(!SpoutStuff.playerScreens.containsKey(sPlayer)) { diff --git a/mcMMO/com/gmail/nossr50/mcMMO.java b/mcMMO/com/gmail/nossr50/mcMMO.java index 2731510a4..ea9bc37c5 100644 --- a/mcMMO/com/gmail/nossr50/mcMMO.java +++ b/mcMMO/com/gmail/nossr50/mcMMO.java @@ -137,6 +137,7 @@ public class mcMMO extends JavaPlugin //Spout Stuff if(LoadProperties.spoutEnabled) { + SpoutStuff.setupSpoutConfigs(); SpoutStuff.registerCustomEvent(); } diff --git a/mcMMO/com/gmail/nossr50/skills/Repair.java b/mcMMO/com/gmail/nossr50/skills/Repair.java index 97aeeadfc..46d3dab14 100644 --- a/mcMMO/com/gmail/nossr50/skills/Repair.java +++ b/mcMMO/com/gmail/nossr50/skills/Repair.java @@ -53,7 +53,7 @@ public class Repair { durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * 6); //Boost XP - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); //CLANG CLANG if(LoadProperties.spoutEnabled) @@ -68,7 +68,7 @@ public class Repair { durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * 2); //Boost XP - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); //CLANG CLANG if(LoadProperties.spoutEnabled) @@ -80,7 +80,7 @@ public class Repair { durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * 4); //Boost XP of Gold to around Iron - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); //CLANG CLANG if(LoadProperties.spoutEnabled) @@ -110,7 +110,7 @@ public class Repair { //STONE NERF dif = (short) (dif / 2); - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); } else if(isWoodTools(is) && hasItem(player,rWood)){ removeItem(player,rWood); /* @@ -128,7 +128,7 @@ public class Repair { //WOOD NERF dif = (short) (dif / 2); - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); } else if(isIronTools(is) && hasItem(player, rIron)){ removeItem(player, rIron); /* @@ -143,7 +143,7 @@ public class Repair { dif = (short) (dif / 2); if(m.isHoe(is)) dif = (short) (dif / 2); - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); //CLANG CLANG if(LoadProperties.spoutEnabled) @@ -162,7 +162,7 @@ public class Repair { dif = (short) (dif / 2); if(m.isHoe(is)) dif = (short) (dif / 2); - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); //CLANG CLANG if(LoadProperties.spoutEnabled) @@ -179,7 +179,7 @@ public class Repair { dif = (short) (dif / 2); if(m.isHoe(is)) dif = (short) (dif / 2); - PP.addXP(SkillType.REPAIR, dif); + PP.addXP(SkillType.REPAIR, dif*10); //CLANG CLANG if(LoadProperties.spoutEnabled) diff --git a/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java b/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java index e95bb8df2..e4c81a3ae 100644 --- a/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java +++ b/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java @@ -13,6 +13,7 @@ import org.bukkit.event.Event.Priority; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.gui.Color; import org.getspout.spoutapi.gui.Widget; +import org.getspout.spoutapi.keyboard.Keyboard; import org.getspout.spoutapi.player.SpoutPlayer; import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundManager; @@ -44,6 +45,26 @@ public class SpoutStuff public static HashMap> partyHealthBars = new HashMap>(); public static HashMap playerScreens = new HashMap(); + public static Keyboard keypress; + + public static void setupSpoutConfigs() + { + String temp = LoadProperties.readString("Spout.Menu.Key", "KEY_M"); + + for(Keyboard x : Keyboard.values()) + { + if(x.toString().equalsIgnoreCase(temp)) + { + keypress = x; + } + } + + if(keypress == null) + { + System.out.println("Invalid KEY for Spout.Menu.Key, using KEY_M"); + keypress = Keyboard.KEY_M; + } + } public static void registerCustomEvent() { Bukkit.getServer().getPluginManager().registerEvent(Event.Type.CUSTOM_EVENT, spoutListener, Priority.Normal, plugin); diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index 315fc8d59..1f13ae7b6 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,6 +1,6 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 1.1.06 +version: 1.1.09 softdepend: [Spout] commands: mchud: