mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
*CLEANUP* - mcSpoutListener.java & mcSpoutScreenListener.java
This commit is contained in:
parent
def65282dd
commit
0a8d34a21f
@ -46,7 +46,6 @@ import com.gmail.nossr50.skills.Repair;
|
||||
import com.gmail.nossr50.skills.Skills;
|
||||
import com.gmail.nossr50.skills.Taming;
|
||||
|
||||
|
||||
public class mcPlayerListener implements Listener {
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
private mcMMO plugin;
|
||||
|
@ -10,25 +10,25 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.HUDmmo;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
|
||||
public class mcSpoutListener implements Listener
|
||||
{
|
||||
public class mcSpoutListener implements Listener {
|
||||
//Why do we have this here? We never use it...
|
||||
mcMMO plugin = null;
|
||||
|
||||
public mcSpoutListener(mcMMO pluginx)
|
||||
{
|
||||
public mcSpoutListener(mcMMO pluginx) {
|
||||
plugin = pluginx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor SpoutCraftEnable events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler
|
||||
public void onSpoutCraftEnable(SpoutCraftEnableEvent event)
|
||||
{
|
||||
public void onSpoutCraftEnable(SpoutCraftEnableEvent event) {
|
||||
SpoutPlayer sPlayer = event.getPlayer();
|
||||
if(sPlayer.isSpoutCraftEnabled())
|
||||
{
|
||||
//Setup Party HUD stuff
|
||||
SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer));
|
||||
|
||||
//Party.update(sPlayer);
|
||||
if (sPlayer.isSpoutCraftEnabled()) {
|
||||
SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer)); //Setup Party HUD stuff
|
||||
Users.getProfile(sPlayer).toggleSpoutEnabled();
|
||||
}
|
||||
}
|
||||
|
@ -17,51 +17,58 @@ import com.gmail.nossr50.datatypes.buttons.ButtonPartyToggle;
|
||||
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
|
||||
public class mcSpoutScreenListener implements Listener
|
||||
{
|
||||
public class mcSpoutScreenListener implements Listener {
|
||||
//Why do we have this here? We never use it...
|
||||
mcMMO plugin = null;
|
||||
public mcSpoutScreenListener(mcMMO pluginx)
|
||||
{
|
||||
|
||||
public mcSpoutScreenListener(mcMMO pluginx) {
|
||||
plugin = pluginx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor Spout ButtonClick events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler
|
||||
public void onButtonClick(ButtonClickEvent event)
|
||||
{
|
||||
public void onButtonClick(ButtonClickEvent event) {
|
||||
SpoutPlayer sPlayer = event.getPlayer();
|
||||
PlayerProfile PP = Users.getProfile(sPlayer);
|
||||
|
||||
if(event.getButton() instanceof ButtonHUDStyle)
|
||||
{
|
||||
if(SpoutStuff.playerHUDs.containsKey(sPlayer))
|
||||
{
|
||||
if (event.getButton() instanceof ButtonHUDStyle) {
|
||||
if (SpoutStuff.playerHUDs.containsKey(sPlayer)) {
|
||||
SpoutStuff.playerHUDs.get(sPlayer).resetHUD();
|
||||
SpoutStuff.playerHUDs.remove(sPlayer);
|
||||
|
||||
switch(PP.getHUDType())
|
||||
{
|
||||
switch (PP.getHUDType()) {
|
||||
case RETRO:
|
||||
PP.setHUDType(HUDType.STANDARD);
|
||||
break;
|
||||
|
||||
case STANDARD:
|
||||
PP.setHUDType(HUDType.SMALL);
|
||||
break;
|
||||
|
||||
case SMALL:
|
||||
PP.setHUDType(HUDType.DISABLED);
|
||||
break;
|
||||
|
||||
case DISABLED:
|
||||
PP.setHUDType(HUDType.RETRO);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer));
|
||||
|
||||
SpoutStuff.playerScreens.get(sPlayer).updateButtons(PP);
|
||||
}
|
||||
} else if (event.getButton() instanceof ButtonEscape)
|
||||
{
|
||||
}
|
||||
else if (event.getButton() instanceof ButtonEscape) {
|
||||
sPlayer.getMainScreen().closePopup();
|
||||
} else if (event.getButton() instanceof ButtonPartyToggle)
|
||||
{
|
||||
}
|
||||
else if (event.getButton() instanceof ButtonPartyToggle) {
|
||||
PP.togglePartyHUD();
|
||||
ButtonPartyToggle bpt = (ButtonPartyToggle) event.getButton();
|
||||
bpt.updateText(PP);
|
||||
@ -70,11 +77,14 @@ public class mcSpoutScreenListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor Spout ScreenClose events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler
|
||||
public void onScreenClose(ScreenCloseEvent event)
|
||||
{
|
||||
if(event.getScreen() instanceof PopupMMO)
|
||||
{
|
||||
public void onScreenClose(ScreenCloseEvent event) {
|
||||
if (event.getScreen() instanceof PopupMMO) {
|
||||
SpoutStuff.playerScreens.remove(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user