Version 1.0.02

This commit is contained in:
nossr50 2011-08-16 04:29:32 -07:00
parent 03661fb651
commit 6425feb177
12 changed files with 49 additions and 30 deletions

View File

@ -1,5 +1,13 @@
Changelog: Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code #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 Version 1.1.0
Brand new XP Bars, Health bars, and Skill Icons designed by BrandonXP Brand new XP Bars, Health bars, and Skill Icons designed by BrandonXP
Added /xplock <skillname> to lock the xp bar to a skill Added /xplock <skillname> to lock the xp bar to a skill

View File

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

View File

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

View File

@ -143,7 +143,7 @@ public class mcEntityListener extends EntityListener
Users.getProfile(herpderp).setRecentlyHurt(System.currentTimeMillis()); 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()); SpoutStuff.updatePartyHealthBarDisplay(herpderp, herpderp.getHealth()-event.getDamage());
} }
} }

View File

@ -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); SpoutStuff.updatePartyHealthBarDisplay(player, 20);
} }

View File

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

View File

@ -55,7 +55,7 @@ public class mcTimer implements Runnable
player.getHealth() > 0 && player.getHealth() < 20 player.getHealth() > 0 && player.getHealth() < 20
&& m.getPowerLevel(player) >= 1000){ && m.getPowerLevel(player) >= 1000){
player.setHealth(m.calculateHealth(player.getHealth(), 1)); 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()); SpoutStuff.updatePartyHealthBarDisplay(player, player.getHealth());
} }
} }
@ -65,7 +65,7 @@ public class mcTimer implements Runnable
&& m.getPowerLevel(player) >= 500 && m.getPowerLevel(player) >= 500
&& m.getPowerLevel(player) < 1000){ && m.getPowerLevel(player) < 1000){
player.setHealth(m.calculateHealth(player.getHealth(), 1)); 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()); SpoutStuff.updatePartyHealthBarDisplay(player, player.getHealth());
} }
} }
@ -75,7 +75,7 @@ public class mcTimer implements Runnable
player.getHealth() > 0 && player.getHealth() < 20 player.getHealth() > 0 && player.getHealth() < 20
&& m.getPowerLevel(player) < 500){ && m.getPowerLevel(player) < 500){
player.setHealth(m.calculateHealth(player.getHealth(), 1)); 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()); SpoutStuff.updatePartyHealthBarDisplay(player, player.getHealth());
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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