Răsfoiți Sursa

Version 1.0.02

nossr50 14 ani în urmă
părinte
comite
6425feb177

+ 8 - 0
mcMMO/Changelog.txt

@@ -1,5 +1,13 @@
 Changelog:
 #Versions without changelogs probably had very small misc fixes, like tweaks to the source code
+Version 1.1.02
+Fixed bug where toggle for xpicon didn't work
+Fixed bug where Excavation gave gravel drops to grass
+Excavation now uses more enums
+
+Version 1.1.01
+Fixed toggles for hpbar/xpbar not working
+
 Version 1.1.0
 Brand new XP Bars, Health bars, and Skill Icons designed by BrandonXP
 Added /xplock <skillname> to lock the xp bar to a skill

+ 4 - 4
mcMMO/com/gmail/nossr50/command/Commands.java

@@ -1149,7 +1149,7 @@ public class Commands
 				Pinstance.addToParty(player, PP, PP.getParty(), true);
 				
 				//Refresh party hp bars
-				if(LoadProperties.spoutEnabled)
+				if(LoadProperties.partybar && LoadProperties.spoutEnabled)
 				{
 					SpoutStuff.resetPartyHealthBarDisplays(Party.getInstance().getPartyMembers(player));
 					SpoutStuff.resetPartyHealthBarDisplays(player);
@@ -1176,7 +1176,7 @@ public class Commands
 				Pinstance.addToParty(player, PP, PP.getParty(), false);
 				
 				//Refresh party hp bars
-				if(LoadProperties.spoutEnabled)
+				if(LoadProperties.partybar && LoadProperties.spoutEnabled)
 				{
 					SpoutStuff.resetPartyHealthBarDisplays(Party.getInstance().getPartyMembers(player));
 					SpoutStuff.resetPartyHealthBarDisplays(player);
@@ -1288,7 +1288,7 @@ public class Commands
 						Pinstance.removeFromParty(player, PP);
 						
 						//Refresh party hp bars
-						if(LoadProperties.spoutEnabled)
+						if(LoadProperties.partybar && LoadProperties.spoutEnabled)
 						{
 							SpoutStuff.resetPartyHealthBarDisplays(partymembers);
 							SpoutStuff.resetPartyHealthBarDisplays(player);
@@ -1348,7 +1348,7 @@ public class Commands
 								Pinstance.removeFromParty(tPlayer, tPP);
 								
 								//Refresh party hp bars
-								if(LoadProperties.spoutEnabled)
+								if(LoadProperties.partybar && LoadProperties.spoutEnabled)
 								{
 									SpoutStuff.resetPartyHealthBarDisplays(partymembers);
 									SpoutStuff.resetPartyHealthBarDisplays(player);

+ 2 - 2
mcMMO/com/gmail/nossr50/listeners/mcBlockListener.java

@@ -238,7 +238,7 @@ public class mcBlockListener extends BlockListener
     	 * EXCAVATION
     	 */
     	if(Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 5)
-    		Excavation.excavationProcCheck(block.getData(), block.getTypeId(), block.getLocation(), player);
+    		Excavation.excavationProcCheck(block.getData(), block.getType(), block.getLocation(), player);
     	/*
     	 * HERBALISM
     	 */
@@ -310,7 +310,7 @@ public class mcBlockListener extends BlockListener
     		while(x < 3)
     		{
     			if(block.getData() != (byte)5)
-    				Excavation.excavationProcCheck(block.getData(), block.getTypeId(), block.getLocation(), player);
+    				Excavation.excavationProcCheck(block.getData(), block.getType(), block.getLocation(), player);
     			x++;
     		}
     		

+ 1 - 1
mcMMO/com/gmail/nossr50/listeners/mcEntityListener.java

@@ -143,7 +143,7 @@ public class mcEntityListener extends EntityListener
 			    			Users.getProfile(herpderp).setRecentlyHurt(System.currentTimeMillis());
 			    		}
 			    		
-			    		if(LoadProperties.spoutEnabled && Users.getProfile(herpderp).inParty())
+			    		if(LoadProperties.partybar && LoadProperties.spoutEnabled && Users.getProfile(herpderp).inParty())
 			    			SpoutStuff.updatePartyHealthBarDisplay(herpderp, herpderp.getHealth()-event.getDamage());
 			    	}
 		    	}

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

@@ -77,7 +77,7 @@ public class mcPlayerListener extends PlayerListener
 				}
 			}
 		}
-		if(LoadProperties.spoutEnabled && PP.inParty())
+		if(LoadProperties.partybar && LoadProperties.spoutEnabled && PP.inParty())
 		{
 			SpoutStuff.updatePartyHealthBarDisplay(player, 20);
 		}

+ 4 - 2
mcMMO/com/gmail/nossr50/listeners/mcSpoutListener.java

@@ -5,6 +5,7 @@ import org.getspout.spoutapi.event.spout.SpoutListener;
 import org.getspout.spoutapi.player.SpoutPlayer;
 
 import com.gmail.nossr50.Users;
+import com.gmail.nossr50.config.LoadProperties;
 import com.gmail.nossr50.spout.SpoutStuff;
 
 public class mcSpoutListener extends SpoutListener
@@ -15,11 +16,12 @@ public class mcSpoutListener extends SpoutListener
 		if(sPlayer.isSpoutCraftEnabled())
 		{
 			//Setup Party HUD stuff
-			if(Users.getProfile(sPlayer).inParty())
+			if(LoadProperties.partybar && Users.getProfile(sPlayer).inParty())
 				SpoutStuff.initializePartyTracking(sPlayer);
 			
 			//Setup player XP-Bar & XP-Icon
-			SpoutStuff.initializeXpBarDisplay(sPlayer);
+			if(LoadProperties.xpbar)
+				SpoutStuff.initializeXpBarDisplay(sPlayer);
 		}
 	}
 }

+ 3 - 3
mcMMO/com/gmail/nossr50/mcTimer.java

@@ -55,7 +55,7 @@ public class mcTimer implements Runnable
 				    	player.getHealth() > 0 && player.getHealth() < 20 
 				    	&& m.getPowerLevel(player) >= 1000){
 				    	player.setHealth(m.calculateHealth(player.getHealth(), 1));
-				    	if(LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
+				    	if(LoadProperties.partybar && LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
 				    		SpoutStuff.updatePartyHealthBarDisplay(player, player.getHealth());
 				    }
 				}
@@ -65,7 +65,7 @@ public class mcTimer implements Runnable
 			    		&& m.getPowerLevel(player) >= 500 
 			    		&& m.getPowerLevel(player) < 1000){
 			    		player.setHealth(m.calculateHealth(player.getHealth(), 1));
-			    		if(LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
+			    		if(LoadProperties.partybar && LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
 			    			SpoutStuff.updatePartyHealthBarDisplay(player, player.getHealth());
 			    	}
 				}
@@ -75,7 +75,7 @@ public class mcTimer implements Runnable
 			    		player.getHealth() > 0 && player.getHealth() < 20  
 			    		&& m.getPowerLevel(player) < 500){
 			    		player.setHealth(m.calculateHealth(player.getHealth(), 1));
-			    		if(LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
+			    		if(LoadProperties.partybar && LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
 			    			SpoutStuff.updatePartyHealthBarDisplay(player, player.getHealth());
 			    	}
 				}

+ 1 - 1
mcMMO/com/gmail/nossr50/party/Party.java

@@ -181,7 +181,7 @@ public class Party
 		savePartyPlayers();
 		
 		//Refresh party hp bars
-		if(LoadProperties.spoutEnabled)
+		if(LoadProperties.partybar && LoadProperties.spoutEnabled)
 		{
 			SpoutStuff.resetPartyHealthBarDisplays(partymembers);
 			SpoutStuff.resetPartyHealthBarDisplays(player);

+ 7 - 7
mcMMO/com/gmail/nossr50/skills/Excavation.java

@@ -58,7 +58,7 @@ public class Excavation
 	{
 		return block.getType() == Material.DIRT || block.getType() == Material.GRASS || block.getType() == Material.SAND || block.getType() == Material.GRAVEL || block.getType() == Material.CLAY;
 	}
-	public static void excavationProcCheck(byte data, int type, Location loc, Player player)
+	public static void excavationProcCheck(byte data, Material type, Location loc, Player player)
 	{
 		PlayerProfile PP = Users.getProfile(player);
     	ArrayList<ItemStack> is = new ArrayList<ItemStack>();
@@ -67,7 +67,7 @@ public class Excavation
     	
     	switch(type)
     	{
-    	case 2:
+    	case GRASS:
     		if(PP.getSkillLevel(SkillType.EXCAVATION) >= 250)
     		{
 	    		//CHANCE TO GET EGGS
@@ -84,7 +84,7 @@ public class Excavation
 	    		}
     		}
     		break;
-    	case 3:
+    	case GRAVEL:
     		//CHANCE TO GET NETHERRACK
     		if(LoadProperties.netherrack == true && PP.getSkillLevel(SkillType.EXCAVATION) >= 850 && Math.random() * 200 > 199)
     		{
@@ -111,7 +111,7 @@ public class Excavation
         		}
         	}
     		break;
-    	case 12:
+    	case SAND:
     		//CHANCE TO GET GLOWSTONE
     		if(LoadProperties.glowstone == true && PP.getSkillLevel(SkillType.EXCAVATION) >= 50 && Math.random() * 100 > 95)
     		{
@@ -126,7 +126,7 @@ public class Excavation
 				is.add(new ItemStack(Material.SOUL_SAND, 1, (byte)0, (byte)0));
     		}
     		break;
-    	case 82:
+    	case CLAY:
     		if(LoadProperties.slimeballs && PP.getSkillLevel(SkillType.EXCAVATION) >= 150)
     		{
     			if(Math.random() * 20 > 19)
@@ -171,7 +171,7 @@ public class Excavation
     	}
     	
     	//DIRT SAND OR GRAVEL
-    	if(type == 3 || type == 13 || type == 2 || type == 12 || type == 82)
+    	if(type == Material.GRASS || type == Material.DIRT || type == Material.GRAVEL || type == Material.SAND || type == Material.CLAY)
     	{
     		xp+= LoadProperties.mbase * LoadProperties.xpGainMultiplier;
     		if(PP.getSkillLevel(SkillType.EXCAVATION) >= 750)
@@ -213,7 +213,7 @@ public class Excavation
     	}
     	
     	//GRASS OR DIRT
-    	if(type == 2 || type == 3)
+    	if(type == Material.DIRT || type == Material.GRASS)
     	{
     		if(PP.getSkillLevel(SkillType.EXCAVATION) >= 50)
     		{

+ 1 - 1
mcMMO/com/gmail/nossr50/skills/Skills.java

@@ -325,7 +325,7 @@ public class Skills
 				else
 					player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));
 		}
-		if(LoadProperties.spoutEnabled)
+		if(LoadProperties.xpbar && LoadProperties.spoutEnabled)
 		{
 			SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
 			if(sPlayer.isSpoutCraftEnabled())

+ 16 - 7
mcMMO/com/gmail/nossr50/spout/SpoutStuff.java

@@ -44,20 +44,28 @@ public class SpoutStuff
 	{
 		//Setup xp bar
 		GenericTexture xpbar = new GenericTexture();
-		GenericTexture xpicon = new GenericTexture();
 		
-		xpicon.setUrl(LoadProperties.xpicon_url+"icon.png");
-		
-		xpicon.setHeight(16).setWidth(32).setX(LoadProperties.xpicon_x).setY(LoadProperties.xpicon_y);
+		if(LoadProperties.xpicon)
+		{
+			GenericTexture xpicon = new GenericTexture();
+			
+			xpicon.setUrl(LoadProperties.xpicon_url+"icon.png");
+			
+			xpicon.setHeight(16).setWidth(32).setX(LoadProperties.xpicon_x).setY(LoadProperties.xpicon_y);
+			
+			SpoutStuff.xpicons.put(sPlayer, xpicon);
+			
+			sPlayer.getMainScreen().attachWidget(plugin, SpoutStuff.xpicons.get(sPlayer));
+		}
 		
 		xpbar.setUrl(LoadProperties.xpbar_url+"xpbar_inc000.png");
 		xpbar.setX(LoadProperties.xpbar_x).setY(LoadProperties.xpbar_y).setHeight(8).setWidth(256);
 		
 		SpoutStuff.xpbars.put(sPlayer, xpbar);
-		SpoutStuff.xpicons.put(sPlayer, xpicon);
+		
 		
 		sPlayer.getMainScreen().attachWidget(plugin, SpoutStuff.xpbars.get(sPlayer));
-		sPlayer.getMainScreen().attachWidget(plugin, SpoutStuff.xpicons.get(sPlayer));
+		
 		sPlayer.getMainScreen().setDirty(true);
 	}
 	
@@ -528,7 +536,8 @@ public class SpoutStuff
 			
 			PP.setXpBarInc(PP.getXpBarInc()+1);
 			
-			xpicons.get(player).setUrl(getUrlIcon(PP.getLastGained())).setDirty(true);
+			if(LoadProperties.xpicon)
+				xpicons.get(player).setUrl(getUrlIcon(PP.getLastGained())).setDirty(true);
 			
 			((SpoutPlayer)player).getMainScreen().setDirty(true);
 		}

+ 1 - 1
mcMMO/plugin.yml

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