nossr50 14 anni fa
parent
commit
f4ae7c8798

+ 10 - 0
mcMMO/Changelog.txt

@@ -1,5 +1,15 @@
 Changelog:
 #Versions without changelogs probably had very small misc fixes, like tweaks to the source code
+Version 1.1.04
+Removed URL settings for XPBAR/XPICON/HPBAR
+Added single URL setting for mcMMO
+Changed default host from Dropbox to Rycochet's webserver (with apparently unlimited bandwidth!, thanks Rycochet)
+Fixed Repair noise not getting played
+Fixed a small memory leak with party health bars
+
+Version 1.1.03
+Fixed a few images being hard-coded still rather than configurable
+
 Version 1.1.02
 Fixed bug where toggle for xpicon didn't work
 Fixed bug where Excavation gave gravel drops to grass

+ 3 - 9
mcMMO/com/gmail/nossr50/config/LoadProperties.java

@@ -6,7 +6,7 @@ import org.bukkit.util.config.Configuration;
 public class LoadProperties 
 {
 	public static Boolean xplockEnable, xpbar, xpicon, partybar, map, string, bucket, web, xprateEnable, slimeballs, spoutEnabled, donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
-	public static String xplock, repair_url, xpbar_url, xpicon_url, partybar_url, MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, xprate, mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp, party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond, locale;
+	public static String xplock, web_url, MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, xprate, mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp, party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond, locale;
 	public static int xpbar_x, xpbar_y, xpicon_x, xpicon_y, partybar_x, partybar_y, partybar_spacing, mmap, mstring, mbucket, mweb, archeryLimit, chimaeraId, msandstone, mcocoa, water_thunder, cure_self, cure_other, mslimeballs, mbones, msulphur, mslowsand, mmushroom2, mglowstone2, mmusic, mdiamond2, mbase, mapple, meggs, mcake, mpine, mbirch, mspruce, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier, superBreakerCooldown = 240, greenTerraCooldown = 240, gigaDrillBreakerCooldown = 240, treeFellerCooldown = 240, berserkCooldown = 240, serratedStrikeCooldown = 240, skullSplitterCooldown = 240, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, sorceryxpmodifier = 2, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier, rWood, rStone, rIron, rGold, rDiamond;
 	public String directory = "plugins/mcMMO/"; 
 	File file = new File(directory + File.separator + "config.yml");
@@ -79,19 +79,16 @@ public class LoadProperties
 	    	
 	        //Put in defaults
 	        write("Spout.XP.Bar.Enabled", true);
-	        write("Spout.XP.Bar.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
+	        write("Spout.Images.URL_DIR", "http://mcmmo.rycochet.net/mcmmo/");
 	        write("Spout.XP.Icon.Enabled", true);
-	        write("Spout.XP.Icon.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
 	        write("Spout.XP.Bar.X_POS", 95);
 	        write("Spout.XP.Bar.Y_POS", 6);
 	        write("Spout.XP.Icon.X_POS", 78);
 	        write("Spout.XP.Icon.Y_POS", 2);
 	        write("Spout.Party.HP.Enabled", true);
-	        write("Spout.Party.HP.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
 	        write("Spout.Party.HP.X_POS", -11);
 	        write("Spout.Party.HP.Y_POS", 0);
 	        write("Spout.Party.HP.SPACING", 16);
-	        write("Spout.SFX.Repair.URL", "http://dl.dropbox.com/u/18212134/xpbar/ui_armorweapon_repair.wav");
 	        
 	        write("MySQL.Enabled", false);
 	        write("MySQL.Server.Address", "localhost");
@@ -263,19 +260,16 @@ public class LoadProperties
 	        xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled", false);
 	        
 	        xpbar = readBoolean("Spout.XP.Bar.Enabled", true);
-	        xpbar_url = readString("Spout.XP.Bar.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
+	        web_url = readString("Spout.Images.URL_DIR", "http://mcmmo.rycochet.net/mcmmo/");
 	        xpicon = readBoolean("Spout.XP.Icon.Enabled", true);
-	        xpicon_url = readString("Spout.XP.Icon.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
 	        xpbar_x = readInteger("Spout.XP.Bar.X_POS", 95);
 	        xpbar_y = readInteger("Spout.XP.Bar.Y_POS", 6);
 	        xpicon_x = readInteger("Spout.XP.Icon.X_POS", 78);
 	        xpicon_y = readInteger("Spout.XP.Icon.Y_POS", 2);
 	        partybar = readBoolean("Spout.Party.HP.Enabled", true);
-	        partybar_url = readString("Spout.Party.HP.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
 	        partybar_x = readInteger("Spout.Party.HP.X_POS", -11);
 	        partybar_y = readInteger("Spout.Party.HP.Y_POS", 0);
 	        partybar_spacing = readInteger("Spout.Party.HP.SPACING", 16);
-	        repair_url = readString("Spout.SFX.Repair.URL", "http://dl.dropbox.com/u/18212134/xpbar/ui_armorweapon_repair.wav");
 	        
 	        msulphur = readInteger("XP.Excavation.Sulphur", 3);
 	        mbones = readInteger("XP.Excavation.Bones", 3);

+ 8 - 0
mcMMO/com/gmail/nossr50/datatypes/HUDType.java

@@ -0,0 +1,8 @@
+package com.gmail.nossr50.datatypes;
+
+public enum HUDType 
+{
+	STANDARD,
+	SMALL,
+	RETRO;
+}

+ 2 - 1
mcMMO/com/gmail/nossr50/listeners/mcPlayerListener.java

@@ -105,9 +105,10 @@ public class mcPlayerListener extends PlayerListener
 		{
 			if(SpoutStuff.xpbars.containsKey(event.getPlayer()))
 				SpoutStuff.xpbars.remove(event.getPlayer());
-			
 			if(SpoutStuff.xpicons.containsKey(event.getPlayer()))
 				SpoutStuff.xpicons.remove(event.getPlayer());
+			if(SpoutStuff.partyHealthBars.containsKey(event.getPlayer()))
+				SpoutStuff.partyHealthBars.remove(event.getPlayer());
 		}
 		
 		Users.removeUser(event.getPlayer());

+ 29 - 12
mcMMO/com/gmail/nossr50/spout/SpoutStuff.java

@@ -12,6 +12,7 @@ import org.bukkit.event.Event;
 import org.bukkit.event.Event.Priority;
 import org.getspout.spoutapi.SpoutManager;
 import org.getspout.spoutapi.gui.GenericTexture;
+import org.getspout.spoutapi.gui.RenderPriority;
 import org.getspout.spoutapi.gui.Widget;
 import org.getspout.spoutapi.player.SpoutPlayer;
 import org.getspout.spoutapi.sound.SoundEffect;
@@ -49,7 +50,7 @@ public class SpoutStuff
 		{
 			GenericTexture xpicon = new GenericTexture();
 			
-			xpicon.setUrl(LoadProperties.xpicon_url+"icon.png");
+			xpicon.setUrl(LoadProperties.web_url+"/HUD/Standard/icon.png");
 			
 			xpicon.setHeight(16).setWidth(32).setX(LoadProperties.xpicon_x).setY(LoadProperties.xpicon_y);
 			
@@ -58,7 +59,7 @@ public class SpoutStuff
 			sPlayer.getMainScreen().attachWidget(plugin, SpoutStuff.xpicons.get(sPlayer));
 		}
 		
-		xpbar.setUrl(LoadProperties.xpbar_url+"xpbar_inc000.png");
+		xpbar.setUrl(LoadProperties.web_url+"/HUD/Standard/xpbar_inc000.png");
 		xpbar.setX(LoadProperties.xpbar_x).setY(LoadProperties.xpbar_y).setHeight(8).setWidth(256);
 		
 		SpoutStuff.xpbars.put(sPlayer, xpbar);
@@ -68,15 +69,34 @@ public class SpoutStuff
 		
 		sPlayer.getMainScreen().setDirty(true);
 	}
+	public static void initializeXpBarMiniDisplay(SpoutPlayer sPlayer)
+	{
+		//Coordinates 240, 427 are the bottom right.
+		GenericTexture xpbar = new GenericTexture();
+		GenericTexture xpbar_fill = new GenericTexture();
+		
+		xpbar.setUrl("http://dl.dropbox.com/u/18212134/xpbar/mini/bar.png");
+		xpbar_fill.setUrl("http://dl.dropbox.com/u/18212134/xpbar/mini/bar_fill.png");
+		
+		xpbar.setWidth(128).setHeight(4).setX(149).setY(10).setDirty(true);
+		xpbar_fill.setWidth(2).setHeight(2).setX(150).setY(11).setPriority(RenderPriority.High).setDirty(true);
+		
+		SpoutStuff.xpbars.put(sPlayer, xpbar);
+		
+		sPlayer.getMainScreen().attachWidget(plugin, xpbar);
+		sPlayer.getMainScreen().attachWidget(plugin, xpbar_fill);
+		
+		sPlayer.getMainScreen().setDirty(true);
+	}
 	
 	public static String getHealthBarURL(Integer hp)
 	{
 		String url = "";
 		
 		if(hp.toString().toCharArray().length > 1)
-			url = LoadProperties.xpbar_url+"health_inc"+hp+".png";
+			url = LoadProperties.web_url+"/HUD/Standard/health_inc"+hp+".png";
 		else
-			url = LoadProperties.xpbar_url+"health_inc0"+hp+".png";
+			url = LoadProperties.web_url+"/HUD/Standard/health_inc0"+hp+".png";
 		
 		return url;
 	}
@@ -249,7 +269,7 @@ public class SpoutStuff
 	{
 		SoundManager SM = SpoutManager.getSoundManager();
 		SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
-		SM.playCustomMusic(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, LoadProperties.repair_url, false);
+		SM.playCustomMusic(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, LoadProperties.web_url+"/Sound/repair.wav", false);
 	}
 	public static void playLevelUpNoise(Player player)
 	{
@@ -547,20 +567,17 @@ public class SpoutStuff
 	{
 		if(number.toString().toCharArray().length == 1)
 		{
-			return "http://dl.dropbox.com/u/18212134/xpbar/xpbar_inc00"+number+".png";
-			//return "file:///C:/Users/Rob/Dropbox/Public/xpbar/xpbar_inc00"+number+".png";
+			return LoadProperties.web_url+"/HUD/Standard/xpbar_inc00"+number+".png";
 		} else if (number.toString().toCharArray().length == 2)
 		{
-			return "http://dl.dropbox.com/u/18212134/xpbar/xpbar_inc0"+number+".png";
-			//return "file:///C:/Users/Rob/Dropbox/Public/xpbar/xpbar_inc0"+number+".png";
+			return LoadProperties.web_url+"/HUD/Standard/xpbar_inc0"+number+".png";
 		} else {
-			return "http://dl.dropbox.com/u/18212134/xpbar/xpbar_inc"+number+".png";
-			//return "file:///C:/Users/Rob/Dropbox/Public/xpbar/xpbar_inc"+number+".png";
+			return LoadProperties.web_url+"/HUD/Standard/xpbar_inc"+number+".png";
 		}
 	}
 	public static String getUrlIcon(SkillType skillType)
 	{
-		return "http://dl.dropbox.com/u/18212134/xpbar/"+m.getCapitalized(skillType.toString())+".png";
+		return LoadProperties.web_url+"/HUD/Standard/"+m.getCapitalized(skillType.toString())+".png";
 	}
 	public static boolean shouldBeFilled(PlayerProfile PP)
 	{

+ 1 - 1
mcMMO/plugin.yml

@@ -1,6 +1,6 @@
 name: mcMMO
 main: com.gmail.nossr50.mcMMO
-version: 1.1.02
+version: 1.1.04
 softdepend: [Spout]
 commands:
     xplock: