Merge branch 'chissbrokethis'
Conflicts: Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java
This commit is contained in:
commit
4a50e3ae62
@ -7,14 +7,15 @@
|
|||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Core/Mineplex.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Core/Mineplex.Core.iml" group="Core" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Core/Mineplex.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Core/Mineplex.Core.iml" group="Core" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Core.Common/Mineplex.Core.Common.iml" filepath="$PROJECT_DIR$/Mineplex.Core.Common/Mineplex.Core.Common.iml" group="Core" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Core.Common/Mineplex.Core.Common.iml" filepath="$PROJECT_DIR$/Mineplex.Core.Common/Mineplex.Core.Common.iml" group="Core" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Database/Mineplex.Database.iml" filepath="$PROJECT_DIR$/Mineplex.Database/Mineplex.Database.iml" group="Core" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Database/Mineplex.Database.iml" filepath="$PROJECT_DIR$/Mineplex.Database/Mineplex.Database.iml" group="Core" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Game.Clans/Mineplex.Game.Clans.iml" filepath="$PROJECT_DIR$/Mineplex.Game.Clans/Mineplex.Game.Clans.iml" group="Game" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" filepath="$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" filepath="$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" filepath="$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" filepath="$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" group="Bungee" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" group="Bungee" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" group="Arcade" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" group="Game" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" group="Arcade" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" group="Game" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" filepath="$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" group="Core" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" filepath="$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" group="Core" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" filepath="$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" group="Core" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" filepath="$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" group="Core" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" filepath="$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" group="Arcade" />
|
<module fileurl="file://$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" filepath="$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" group="Game" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -15,6 +15,9 @@ public enum Rank
|
|||||||
MODERATOR("Mod", ChatColor.GOLD),
|
MODERATOR("Mod", ChatColor.GOLD),
|
||||||
HELPER("Helper", ChatColor.DARK_AQUA),
|
HELPER("Helper", ChatColor.DARK_AQUA),
|
||||||
MAPDEV("Mapper", ChatColor.BLUE),
|
MAPDEV("Mapper", ChatColor.BLUE),
|
||||||
|
|
||||||
|
//Staff ^^
|
||||||
|
|
||||||
YOUTUBE("YouTube", ChatColor.RED),
|
YOUTUBE("YouTube", ChatColor.RED),
|
||||||
LEGEND("Legend", ChatColor.GREEN),
|
LEGEND("Legend", ChatColor.GREEN),
|
||||||
HERO("Hero", ChatColor.LIGHT_PURPLE),
|
HERO("Hero", ChatColor.LIGHT_PURPLE),
|
||||||
|
@ -446,10 +446,10 @@ public class CoreClientManager extends MiniPlugin
|
|||||||
if (event.getType() != UpdateType.SLOWER)
|
if (event.getType() != UpdateType.SLOWER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
System.out.println("=====");
|
// System.out.println("=====");
|
||||||
System.out.println("Connecting : " + _clientsConnecting.get());
|
// System.out.println("Connecting : " + _clientsConnecting.get());
|
||||||
System.out.println("Processing : " + _clientsProcessing.get());
|
// System.out.println("Processing : " + _clientsProcessing.get());
|
||||||
System.out.println("=====");
|
// System.out.println("=====");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addStoredProcedureLoginProcessor(ILoginProcessor processor)
|
public void addStoredProcedureLoginProcessor(ILoginProcessor processor)
|
||||||
|
@ -2,6 +2,7 @@ package mineplex.core.achievement.ui.button;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.achievement.AchievementCategory;
|
import mineplex.core.achievement.AchievementCategory;
|
||||||
@ -9,13 +10,13 @@ import mineplex.core.achievement.AchievementManager;
|
|||||||
import mineplex.core.achievement.ui.AchievementShop;
|
import mineplex.core.achievement.ui.AchievementShop;
|
||||||
import mineplex.core.achievement.ui.page.ArcadeMainPage;
|
import mineplex.core.achievement.ui.page.ArcadeMainPage;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Shaun on 8/22/2014.
|
* Created by Shaun on 8/22/2014.
|
||||||
*/
|
*/
|
||||||
public class ArcadeButton extends SingleButton
|
public class ArcadeButton implements IButton
|
||||||
{
|
{
|
||||||
private AchievementShop _shop;
|
private AchievementShop _shop;
|
||||||
private AchievementManager _achievementManager;
|
private AchievementManager _achievementManager;
|
||||||
@ -35,7 +36,7 @@ public class ArcadeButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_shop.OpenPageForPlayer(player, new ArcadeMainPage(_achievementManager, _statsManager, _shop, _clientManager, _donationManager, "Arcade Games", player, _target));
|
_shop.OpenPageForPlayer(player, new ArcadeMainPage(_achievementManager, _statsManager, _shop, _clientManager, _donationManager, "Arcade Games", player, _target));
|
||||||
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
|
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
|
||||||
|
@ -2,6 +2,7 @@ package mineplex.core.achievement.ui.button;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.achievement.AchievementCategory;
|
import mineplex.core.achievement.AchievementCategory;
|
||||||
@ -9,13 +10,13 @@ import mineplex.core.achievement.AchievementManager;
|
|||||||
import mineplex.core.achievement.ui.AchievementShop;
|
import mineplex.core.achievement.ui.AchievementShop;
|
||||||
import mineplex.core.achievement.ui.page.AchievementPage;
|
import mineplex.core.achievement.ui.page.AchievementPage;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Shaun on 8/22/2014.
|
* Created by Shaun on 8/22/2014.
|
||||||
*/
|
*/
|
||||||
public class CategoryButton extends SingleButton
|
public class CategoryButton implements IButton
|
||||||
{
|
{
|
||||||
private AchievementShop _shop;
|
private AchievementShop _shop;
|
||||||
private AchievementCategory _category;
|
private AchievementCategory _category;
|
||||||
@ -37,7 +38,7 @@ public class CategoryButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_shop.OpenPageForPlayer(player, new AchievementPage(_achievementManager, _statsManager, _category, _shop, _clientManager, _donationManager, player, _target));
|
_shop.OpenPageForPlayer(player, new AchievementPage(_achievementManager, _statsManager, _category, _shop, _clientManager, _donationManager, player, _target));
|
||||||
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
|
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
@ -18,8 +19,8 @@ import mineplex.core.achievement.AchievementManager;
|
|||||||
import mineplex.core.achievement.ui.AchievementShop;
|
import mineplex.core.achievement.ui.AchievementShop;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import mineplex.core.stats.PlayerStats;
|
import mineplex.core.stats.PlayerStats;
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
@ -134,10 +135,9 @@ public class AchievementPage extends ShopPageBase<AchievementManager, Achievemen
|
|||||||
|
|
||||||
private void addBackButton()
|
private void addBackButton()
|
||||||
{
|
{
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
AchievementMainPage page;
|
AchievementMainPage page;
|
||||||
if (_category.getGameCategory() == AchievementCategory.GameCategory.ARCADE)
|
if (_category.getGameCategory() == AchievementCategory.GameCategory.ARCADE)
|
||||||
|
@ -6,6 +6,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.achievement.AchievementCategory;
|
import mineplex.core.achievement.AchievementCategory;
|
||||||
@ -14,8 +15,8 @@ import mineplex.core.achievement.ui.AchievementShop;
|
|||||||
import mineplex.core.achievement.ui.button.CategoryButton;
|
import mineplex.core.achievement.ui.button.CategoryButton;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,10 +63,9 @@ public class ArcadeMainPage extends AchievementMainPage
|
|||||||
|
|
||||||
private void addBackButton()
|
private void addBackButton()
|
||||||
{
|
{
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new AchievementMainPage(Plugin, _statsManager, Shop, ClientManager, DonationManager, _target.getName() + "'s Stats", player, _target));
|
Shop.OpenPageForPlayer(Player, new AchievementMainPage(Plugin, _statsManager, Shop, ClientManager, DonationManager, _target.getName() + "'s Stats", player, _target));
|
||||||
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
|
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
|
||||||
|
@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -13,7 +14,9 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Item;
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
@ -32,32 +35,39 @@ public class Blood extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void Death(PlayerDeathEvent event)
|
public void Death(PlayerDeathEvent event)
|
||||||
{
|
{
|
||||||
Effects(event.getEntity().getEyeLocation(), 10, 0.5, Sound.HURT_FLESH, 1f, 1f, Material.INK_SACK, (byte)1, true);
|
Effects(event.getEntity(), event.getEntity().getEyeLocation(), 10, 0.5, Sound.HURT_FLESH, 1f, 1f, Material.INK_SACK, (byte)1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Effects(Location loc, int particles, double velMult, Sound sound,
|
public void Effects(Player player, Location loc, int particles, double velMult, Sound sound,
|
||||||
float soundVol, float soundPitch, Material type, byte data, boolean bloodStep)
|
float soundVol, float soundPitch, Material type, byte data, boolean bloodStep)
|
||||||
{
|
{
|
||||||
Effects(loc, particles, velMult, sound, soundVol, soundPitch, type, data, 10, bloodStep);
|
Effects(player, loc, particles, velMult, sound, soundVol, soundPitch, type, data, 10, bloodStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Effects(Location loc, int particles, double velMult, Sound sound,
|
public void Effects(Player player, Location loc, int particles, double velMult, Sound sound,
|
||||||
float soundVol, float soundPitch, Material type, byte data, int ticks, boolean bloodStep)
|
float soundVol, float soundPitch, Material type, byte data, int ticks, boolean bloodStep)
|
||||||
{
|
{
|
||||||
for (int i = 0 ; i < particles ; i++)
|
BloodEvent event = new BloodEvent(player, loc, particles, velMult, sound, soundVol, soundPitch, type, data, ticks, bloodStep);
|
||||||
|
UtilServer.getServer().getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public void display(BloodEvent event)
|
||||||
|
{
|
||||||
|
for (int i = 0 ; i < event.getParticles() ; i++)
|
||||||
{
|
{
|
||||||
Item item = loc.getWorld().dropItem(loc,
|
Item item = event.getLocation().getWorld().dropItem(event.getLocation(),
|
||||||
ItemStackFactory.Instance.CreateStack(type, data));
|
ItemStackFactory.Instance.CreateStack(event.getMaterial(), event.getMaterialData()));
|
||||||
|
|
||||||
item.setVelocity(new Vector((Math.random() - 0.5)*velMult,Math.random()*velMult,(Math.random() - 0.5)*velMult));
|
item.setVelocity(new Vector((Math.random() - 0.5)*event.getVelocityMult(),Math.random()*event.getVelocityMult(),(Math.random() - 0.5)*event.getVelocityMult()));
|
||||||
|
|
||||||
_blood.put(item, ticks);
|
_blood.put(item, event.getTicks());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bloodStep)
|
if (event.getBloodStep())
|
||||||
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 55);
|
event.getLocation().getWorld().playEffect(event.getLocation(), Effect.STEP_SOUND, 55);
|
||||||
|
|
||||||
loc.getWorld().playSound(loc, sound, soundVol, soundPitch);
|
event.getLocation().getWorld().playSound(event.getLocation(), event.getSound(), event.getSoundVolume(), event.getSoundPitch());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
128
Plugins/Mineplex.Core/src/mineplex/core/blood/BloodEvent.java
Normal file
128
Plugins/Mineplex.Core/src/mineplex/core/blood/BloodEvent.java
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
package mineplex.core.blood;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class BloodEvent extends Event implements Cancellable
|
||||||
|
{
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
private boolean _cancelled = false;
|
||||||
|
|
||||||
|
private Player _player;
|
||||||
|
private Location _loc;
|
||||||
|
private int _particles;
|
||||||
|
private double _velMult;
|
||||||
|
private Sound _sound;
|
||||||
|
private float _soundVol;
|
||||||
|
private float _soundPitch;
|
||||||
|
private Material _type;
|
||||||
|
private byte _data;
|
||||||
|
private int _ticks;
|
||||||
|
private boolean _bloodStep;
|
||||||
|
|
||||||
|
public BloodEvent(Player player, Location loc, int particles, double velMult, Sound sound,
|
||||||
|
float soundVol, float soundPitch, Material type, byte data,
|
||||||
|
int ticks, boolean bloodStep)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
_loc = loc;
|
||||||
|
_particles = particles;
|
||||||
|
_velMult = velMult;
|
||||||
|
_sound = sound;
|
||||||
|
_soundVol = soundVol;
|
||||||
|
_soundPitch = soundPitch;
|
||||||
|
_type = type;
|
||||||
|
_data = data;
|
||||||
|
_ticks = ticks;
|
||||||
|
_bloodStep = bloodStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled()
|
||||||
|
{
|
||||||
|
return _cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean var)
|
||||||
|
{
|
||||||
|
_cancelled = var;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HandlerList getHandlers()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer()
|
||||||
|
{
|
||||||
|
return _player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getLocation()
|
||||||
|
{
|
||||||
|
return _loc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getParticles()
|
||||||
|
{
|
||||||
|
return _particles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getVelocityMult()
|
||||||
|
{
|
||||||
|
return _velMult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sound getSound()
|
||||||
|
{
|
||||||
|
return _sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getSoundVolume()
|
||||||
|
{
|
||||||
|
return _soundVol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getSoundPitch()
|
||||||
|
{
|
||||||
|
return _soundPitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Material getMaterial()
|
||||||
|
{
|
||||||
|
return _type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getMaterialData()
|
||||||
|
{
|
||||||
|
return _data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTicks()
|
||||||
|
{
|
||||||
|
return _ticks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBloodStep()
|
||||||
|
{
|
||||||
|
return _bloodStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItem(Material mat, byte data)
|
||||||
|
{
|
||||||
|
_type = mat;
|
||||||
|
_data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ public class Chat extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void preventMe(PlayerCommandPreprocessEvent event)
|
public void preventMe(PlayerCommandPreprocessEvent event)
|
||||||
{
|
{
|
||||||
if (event.getMessage().toLowerCase().startsWith("/me")
|
if (event.getMessage().toLowerCase().startsWith("/me ")
|
||||||
|| event.getMessage().toLowerCase().startsWith("/bukkit"))
|
|| event.getMessage().toLowerCase().startsWith("/bukkit"))
|
||||||
{
|
{
|
||||||
event.getPlayer().sendMessage(F.main(getName(), "No, you!"));
|
event.getPlayer().sendMessage(F.main(getName(), "No, you!"));
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.shop.item.ComplexButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class ActivateGadgetButton extends ComplexButton
|
public class ActivateGadgetButton implements IButton
|
||||||
{
|
{
|
||||||
private Gadget _gadget;
|
private Gadget _gadget;
|
||||||
private GadgetPage _page;
|
private GadgetPage _page;
|
||||||
@ -18,26 +19,11 @@ public class ActivateGadgetButton extends ComplexButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ClickedLeft(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.activateGadget(player, _gadget);
|
if (clickType.isLeftClick())
|
||||||
}
|
_page.activateGadget(player, _gadget);
|
||||||
|
else if (clickType.isRightClick())
|
||||||
@Override
|
_page.handleRightClick(player, _gadget);
|
||||||
public void ClickedRight(Player player)
|
|
||||||
{
|
|
||||||
_page.handleRightClick(player, _gadget);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftLeft(Player player)
|
|
||||||
{
|
|
||||||
_page.activateGadget(player, _gadget);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftRight(Player player)
|
|
||||||
{
|
|
||||||
_page.handleRightClick(player, _gadget);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.MountPage;
|
import mineplex.core.cosmetic.ui.page.MountPage;
|
||||||
import mineplex.core.mount.Mount;
|
import mineplex.core.mount.Mount;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class ActivateMountButton extends SingleButton
|
public class ActivateMountButton implements IButton
|
||||||
{
|
{
|
||||||
private Mount<?> _mount;
|
private Mount<?> _mount;
|
||||||
private MountPage _page;
|
private MountPage _page;
|
||||||
@ -19,7 +20,7 @@ public class ActivateMountButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.PlayAcceptSound(player);
|
_page.PlayAcceptSound(player);
|
||||||
_mount.Enable(player);
|
_mount.Enable(player);
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.PetPage;
|
import mineplex.core.cosmetic.ui.page.PetPage;
|
||||||
import mineplex.core.pet.Pet;
|
import mineplex.core.pet.Pet;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class ActivatePetButton extends SingleButton
|
public class ActivatePetButton implements IButton
|
||||||
{
|
{
|
||||||
private Pet _pet;
|
private Pet _pet;
|
||||||
private PetPage _page;
|
private PetPage _page;
|
||||||
@ -19,7 +20,7 @@ public class ActivatePetButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.PlayAcceptSound(player);
|
_page.PlayAcceptSound(player);
|
||||||
_page.getPlugin().getPetManager().AddPetOwner(player, _pet.GetPetType(), player.getLocation());
|
_page.getPlugin().getPetManager().AddPetOwner(player, _pet.GetPetType(), player.getLocation());
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class CloseButton extends SingleButton
|
public class CloseButton implements IButton
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.shop.item.ComplexButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class DeactivateGadgetButton extends ComplexButton
|
public class DeactivateGadgetButton implements IButton
|
||||||
{
|
{
|
||||||
private Gadget _gadget;
|
private Gadget _gadget;
|
||||||
private GadgetPage _page;
|
private GadgetPage _page;
|
||||||
@ -17,27 +18,12 @@ public class DeactivateGadgetButton extends ComplexButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void ClickedLeft(Player player)
|
|
||||||
{
|
{
|
||||||
_page.deactivateGadget(player, _gadget);
|
if (clickType.isLeftClick())
|
||||||
}
|
_page.deactivateGadget(player, _gadget);
|
||||||
|
else if (clickType.isRightClick())
|
||||||
@Override
|
_page.handleRightClick(player, _gadget);
|
||||||
public void ClickedRight(Player player)
|
|
||||||
{
|
|
||||||
_page.handleRightClick(player, _gadget);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftLeft(Player player)
|
|
||||||
{
|
|
||||||
_page.deactivateGadget(player, _gadget);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftRight(Player player)
|
|
||||||
{
|
|
||||||
_page.handleRightClick(player, _gadget);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import mineplex.core.mount.Mount;
|
import mineplex.core.mount.Mount;
|
||||||
|
|
||||||
public class DeactivateMountButton extends SingleButton
|
public class DeactivateMountButton implements IButton
|
||||||
{
|
{
|
||||||
private Mount<?> _mount;
|
private Mount<?> _mount;
|
||||||
private ShopPageBase<?,?> _page;
|
private ShopPageBase<?,?> _page;
|
||||||
@ -17,8 +18,7 @@ public class DeactivateMountButton extends SingleButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.PlayAcceptSound(player);
|
_page.PlayAcceptSound(player);
|
||||||
_mount.Disable(player);
|
_mount.Disable(player);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.pet.PetManager;
|
import mineplex.core.pet.PetManager;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
|
||||||
public class DeactivatePetButton extends SingleButton
|
public class DeactivatePetButton implements IButton
|
||||||
{
|
{
|
||||||
private ShopPageBase<?,?> _page;
|
private ShopPageBase<?,?> _page;
|
||||||
private PetManager _petManager;
|
private PetManager _petManager;
|
||||||
@ -17,8 +18,7 @@ public class DeactivatePetButton extends SingleButton
|
|||||||
_petManager = petManager;
|
_petManager = petManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.PlayAcceptSound(player);
|
_page.PlayAcceptSound(player);
|
||||||
_petManager.RemovePet(player, true);
|
_petManager.RemovePet(player, true);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class GadgetButton extends SingleButton
|
public class GadgetButton implements IButton
|
||||||
{
|
{
|
||||||
private Gadget _gadget;
|
private Gadget _gadget;
|
||||||
private GadgetPage _page;
|
private GadgetPage _page;
|
||||||
@ -18,7 +19,7 @@ public class GadgetButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.purchaseGadget(player, _gadget);
|
_page.purchaseGadget(player, _gadget);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.page.ConfirmationPage;
|
import mineplex.core.shop.page.ConfirmationPage;
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
@ -10,7 +11,7 @@ import mineplex.core.cosmetic.ui.CosmeticShop;
|
|||||||
import mineplex.core.cosmetic.ui.page.MountPage;
|
import mineplex.core.cosmetic.ui.page.MountPage;
|
||||||
import mineplex.core.mount.Mount;
|
import mineplex.core.mount.Mount;
|
||||||
|
|
||||||
public class MountButton extends SingleButton
|
public class MountButton implements IButton
|
||||||
{
|
{
|
||||||
private Mount<?> _mount;
|
private Mount<?> _mount;
|
||||||
private MountPage _page;
|
private MountPage _page;
|
||||||
@ -22,7 +23,7 @@ public class MountButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(final Player player)
|
public void onClick(final Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.getShop().OpenPageForPlayer(player, new ConfirmationPage<CosmeticManager, CosmeticShop>(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), new Runnable()
|
_page.getShop().OpenPageForPlayer(player, new ConfirmationPage<CosmeticManager, CosmeticShop>(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), new Runnable()
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class OpenCostumes extends SingleButton
|
public class OpenCostumes implements IButton
|
||||||
{
|
{
|
||||||
private Menu _menu;
|
private Menu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class OpenCostumes extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.openCostumes(player);
|
_menu.openCostumes(player);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import mineplex.core.cosmetic.ui.page.Menu;
|
|||||||
import mineplex.core.shop.item.IButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
public class OpenGadgets implements IButton
|
public class OpenGadgets implements IButton
|
||||||
@ -17,8 +18,8 @@ public class OpenGadgets implements IButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.getShop().OpenPageForPlayer((Player)event.getWhoClicked(), new GadgetPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Gadgets", (Player)event.getWhoClicked()));
|
_page.getShop().OpenPageForPlayer(player, new GadgetPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Gadgets", player));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,11 +2,12 @@ package mineplex.core.cosmetic.ui.button;
|
|||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.MorphPage;
|
import mineplex.core.cosmetic.ui.page.MorphPage;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class OpenMorphs extends SingleButton
|
public class OpenMorphs implements IButton
|
||||||
{
|
{
|
||||||
private Menu _page;
|
private Menu _page;
|
||||||
|
|
||||||
@ -15,8 +16,7 @@ public class OpenMorphs extends SingleButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.getShop().OpenPageForPlayer(player, new MorphPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Morphs", player));
|
_page.getShop().OpenPageForPlayer(player, new MorphPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Morphs", player));
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,12 @@ package mineplex.core.cosmetic.ui.button;
|
|||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.MountPage;
|
import mineplex.core.cosmetic.ui.page.MountPage;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class OpenMounts extends SingleButton
|
public class OpenMounts implements IButton
|
||||||
{
|
{
|
||||||
private Menu _page;
|
private Menu _page;
|
||||||
|
|
||||||
@ -15,8 +16,7 @@ public class OpenMounts extends SingleButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.getShop().OpenPageForPlayer(player, new MountPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Mounts", player));
|
_page.getShop().OpenPageForPlayer(player, new MountPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Mounts", player));
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by shaun on 14-09-15.
|
* Created by shaun on 14-09-15.
|
||||||
*/
|
*/
|
||||||
public class OpenMusic extends SingleButton
|
public class OpenMusic implements IButton
|
||||||
{
|
{
|
||||||
private Menu _menu;
|
private Menu _menu;
|
||||||
|
|
||||||
@ -17,8 +18,7 @@ public class OpenMusic extends SingleButton
|
|||||||
_menu = menu;
|
_menu = menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_menu.openMusic(player);
|
_menu.openMusic(player);
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,12 @@ package mineplex.core.cosmetic.ui.button;
|
|||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.ParticlePage;
|
import mineplex.core.cosmetic.ui.page.ParticlePage;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class OpenParticles extends SingleButton
|
public class OpenParticles implements IButton
|
||||||
{
|
{
|
||||||
private Menu _page;
|
private Menu _page;
|
||||||
|
|
||||||
@ -15,8 +16,7 @@ public class OpenParticles extends SingleButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.getShop().OpenPageForPlayer(player, new ParticlePage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Particles", player));
|
_page.getShop().OpenPageForPlayer(player, new ParticlePage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Particles", player));
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,12 @@ package mineplex.core.cosmetic.ui.button;
|
|||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.PetPage;
|
import mineplex.core.cosmetic.ui.page.PetPage;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class OpenPets extends SingleButton
|
public class OpenPets implements IButton
|
||||||
{
|
{
|
||||||
private Menu _page;
|
private Menu _page;
|
||||||
|
|
||||||
@ -14,8 +15,9 @@ public class OpenPets extends SingleButton
|
|||||||
{
|
{
|
||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.getShop().OpenPageForPlayer(player, new PetPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Pets", player));
|
_page.getShop().OpenPageForPlayer(player, new PetPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Pets", player));
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.pet.Pet;
|
import mineplex.core.pet.Pet;
|
||||||
import mineplex.core.cosmetic.ui.page.PetPage;
|
import mineplex.core.cosmetic.ui.page.PetPage;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class PetButton extends SingleButton
|
public class PetButton implements IButton
|
||||||
{
|
{
|
||||||
private Pet _pet;
|
private Pet _pet;
|
||||||
private PetPage _page;
|
private PetPage _page;
|
||||||
@ -17,8 +18,7 @@ public class PetButton extends SingleButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.purchasePet(player, _pet);
|
_page.purchasePet(player, _pet);
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,13 @@ package mineplex.core.cosmetic.ui.button;
|
|||||||
|
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.PetPage;
|
import mineplex.core.cosmetic.ui.page.PetPage;
|
||||||
import mineplex.core.pet.Pet;
|
import mineplex.core.pet.Pet;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class RenamePetButton extends SingleButton
|
public class RenamePetButton implements IButton
|
||||||
{
|
{
|
||||||
private PetPage _page;
|
private PetPage _page;
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ public class RenamePetButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.PlayAcceptSound(player);
|
_page.PlayAcceptSound(player);
|
||||||
Creature currentPet = _page.getPlugin().getPetManager().getActivePet(player.getName());
|
Creature currentPet = _page.getPlugin().getPetManager().getActivePet(player.getName());
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.PetTagPage;
|
import mineplex.core.cosmetic.ui.page.PetTagPage;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class SelectTagButton extends SingleButton
|
public class SelectTagButton implements IButton
|
||||||
{
|
{
|
||||||
private PetTagPage _page;
|
private PetTagPage _page;
|
||||||
|
|
||||||
@ -14,8 +15,7 @@ public class SelectTagButton extends SingleButton
|
|||||||
_page = page;
|
_page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_page.SelectTag();
|
_page.SelectTag();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.core.cosmetic.ui.button;
|
package mineplex.core.cosmetic.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.shop.item.ComplexButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class TreasureButton extends ComplexButton
|
public class TreasureButton implements IButton
|
||||||
{
|
{
|
||||||
private Menu _menu;
|
private Menu _menu;
|
||||||
private boolean _hasEnoughChests;
|
private boolean _hasEnoughChests;
|
||||||
@ -20,36 +21,24 @@ public class TreasureButton extends ComplexButton
|
|||||||
_canPurchaseKey = canPurchaseKey;
|
_canPurchaseKey = canPurchaseKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void ClickedLeft(Player player)
|
|
||||||
{
|
{
|
||||||
if (_hasEnoughChests && _hasEnoughKeys)
|
if (clickType.isLeftClick())
|
||||||
{
|
{
|
||||||
_menu.openTreasure(player);
|
if (_hasEnoughChests && _hasEnoughKeys)
|
||||||
player.closeInventory();
|
{
|
||||||
|
_menu.openTreasure(player);
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
else if (_hasEnoughChests && _canPurchaseKey)
|
||||||
|
{
|
||||||
|
_menu.attemptPurchaseKey(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (_hasEnoughChests && _canPurchaseKey)
|
else if (clickType.isRightClick())
|
||||||
{
|
{
|
||||||
_menu.attemptPurchaseKey(player);
|
if (_canPurchaseKey)
|
||||||
|
_menu.attemptPurchaseKey(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedRight(Player player)
|
|
||||||
{
|
|
||||||
if (_canPurchaseKey)
|
|
||||||
_menu.attemptPurchaseKey(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftLeft(Player player)
|
|
||||||
{
|
|
||||||
ClickedLeft(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftRight(Player player)
|
|
||||||
{
|
|
||||||
ClickedRight(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -16,8 +17,8 @@ import mineplex.core.gadget.types.Gadget;
|
|||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.gadget.types.ItemGadget;
|
import mineplex.core.gadget.types.ItemGadget;
|
||||||
import mineplex.core.gadget.types.OutfitGadget;
|
import mineplex.core.gadget.types.OutfitGadget;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by shaun on 14-09-15.
|
* Created by shaun on 14-09-15.
|
||||||
@ -62,10 +63,9 @@ public class CostumePage extends GadgetPage
|
|||||||
addGlow(slot);
|
addGlow(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(8, new ShopItem(Material.TNT, C.cRed + C.Bold + "Remove all Clothing", new String[] { }, 1, false), new SingleButton()
|
AddButton(8, new ShopItem(Material.TNT, C.cRed + C.Bold + "Remove all Clothing", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
boolean gadgetDisabled = false;
|
boolean gadgetDisabled = false;
|
||||||
for (Gadget gadget : Plugin.getGadgetManager().getGadgets(GadgetType.Costume))
|
for (Gadget gadget : Plugin.getGadgetManager().getGadgets(GadgetType.Costume))
|
||||||
@ -85,10 +85,9 @@ public class CostumePage extends GadgetPage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
@ -20,8 +21,8 @@ import mineplex.core.gadget.gadgets.MorphNotch;
|
|||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.gadget.types.ItemGadget;
|
import mineplex.core.gadget.types.ItemGadget;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.ConfirmationPage;
|
import mineplex.core.shop.page.ConfirmationPage;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
|
||||||
@ -51,10 +52,9 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
slot = 28;
|
slot = 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
@ -25,8 +26,8 @@ import mineplex.core.donation.DonationManager;
|
|||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.mount.Mount;
|
import mineplex.core.mount.Mount;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.ConfirmationPage;
|
import mineplex.core.shop.page.ConfirmationPage;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import mineplex.core.treasure.TreasureKey;
|
import mineplex.core.treasure.TreasureKey;
|
||||||
@ -120,10 +121,9 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
AddButton(18 + 9,
|
AddButton(18 + 9,
|
||||||
new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[] {}, 1, false, false),
|
new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[] {}, 1, false, false),
|
||||||
new SingleButton()
|
new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
PlayAcceptSound(player);
|
PlayAcceptSound(player);
|
||||||
gadget.Disable(player);
|
gadget.Disable(player);
|
||||||
@ -138,10 +138,9 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
AddButton(20 + 9,
|
AddButton(20 + 9,
|
||||||
new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[] {}, 1, false, false),
|
new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[] {}, 1, false, false),
|
||||||
new SingleButton()
|
new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
PlayAcceptSound(player);
|
PlayAcceptSound(player);
|
||||||
gadget.Disable(player);
|
gadget.Disable(player);
|
||||||
@ -156,10 +155,9 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
AddButton(22 + 9,
|
AddButton(22 + 9,
|
||||||
new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[] {}, 1, false, false),
|
new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[] {}, 1, false, false),
|
||||||
new SingleButton()
|
new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
PlayAcceptSound(player);
|
PlayAcceptSound(player);
|
||||||
gadget.Disable(player);
|
gadget.Disable(player);
|
||||||
@ -174,10 +172,9 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
AddButton(24 + 9,
|
AddButton(24 + 9,
|
||||||
new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), ChatColor.RESET + C.mItem + mount.GetName(), new String[] {}, 1, false, false),
|
new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), ChatColor.RESET + C.mItem + mount.GetName(), new String[] {}, 1, false, false),
|
||||||
new SingleButton()
|
new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
PlayAcceptSound(player);
|
PlayAcceptSound(player);
|
||||||
mount.Disable(player);
|
mount.Disable(player);
|
||||||
@ -189,10 +186,9 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
if (Plugin.getPetManager().hasActivePet(Player.getName()))
|
if (Plugin.getPetManager().hasActivePet(Player.getName()))
|
||||||
{
|
{
|
||||||
AddButton(26 + 9, new ShopItem(Material.MONSTER_EGG, (byte)Plugin.getPetManager().getActivePet(Player.getName()).getType().getTypeId(), ChatColor.RESET + C.mItem + Plugin.getPetManager().getActivePet(Player.getName()).getCustomName(), new String[] {}, 1, false, false),
|
AddButton(26 + 9, new ShopItem(Material.MONSTER_EGG, (byte)Plugin.getPetManager().getActivePet(Player.getName()).getType().getTypeId(), ChatColor.RESET + C.mItem + Plugin.getPetManager().getActivePet(Player.getName()).getCustomName(), new String[] {}, 1, false, false),
|
||||||
new SingleButton()
|
new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
PlayAcceptSound(player);
|
PlayAcceptSound(player);
|
||||||
Plugin.getPetManager().RemovePet(player, true);
|
Plugin.getPetManager().RemovePet(player, true);
|
||||||
|
@ -2,6 +2,7 @@ package mineplex.core.cosmetic.ui.page;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -12,7 +13,7 @@ import mineplex.core.gadget.types.Gadget;
|
|||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
import mineplex.core.inventory.InventoryManager;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class MorphPage extends GadgetPage
|
public class MorphPage extends GadgetPage
|
||||||
{
|
{
|
||||||
@ -39,10 +40,9 @@ public class MorphPage extends GadgetPage
|
|||||||
slot = 28;
|
slot = 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
@ -18,9 +19,8 @@ import mineplex.core.cosmetic.ui.button.MountButton;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.mount.Mount;
|
import mineplex.core.mount.Mount;
|
||||||
import mineplex.core.shop.ShopBase;
|
import mineplex.core.shop.ShopBase;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.ConfirmationPage;
|
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
|
||||||
public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||||
@ -77,10 +77,9 @@ public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), (mount.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
|
setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), (mount.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package mineplex.core.cosmetic.ui.page;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -11,7 +12,7 @@ import mineplex.core.donation.DonationManager;
|
|||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by shaun on 14-09-15.
|
* Created by shaun on 14-09-15.
|
||||||
@ -37,10 +38,9 @@ public class MusicPage extends GadgetPage
|
|||||||
slot = 28;
|
slot = 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package mineplex.core.cosmetic.ui.page;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -13,7 +14,7 @@ import mineplex.core.gadget.types.GadgetType;
|
|||||||
import mineplex.core.gadget.types.MorphGadget;
|
import mineplex.core.gadget.types.MorphGadget;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
import mineplex.core.inventory.InventoryManager;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class ParticlePage extends GadgetPage
|
public class ParticlePage extends GadgetPage
|
||||||
{
|
{
|
||||||
@ -40,10 +41,9 @@ public class ParticlePage extends GadgetPage
|
|||||||
slot = 28;
|
slot = 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
|||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
@ -32,8 +33,8 @@ import mineplex.core.pet.Pet;
|
|||||||
import mineplex.core.pet.PetExtra;
|
import mineplex.core.pet.PetExtra;
|
||||||
import mineplex.core.pet.types.Elf;
|
import mineplex.core.pet.types.Elf;
|
||||||
import mineplex.core.pet.types.Pumpkin;
|
import mineplex.core.pet.types.Pumpkin;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.AnvilContainer;
|
import mineplex.core.shop.page.AnvilContainer;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
|
||||||
@ -135,10 +136,9 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
slot++;
|
slot++;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
Shop.OpenPageForPlayer(Player, new Menu(Plugin, Shop, ClientManager, DonationManager, player));
|
||||||
}
|
}
|
||||||
|
@ -10,23 +10,21 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Shaun on 8/22/2014.
|
|
||||||
*/
|
|
||||||
public class TreasurePage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
public class TreasurePage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* This is unfinished
|
* This is unfinished, and unused.
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -115,10 +113,9 @@ public class TreasurePage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
Player.playSound(Player.getEyeLocation(), Sound.NOTE_PLING, 4, 1);
|
Player.playSound(Player.getEyeLocation(), Sound.NOTE_PLING, 4, 1);
|
||||||
final int slot = _chestSlots.poll();
|
final int slot = _chestSlots.poll();
|
||||||
AddButton(slot, new ShopItem(Material.CHEST, chestName, lore, 1, false), new SingleButton()
|
AddButton(slot, new ShopItem(Material.CHEST, chestName, lore, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
if (_canSelectChest)
|
if (_canSelectChest)
|
||||||
{
|
{
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
package mineplex.core.gadget.gadgets;
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import java.util.HashSet;
|
||||||
import org.bukkit.Effect;
|
import java.util.Iterator;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.FireworkEffect.Type;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
|
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||||
|
|
||||||
|
import mineplex.core.blood.BloodEvent;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilFirework;
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.gadget.types.ParticleGadget;
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -22,15 +24,18 @@ import mineplex.core.gadget.GadgetManager;
|
|||||||
|
|
||||||
public class ParticleBlizzard extends ParticleGadget
|
public class ParticleBlizzard extends ParticleGadget
|
||||||
{
|
{
|
||||||
|
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
|
||||||
|
|
||||||
public ParticleBlizzard(GadgetManager manager)
|
public ParticleBlizzard(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Test", new String[]
|
super(manager, "Frost Lord", new String[]
|
||||||
{
|
{
|
||||||
C.cWhite + "",
|
C.cWhite + "You are a mighty frost lord.",
|
||||||
|
C.cWhite + "Your double jumps and arrows",
|
||||||
|
C.cWhite + "are enchanted with snow powers.",
|
||||||
},
|
},
|
||||||
1,
|
1,
|
||||||
Material.FIREWORK, (byte)0);
|
Material.SNOW_BALL, (byte)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -46,35 +51,90 @@ public class ParticleBlizzard extends ParticleGadget
|
|||||||
|
|
||||||
if (Manager.isMoving(player))
|
if (Manager.isMoving(player))
|
||||||
{
|
{
|
||||||
for (int i=0 ; i<2 ; i++)
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4);
|
||||||
player.getWorld().playEffect(player.getLocation().add(r(1), Math.random() + 0.5, r(1)), Effect.COLOURED_DUST, 0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i=0 ; i<2 ; i++)
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(0, 5, 0), 1f, 0f, 1f, 0, 30);
|
||||||
player.getWorld().playEffect(player.getLocation().add(r(2), Math.random() + 0.5, r(2)), Effect.COLOURED_DUST, 0);
|
|
||||||
|
|
||||||
if (Math.random() > 0.95)
|
|
||||||
{
|
|
||||||
//UtilFirework.launchFirework(player.getEyeLocation(), Type.BALL, color(), true, true, new Vector(r(0.1),r(0.1),r(0.1)), 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color color()
|
@EventHandler
|
||||||
|
public void jump(PlayerToggleFlightEvent event)
|
||||||
{
|
{
|
||||||
double r = Math.random();
|
if (!shouldDisplay(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (r > 0.8) return Color.RED;
|
if (!event.getPlayer().isFlying())
|
||||||
if (r > 0.6) return Color.YELLOW;
|
if (IsActive(event.getPlayer()))
|
||||||
if (r > 0.4) return Color.LIME;
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.6f, 100);
|
||||||
if (r > 0.2) return Color.AQUA;
|
}
|
||||||
else return Color.FUCHSIA;
|
|
||||||
|
@EventHandler
|
||||||
|
public void arrow(ProjectileLaunchEvent event)
|
||||||
|
{
|
||||||
|
if (Manager.hideParticles())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getEntity() instanceof Arrow)
|
||||||
|
{
|
||||||
|
if (event.getEntity().getShooter() != null)
|
||||||
|
{
|
||||||
|
if (GetActive().contains(event.getEntity().getShooter()))
|
||||||
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
|
//UtilFirework.launchFirework(player.getEyeLocation(), Type.BALL, color(), true, true, new Vector(r(0.1),r(0.1),r(0.1)), 1);
|
||||||
|
=======
|
||||||
|
_arrows.add((Arrow)event.getEntity());
|
||||||
|
>>>>>>> chissbrokethis
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void arrow(ProjectileHitEvent event)
|
||||||
|
{
|
||||||
|
if (!_arrows.remove(event.getEntity()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getEntity().getLocation(), 0f, 0f, 0f, 0.4f, 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void arrowClean(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
|
||||||
|
{
|
||||||
|
Arrow arrow = arrowIterator.next();
|
||||||
|
|
||||||
|
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
|
||||||
|
{
|
||||||
|
arrowIterator.remove();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public double r(double mult)
|
@EventHandler
|
||||||
|
public void death(BloodEvent event)
|
||||||
{
|
{
|
||||||
return (Math.random() - 0.5)*mult;
|
if (event.getPlayer() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!IsActive(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!shouldDisplay(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.setItem(Material.SNOW_BALL, (byte)0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,6 @@ public abstract class ParticleGadget extends Gadget
|
|||||||
if (player.getGameMode() != GameMode.SURVIVAL)
|
if (player.getGameMode() != GameMode.SURVIVAL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (Manager.hideParticles())
|
if (Manager.hideParticles())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package mineplex.core.preferences.ui;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
@ -51,90 +52,90 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
|||||||
_toggleHubGames = new IButton()
|
_toggleHubGames = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleHubGames((Player)event.getWhoClicked());
|
toggleHubGames(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleHubPlayers = new IButton()
|
_toggleHubPlayers = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleHubPlayers((Player)event.getWhoClicked());
|
toggleHubPlayers(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleChat = new IButton()
|
_toggleChat = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleChat((Player)event.getWhoClicked());
|
toggleChat(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_togglePrivateChat = new IButton()
|
_togglePrivateChat = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
togglePrivateChat((Player)event.getWhoClicked());
|
togglePrivateChat(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleHubPartyRequests = new IButton()
|
_toggleHubPartyRequests = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleHubPartyRequests((Player)event.getWhoClicked());
|
toggleHubPartyRequests(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_togglePendingFriendRequests = new IButton()
|
_togglePendingFriendRequests = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
togglePendingFriendRequests((Player)event.getWhoClicked());
|
togglePendingFriendRequests(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleHubInvisibility = new IButton()
|
_toggleHubInvisibility = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleHubInvisibility((Player)event.getWhoClicked());
|
toggleHubInvisibility(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleHubForcefield = new IButton()
|
_toggleHubForcefield = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleHubForcefield((Player)event.getWhoClicked());
|
toggleHubForcefield(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleMacReports = new IButton()
|
_toggleMacReports = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleMacReports((Player)event.getWhoClicked());
|
toggleMacReports(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_toggleHubIgnoreVelocity = new IButton()
|
_toggleHubIgnoreVelocity = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
toggleHubIgnoreVelocity((Player)event.getWhoClicked());
|
toggleHubIgnoreVelocity(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.punish.UI;
|
package mineplex.core.punish.UI;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.punish.Category;
|
import mineplex.core.punish.Category;
|
||||||
import mineplex.core.shop.item.IButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class PunishButton extends SingleButton
|
public class PunishButton implements IButton
|
||||||
{
|
{
|
||||||
private PunishPage _punishPage;
|
private PunishPage _punishPage;
|
||||||
private Category _category;
|
private Category _category;
|
||||||
@ -23,8 +24,7 @@ public class PunishButton extends SingleButton
|
|||||||
_time = time;
|
_time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onClick(Player player, ClickType clickType)
|
||||||
public void Clicked(Player player)
|
|
||||||
{
|
{
|
||||||
_punishPage.AddInfraction(_category, _severity, _ban, _time);
|
_punishPage.AddInfraction(_category, _severity, _ban, _time);
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,8 @@ public class PunishPage extends CraftInventoryCustom implements Listener
|
|||||||
{
|
{
|
||||||
if (_buttonMap.containsKey(event.getRawSlot()))
|
if (_buttonMap.containsKey(event.getRawSlot()))
|
||||||
{
|
{
|
||||||
_buttonMap.get(event.getRawSlot()).Clicked(event);
|
if (event.getWhoClicked() instanceof Player)
|
||||||
|
_buttonMap.get(event.getRawSlot()).onClick(((Player) event.getWhoClicked()), event.getClick());
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.core.punish.UI;
|
package mineplex.core.punish.UI;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.punish.Punishment;
|
import mineplex.core.punish.Punishment;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
public class RemovePunishmentButton extends SingleButton
|
public class RemovePunishmentButton implements IButton
|
||||||
{
|
{
|
||||||
private PunishPage _punishPage;
|
private PunishPage _punishPage;
|
||||||
private Punishment _punishment;
|
private Punishment _punishment;
|
||||||
@ -20,7 +21,7 @@ public class RemovePunishmentButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_punishPage.RemovePunishment(_punishment, _item);
|
_punishPage.RemovePunishment(_punishment, _item);
|
||||||
}
|
}
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
package mineplex.core.shop.item;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
|
||||||
|
|
||||||
public abstract class ComplexButton implements IButton
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void Clicked(InventoryClickEvent event)
|
|
||||||
{
|
|
||||||
if (event.isLeftClick())
|
|
||||||
{
|
|
||||||
if (event.isShiftClick())
|
|
||||||
ClickedShiftLeft((Player) event.getWhoClicked());
|
|
||||||
else
|
|
||||||
ClickedLeft((Player) event.getWhoClicked());
|
|
||||||
}
|
|
||||||
if (event.isRightClick())
|
|
||||||
{
|
|
||||||
if (event.isShiftClick())
|
|
||||||
ClickedShiftRight((Player) event.getWhoClicked());
|
|
||||||
else
|
|
||||||
ClickedRight((Player) event.getWhoClicked());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void ClickedLeft(Player player);
|
|
||||||
public abstract void ClickedShiftLeft(Player player);
|
|
||||||
public abstract void ClickedRight(Player player);
|
|
||||||
public abstract void ClickedShiftRight(Player player);
|
|
||||||
}
|
|
@ -1,8 +1,10 @@
|
|||||||
package mineplex.core.shop.item;
|
package mineplex.core.shop.item;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
public interface IButton
|
public interface IButton
|
||||||
{
|
{
|
||||||
public void Clicked(InventoryClickEvent event);
|
public void onClick(Player player, ClickType clickType);
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
package mineplex.core.shop.item;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
|
||||||
|
|
||||||
public abstract class SingleButton implements IButton
|
|
||||||
{
|
|
||||||
public abstract void Clicked(Player player);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void Clicked(InventoryClickEvent event)
|
|
||||||
{
|
|
||||||
Clicked((Player)event.getWhoClicked());
|
|
||||||
}
|
|
||||||
}
|
|
@ -19,6 +19,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends ShopBase<PluginType>> extends ShopPageBase<PluginType, ShopType> implements Runnable
|
public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends ShopBase<PluginType>> extends ShopPageBase<PluginType, ShopType> implements Runnable
|
||||||
@ -61,18 +62,18 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
|
|||||||
IButton okClicked = new IButton()
|
IButton okClicked = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
OkClicked((Player)event.getWhoClicked());
|
OkClicked(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IButton cancelClicked = new IButton()
|
IButton cancelClicked = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
CancelClicked((Player)event.getWhoClicked());
|
CancelClicked(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -192,9 +193,9 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
|
|||||||
IButton returnButton = new IButton()
|
IButton returnButton = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
CancelClicked((Player)event.getWhoClicked());
|
CancelClicked(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -212,9 +213,9 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
|
|||||||
IButton returnButton = new IButton()
|
IButton returnButton = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
CancelClicked((Player)event.getWhoClicked());
|
CancelClicked(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ package mineplex.core.shop.page;
|
|||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryCustom;
|
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryCustom;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.account.CoreClient;
|
import mineplex.core.account.CoreClient;
|
||||||
@ -15,7 +15,6 @@ import mineplex.core.account.CoreClientManager;
|
|||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
import mineplex.core.common.util.NautHashMap;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.shop.ShopBase;
|
import mineplex.core.shop.ShopBase;
|
||||||
import mineplex.core.shop.item.IButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
@ -77,7 +76,7 @@ public abstract class ShopPageBase<PluginType extends MiniPlugin, ShopType exten
|
|||||||
|
|
||||||
protected abstract void BuildPage();
|
protected abstract void BuildPage();
|
||||||
|
|
||||||
protected void AddItem(int slot, ShopItem item)
|
protected void AddItem(int slot, ItemStack item)
|
||||||
{
|
{
|
||||||
if (slot > inventory.getSize() - 1)
|
if (slot > inventory.getSize() - 1)
|
||||||
{
|
{
|
||||||
@ -85,7 +84,22 @@ public abstract class ShopPageBase<PluginType extends MiniPlugin, ShopType exten
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getInventory().setItem(slot, item.getHandle());
|
setItem(slot, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void AddItemFakeCount(int slot, ItemStack item, int fakeCount)
|
||||||
|
{
|
||||||
|
net.minecraft.server.v1_7_R4.ItemStack nmsStack = CraftItemStack.asNMSCopy(item);
|
||||||
|
nmsStack.count = fakeCount;
|
||||||
|
|
||||||
|
if (slot > inventory.getSize() - 1)
|
||||||
|
{
|
||||||
|
((CraftPlayer) Player).getHandle().inventory.setItem(getPlayerSlot(slot), nmsStack);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getInventory().setItem(slot, nmsStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,13 +108,20 @@ public abstract class ShopPageBase<PluginType extends MiniPlugin, ShopType exten
|
|||||||
return slot >= (inventory.getSize() + 27) ? slot - (inventory.getSize() + 27) : slot - (inventory.getSize() - 9);
|
return slot >= (inventory.getSize() + 27) ? slot - (inventory.getSize() + 27) : slot - (inventory.getSize() - 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AddButton(int slot, ShopItem item, IButton button)
|
protected void AddButton(int slot, ItemStack item, IButton button)
|
||||||
{
|
{
|
||||||
AddItem(slot, item);
|
AddItem(slot, item);
|
||||||
|
|
||||||
ButtonMap.put(slot, button);
|
ButtonMap.put(slot, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void AddButtonFakeCount(int slot, ItemStack item, IButton button, int fakeItemCount)
|
||||||
|
{
|
||||||
|
AddItemFakeCount(slot, item, fakeItemCount);
|
||||||
|
|
||||||
|
ButtonMap.put(slot, button);
|
||||||
|
}
|
||||||
|
|
||||||
protected void addGlow(int slot)
|
protected void addGlow(int slot)
|
||||||
{
|
{
|
||||||
UtilInv.addDullEnchantment(getItem(slot));
|
UtilInv.addDullEnchantment(getItem(slot));
|
||||||
@ -116,7 +137,7 @@ public abstract class ShopPageBase<PluginType extends MiniPlugin, ShopType exten
|
|||||||
{
|
{
|
||||||
if (ButtonMap.containsKey(event.getRawSlot()))
|
if (ButtonMap.containsKey(event.getRawSlot()))
|
||||||
{
|
{
|
||||||
ButtonMap.get(event.getRawSlot()).Clicked(event);
|
ButtonMap.get(event.getRawSlot()).onClick(Player, event.getClick());
|
||||||
}
|
}
|
||||||
else if (event.getRawSlot() != -999)
|
else if (event.getRawSlot() != -999)
|
||||||
{
|
{
|
||||||
|
16
Plugins/Mineplex.Game.Clans/Mineplex.Game.Clans.iml
Normal file
16
Plugins/Mineplex.Game.Clans/Mineplex.Game.Clans.iml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module" module-name="Mineplex.Core" />
|
||||||
|
<orderEntry type="module" module-name="Mineplex.Core.Common" />
|
||||||
|
<orderEntry type="module" module-name="Mineplex.Minecraft.Game.ClassCombat" />
|
||||||
|
<orderEntry type="module" module-name="Mineplex.Minecraft.Game.Core" />
|
||||||
|
<orderEntry type="library" name="craftbukkit" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.game.clans.shop;
|
package mineplex.game.clans.shop;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.ComplexButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import mineplex.game.clans.clans.ClansManager;
|
import mineplex.game.clans.clans.ClansManager;
|
||||||
|
|
||||||
public class PvpShopButton<PageType extends ShopPageBase<ClansManager, BuildingShop>> extends ComplexButton
|
public class PvpShopButton<PageType extends ShopPageBase<ClansManager, BuildingShop>> implements IButton
|
||||||
{
|
{
|
||||||
protected PageType Page;
|
protected PageType Page;
|
||||||
protected PvpItem Item;
|
protected PvpItem Item;
|
||||||
@ -16,27 +17,16 @@ public class PvpShopButton<PageType extends ShopPageBase<ClansManager, BuildingS
|
|||||||
Page = page;
|
Page = page;
|
||||||
Item = item;
|
Item = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedLeft(Player player)
|
|
||||||
{
|
|
||||||
int balance = Page.getDonationManager().Get(player.getName()).getGold();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ClickedShiftLeft(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
|
if (clickType == ClickType.LEFT)
|
||||||
|
{
|
||||||
|
int balance = Page.getDonationManager().Get(player.getName()).getGold();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedRight(Player player)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftRight(Player player)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -142,9 +142,9 @@ public class MailMessage implements Notification
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clicked(final InventoryClickEvent event)
|
public void clicked(final Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
if (event.getClick() == ClickType.SHIFT_RIGHT)
|
if (clickType == ClickType.SHIFT_RIGHT)
|
||||||
{
|
{
|
||||||
_manager.archive(this, new Callback<Boolean>()
|
_manager.archive(this, new Callback<Boolean>()
|
||||||
{
|
{
|
||||||
@ -153,7 +153,6 @@ public class MailMessage implements Notification
|
|||||||
{
|
{
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
Player player = (Player) event.getWhoClicked();
|
|
||||||
player.playSound(player.getLocation(), Sound.SPLASH, 1, 0);
|
player.playSound(player.getLocation(), Sound.SPLASH, 1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package mineplex.hub.notification.api;
|
package mineplex.hub.notification.api;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
public interface Notification
|
public interface Notification
|
||||||
@ -15,7 +17,7 @@ public interface Notification
|
|||||||
|
|
||||||
public byte getData();
|
public byte getData();
|
||||||
|
|
||||||
public void clicked(InventoryClickEvent event);
|
public void clicked(Player player, ClickType clickType);
|
||||||
|
|
||||||
public NotificationPriority getPriority();
|
public NotificationPriority getPriority();
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ public class NotificationButton implements IButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_notification.clicked(event);
|
_notification.clicked(player, clickType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import mineplex.hub.queue.QueueManager;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
public class QueuePage extends ShopPageBase<QueueManager, QueueShop>
|
public class QueuePage extends ShopPageBase<QueueManager, QueueShop>
|
||||||
@ -73,18 +74,18 @@ public class QueuePage extends ShopPageBase<QueueManager, QueueShop>
|
|||||||
IButton okClicked = new IButton()
|
IButton okClicked = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
OkClicked((Player)event.getWhoClicked());
|
OkClicked(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IButton cancelClicked = new IButton()
|
IButton cancelClicked = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
CancelClicked((Player)event.getWhoClicked());
|
CancelClicked(player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -103,9 +104,9 @@ public class QueuePage extends ShopPageBase<QueueManager, QueueShop>
|
|||||||
IButton queueButton = new IButton()
|
IButton queueButton = new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(InventoryClickEvent event)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
queuePlayer("Dominate", (Player)event.getWhoClicked());
|
queuePlayer("Dominate", player);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
@ -14,8 +15,8 @@ import mineplex.core.common.util.C;
|
|||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.logger.Logger;
|
import mineplex.core.logger.Logger;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.item.SingleButton;
|
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import mineplex.hub.server.ServerInfo;
|
import mineplex.hub.server.ServerInfo;
|
||||||
import mineplex.hub.server.ServerManager;
|
import mineplex.hub.server.ServerManager;
|
||||||
@ -246,10 +247,10 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 1 : yellowCount, false), new SingleButton()
|
AddButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 1 : yellowCount, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_onMainPage = false;
|
_onMainPage = false;
|
||||||
}
|
}
|
||||||
@ -296,10 +297,10 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new SingleButton()
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
_onMainPage = true;
|
_onMainPage = true;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ServerInfo;
|
import mineplex.hub.server.ServerInfo;
|
||||||
import mineplex.hub.server.ui.IServerPage;
|
import mineplex.hub.server.ui.IServerPage;
|
||||||
|
|
||||||
public class JoinServerButton extends SingleButton
|
public class JoinServerButton implements IButton
|
||||||
{
|
{
|
||||||
private IServerPage _page;
|
private IServerPage _page;
|
||||||
private ServerInfo _serverInfo;
|
private ServerInfo _serverInfo;
|
||||||
@ -18,7 +19,7 @@ public class JoinServerButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.SelectServer(player, _serverInfo);
|
_page.SelectServer(player, _serverInfo);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectBHButton extends SingleButton
|
public class SelectBHButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectBHButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenBH(player);
|
_menu.OpenBH(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectBRButton extends SingleButton
|
public class SelectBRButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectBRButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenBR(player);
|
_menu.OpenBR(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectCSButton extends SingleButton
|
public class SelectCSButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectCSButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.openCS(player);
|
_menu.openCS(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectDMTButton extends SingleButton
|
public class SelectDMTButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectDMTButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.openDMT(player);
|
_menu.openDMT(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectDOMButton extends SingleButton
|
public class SelectDOMButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectDOMButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenDOM(player);
|
_menu.OpenDOM(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectMINButton extends SingleButton
|
public class SelectMINButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectMINButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenMIN(player);
|
_menu.OpenMIN(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectMSButton extends SingleButton
|
public class SelectMSButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectMSButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.openMS(player);
|
_menu.openMS(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectSGButton extends SingleButton
|
public class SelectSGButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectSGButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenSG(player);
|
_menu.OpenSG(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectSSMButton extends SingleButton
|
public class SelectSSMButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectSSMButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenSSM(player);
|
_menu.OpenSSM(player);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package mineplex.hub.server.ui.button;
|
package mineplex.hub.server.ui.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.hub.server.ui.ServerGameMenu;
|
import mineplex.hub.server.ui.ServerGameMenu;
|
||||||
|
|
||||||
public class SelectTDMButton extends SingleButton
|
public class SelectTDMButton implements IButton
|
||||||
{
|
{
|
||||||
private ServerGameMenu _menu;
|
private ServerGameMenu _menu;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class SelectTDMButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_menu.OpenTDM(player);
|
_menu.OpenTDM(player);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
||||||
|
|
||||||
public class DeleteCustomBuildButton extends SingleButton
|
public class DeleteCustomBuildButton implements IButton
|
||||||
{
|
{
|
||||||
private CustomBuildPage _page;
|
private CustomBuildPage _page;
|
||||||
private CustomBuildToken _customBuild;
|
private CustomBuildToken _customBuild;
|
||||||
@ -18,7 +19,7 @@ public class DeleteCustomBuildButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.DeleteCustomBuild(_customBuild);
|
_page.DeleteCustomBuild(_customBuild);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.item.Item;
|
import mineplex.minecraft.game.classcombat.item.Item;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
||||||
|
|
||||||
public class DeselectItemButton extends SingleButton
|
public class DeselectItemButton implements IButton
|
||||||
{
|
{
|
||||||
private SkillPage _page;
|
private SkillPage _page;
|
||||||
private Item _item;
|
private Item _item;
|
||||||
@ -20,7 +21,7 @@ public class DeselectItemButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.DeselectItem(player, _item, _index);
|
_page.DeselectItem(player, _item, _index);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
||||||
|
|
||||||
public class EditAndSaveCustomBuildButton extends SingleButton
|
public class EditAndSaveCustomBuildButton implements IButton
|
||||||
{
|
{
|
||||||
private CustomBuildPage _page;
|
private CustomBuildPage _page;
|
||||||
private CustomBuildToken _customBuild;
|
private CustomBuildToken _customBuild;
|
||||||
@ -18,7 +19,7 @@ public class EditAndSaveCustomBuildButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.EditAndSaveCustomBuild(_customBuild);
|
_page.EditAndSaveCustomBuild(_customBuild);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.item.Item;
|
import mineplex.minecraft.game.classcombat.item.Item;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class PurchaseItemButton extends SingleButton
|
public class PurchaseItemButton implements IButton
|
||||||
{
|
{
|
||||||
private SkillPage _page;
|
private SkillPage _page;
|
||||||
private Item _item;
|
private Item _item;
|
||||||
@ -18,7 +19,7 @@ public class PurchaseItemButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.PurchaseItem(player, _item);
|
_page.PurchaseItem(player, _item);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.ISkill;
|
import mineplex.minecraft.game.classcombat.Skill.ISkill;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class PurchaseSkillButton extends SingleButton
|
public class PurchaseSkillButton implements IButton
|
||||||
{
|
{
|
||||||
private SkillPage _page;
|
private SkillPage _page;
|
||||||
private ISkill _skill;
|
private ISkill _skill;
|
||||||
@ -18,7 +19,7 @@ public class PurchaseSkillButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.PurchaseSkill(player, _skill);
|
_page.PurchaseSkill(player, _skill);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.ArmorPage;
|
import mineplex.minecraft.game.classcombat.shop.page.ArmorPage;
|
||||||
|
|
||||||
public class SelectClassButton extends SingleButton
|
public class SelectClassButton implements IButton
|
||||||
{
|
{
|
||||||
ArmorPage _page;
|
ArmorPage _page;
|
||||||
private IPvpClass _pvpClass;
|
private IPvpClass _pvpClass;
|
||||||
@ -18,7 +19,7 @@ public class SelectClassButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.SelectClass(player, _pvpClass);
|
_page.SelectClass(player, _pvpClass);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package mineplex.minecraft.game.classcombat.shop.button;
|
package mineplex.minecraft.game.classcombat.shop.button;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
|
||||||
|
|
||||||
public class SelectCustomBuildButton extends SingleButton
|
public class SelectCustomBuildButton implements IButton
|
||||||
{
|
{
|
||||||
private CustomBuildPage _page;
|
private CustomBuildPage _page;
|
||||||
private CustomBuildToken _customBuild;
|
private CustomBuildToken _customBuild;
|
||||||
@ -18,7 +19,7 @@ public class SelectCustomBuildButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_page.SelectCustomBuild(_customBuild);
|
_page.SelectCustomBuild(_customBuild);
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,13 @@ package mineplex.minecraft.game.classcombat.shop.button;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.ComplexButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.item.Item;
|
import mineplex.minecraft.game.classcombat.item.Item;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
||||||
|
|
||||||
public class SelectItemButton extends ComplexButton
|
public class SelectItemButton implements IButton
|
||||||
{
|
{
|
||||||
private SkillPage _page;
|
private SkillPage _page;
|
||||||
private Item _item;
|
private Item _item;
|
||||||
@ -19,34 +20,24 @@ public class SelectItemButton extends ComplexButton
|
|||||||
_item = item;
|
_item = item;
|
||||||
_canAfford = canAfford;
|
_canAfford = canAfford;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ClickedLeft(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
if (!_canAfford)
|
if (clickType.isLeftClick())
|
||||||
{
|
{
|
||||||
player.playSound(player.getLocation(), Sound.NOTE_BASS_GUITAR, 1f, 0.5f);
|
if (!_canAfford)
|
||||||
return;
|
{
|
||||||
|
player.playSound(player.getLocation(), Sound.NOTE_BASS_GUITAR, 1f, 0.5f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_page.SelectItem(player, _item);
|
||||||
|
}
|
||||||
|
else if (clickType.isRightClick())
|
||||||
|
{
|
||||||
|
_page.DeselectItem(player, _item);
|
||||||
}
|
}
|
||||||
|
|
||||||
_page.SelectItem(player, _item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedRight(Player player)
|
|
||||||
{
|
|
||||||
_page.DeselectItem(player, _item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftLeft(Player player)
|
|
||||||
{
|
|
||||||
ClickedLeft(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftRight(Player player)
|
|
||||||
{
|
|
||||||
ClickedRight(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,13 @@ package mineplex.minecraft.game.classcombat.shop.button;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.shop.item.ComplexButton;
|
|
||||||
import mineplex.core.shop.item.IButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.ISkill;
|
import mineplex.minecraft.game.classcombat.Skill.ISkill;
|
||||||
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
import mineplex.minecraft.game.classcombat.shop.page.SkillPage;
|
||||||
|
|
||||||
public class SelectSkillButton extends ComplexButton
|
public class SelectSkillButton implements IButton
|
||||||
{
|
{
|
||||||
private SkillPage _page;
|
private SkillPage _page;
|
||||||
private ISkill _skill;
|
private ISkill _skill;
|
||||||
@ -22,34 +22,24 @@ public class SelectSkillButton extends ComplexButton
|
|||||||
_level = level;
|
_level = level;
|
||||||
_canAfford = canAfford;
|
_canAfford = canAfford;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ClickedLeft(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
if (!_canAfford)
|
if (clickType.isLeftClick())
|
||||||
{
|
{
|
||||||
player.playSound(player.getLocation(), Sound.NOTE_BASS_GUITAR, 1f, 0.5f);
|
if (!_canAfford)
|
||||||
return;
|
{
|
||||||
|
player.playSound(player.getLocation(), Sound.NOTE_BASS_GUITAR, 1f, 0.5f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_page.SelectSkill(player, _skill, _level);
|
||||||
|
}
|
||||||
|
else if (clickType.isRightClick())
|
||||||
|
{
|
||||||
|
_page.DeselectSkill(player, _skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
_page.SelectSkill(player, _skill, _level);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedRight(Player player)
|
|
||||||
{
|
|
||||||
_page.DeselectSkill(player, _skill);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftLeft(Player player)
|
|
||||||
{
|
|
||||||
ClickedLeft(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void ClickedShiftRight(Player player)
|
|
||||||
{
|
|
||||||
ClickedRight(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -526,6 +526,12 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName())
|
String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName())
|
||||||
+ "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
+ "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
||||||
|
|
||||||
|
if (_gameHostManager.isPrivateServer() && _gameHostManager.isHostExpired())
|
||||||
|
{
|
||||||
|
event.setMotd(ChatColor.RED + "Finished");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Always Joinable
|
//Always Joinable
|
||||||
if (_game != null && _game.JoinInProgress)
|
if (_game != null && _game.JoinInProgress)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ public enum GameType
|
|||||||
ChampionsDominate("Champions Domination", "Champions", Material.BEACON, (byte)0),
|
ChampionsDominate("Champions Domination", "Champions", Material.BEACON, (byte)0),
|
||||||
ChampionsMOBA("Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0),
|
ChampionsMOBA("Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0),
|
||||||
Christmas("Christmas Chaos", Material.SNOW_BALL, (byte)0),
|
Christmas("Christmas Chaos", Material.SNOW_BALL, (byte)0),
|
||||||
DeathTag("Death Tag", Material.SKULL, (byte)0),
|
DeathTag("Death Tag", Material.SKULL_ITEM, (byte)0),
|
||||||
DragonEscape("Dragon Escape", Material.DRAGON_EGG, (byte)0),
|
DragonEscape("Dragon Escape", Material.DRAGON_EGG, (byte)0),
|
||||||
DragonEscapeTeams("Dragon Escape Teams", Material.DRAGON_EGG, (byte)0),
|
DragonEscapeTeams("Dragon Escape Teams", Material.DRAGON_EGG, (byte)0),
|
||||||
DragonRiders("Dragon Riders", Material.DRAGON_EGG, (byte)0),
|
DragonRiders("Dragon Riders", Material.DRAGON_EGG, (byte)0),
|
||||||
@ -63,12 +63,16 @@ public enum GameType
|
|||||||
{
|
{
|
||||||
_name = name;
|
_name = name;
|
||||||
_lobbyName = name;
|
_lobbyName = name;
|
||||||
|
_mat = mat;
|
||||||
|
_data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameType(String name, String lobbyName, Material mat, byte data)
|
GameType(String name, String lobbyName, Material mat, byte data)
|
||||||
{
|
{
|
||||||
_name = name;
|
_name = name;
|
||||||
_lobbyName = lobbyName;
|
_lobbyName = lobbyName;
|
||||||
|
_mat = mat;
|
||||||
|
_data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String GetName()
|
public String GetName()
|
||||||
|
@ -32,7 +32,7 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
import nautilus.game.arcade.game.Game;
|
import nautilus.game.arcade.game.Game;
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.gui.SpectatorShop;
|
import nautilus.game.arcade.gui.spectatorMenu.SpectatorShop;
|
||||||
|
|
||||||
public class CompassAddon extends MiniPlugin
|
public class CompassAddon extends MiniPlugin
|
||||||
{
|
{
|
||||||
|
@ -69,21 +69,7 @@ public class SetCommand extends CommandBase<ArcadeManager>
|
|||||||
}
|
}
|
||||||
|
|
||||||
GameType type = matches.get(0);
|
GameType type = matches.get(0);
|
||||||
Plugin.GetGameCreationManager().SetNextGameType(type);
|
Plugin.GetGame().setGame(type, caller, true);
|
||||||
|
|
||||||
//End Current
|
|
||||||
if (Plugin.GetGame().GetState() == GameState.Recruit)
|
|
||||||
{
|
|
||||||
Plugin.GetGame().SetState(GameState.Dead);
|
|
||||||
|
|
||||||
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has changed game to " + type.GetName() + ".");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " set next game to " + type.GetName() + ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1322,4 +1322,23 @@ public abstract class Game implements Listener
|
|||||||
((CraftWorld) event.getWorld()).getHandle().spigotConfig.itemMerge = _itemMergeRadius;
|
((CraftWorld) event.getWorld()).getHandle().spigotConfig.itemMerge = _itemMergeRadius;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setGame(GameType gameType, Player caller, boolean inform)
|
||||||
|
{
|
||||||
|
Manager.GetGameCreationManager().SetNextGameType(gameType);
|
||||||
|
|
||||||
|
//End Current
|
||||||
|
if (GetState() == GameState.Recruit)
|
||||||
|
{
|
||||||
|
SetState(GameState.Dead);
|
||||||
|
|
||||||
|
if (inform)
|
||||||
|
Announce(C.cAqua + C.Bold + caller.getName() + " has changed game to " + gameType.GetName() + ".");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (inform)
|
||||||
|
Announce(C.cAqua + C.Bold + caller.getName() + " set next game to " + gameType.GetName() + ".");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
event.GetDamagerPlayer(true).setFoodLevel(20);
|
event.GetDamagerPlayer(true).setFoodLevel(20);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
Host.Manager.GetBlood().Effects(event.GetDamageeEntity().getLocation(), 10, 0.2, null, 0f, 0f, Material.BLAZE_POWDER, (byte)0, 10, false);
|
Host.Manager.GetBlood().Effects(null, event.GetDamageeEntity().getLocation(), 10, 0.2, null, 0f, 0f, Material.BLAZE_POWDER, (byte)0, 10, false);
|
||||||
event.GetDamageeEntity().getWorld().playEffect(event.GetDamageeEntity().getLocation(), Effect.STEP_SOUND, 51);
|
event.GetDamageeEntity().getWorld().playEffect(event.GetDamageeEntity().getLocation(), Effect.STEP_SOUND, 51);
|
||||||
|
|
||||||
//Remove
|
//Remove
|
||||||
@ -423,7 +423,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
|
|||||||
|
|
||||||
if (UtilMath.offset(loc, minion.getLocation()) > 16)
|
if (UtilMath.offset(loc, minion.getLocation()) > 16)
|
||||||
{
|
{
|
||||||
Host.Manager.GetBlood().Effects(minion.getEyeLocation(), 10, 0.2, Sound.SKELETON_HURT, 1f, 1f, Material.BONE, (byte)0, 20, false);
|
Host.Manager.GetBlood().Effects(null, minion.getEyeLocation(), 10, 0.2, Sound.SKELETON_HURT, 1f, 1f, Material.BONE, (byte)0, 20, false);
|
||||||
minion.teleport(loc);
|
minion.teleport(loc);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package nautilus.game.arcade.game.games.searchanddestroy;
|
package nautilus.game.arcade.game.games.searchanddestroy;
|
||||||
|
|
||||||
import mineplex.core.shop.item.SingleButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
public class EvolveButton extends SingleButton
|
public class EvolveButton implements IButton
|
||||||
{
|
{
|
||||||
private SearchAndDestroy _arcadeManager;
|
private SearchAndDestroy _arcadeManager;
|
||||||
private Kit _kit;
|
private Kit _kit;
|
||||||
@ -18,7 +19,7 @@ public class EvolveButton extends SingleButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Clicked(Player player)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
// Make sure this player isn't a spectator
|
// Make sure this player isn't a spectator
|
||||||
if (((CraftPlayer) player).getHandle().spectating)
|
if (((CraftPlayer) player).getHandle().spectating)
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.shop.ShopBase;
|
||||||
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.MenuPage;
|
||||||
|
|
||||||
|
public class PrivateServerShop extends ShopBase<ArcadeManager>
|
||||||
|
{
|
||||||
|
public PrivateServerShop(ArcadeManager plugin, CoreClientManager clientManager, DonationManager donationManager)
|
||||||
|
{
|
||||||
|
super(plugin, clientManager, donationManager, "Private Server Menu");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ShopPageBase<ArcadeManager, ? extends ShopBase<ArcadeManager>> BuildPagesFor(Player player)
|
||||||
|
{
|
||||||
|
return new MenuPage(Plugin, this, player);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.button;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.BanPage;
|
||||||
|
|
||||||
|
public class BanButton implements IButton
|
||||||
|
{
|
||||||
|
private ArcadeManager _arcadeManager;
|
||||||
|
private PrivateServerShop _shop;
|
||||||
|
|
||||||
|
public BanButton(ArcadeManager arcadeManager, PrivateServerShop shop)
|
||||||
|
{
|
||||||
|
_shop = shop;
|
||||||
|
_arcadeManager = arcadeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_shop.OpenPageForPlayer(player, new BanPage(_arcadeManager, _shop, player));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.button;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.EditRotationPage;
|
||||||
|
|
||||||
|
public class EditRotationButton implements IButton
|
||||||
|
{
|
||||||
|
private ArcadeManager _arcadeManager;
|
||||||
|
private PrivateServerShop _shop;
|
||||||
|
|
||||||
|
public EditRotationButton(ArcadeManager arcadeManager, PrivateServerShop shop)
|
||||||
|
{
|
||||||
|
_shop = shop;
|
||||||
|
_arcadeManager = arcadeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_shop.OpenPageForPlayer(player, new EditRotationPage(_arcadeManager, _shop, player));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.button;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.GiveAdminPage;
|
||||||
|
|
||||||
|
public class GiveAdminButton implements IButton
|
||||||
|
{
|
||||||
|
private ArcadeManager _arcadeManager;
|
||||||
|
private PrivateServerShop _shop;
|
||||||
|
|
||||||
|
public GiveAdminButton(ArcadeManager arcadeManager, PrivateServerShop shop)
|
||||||
|
{
|
||||||
|
_shop = shop;
|
||||||
|
_arcadeManager = arcadeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_shop.OpenPageForPlayer(player, new GiveAdminPage(_arcadeManager, _shop, player));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.button;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.OptionsPage;
|
||||||
|
|
||||||
|
public class OptionsButton implements IButton
|
||||||
|
{
|
||||||
|
private ArcadeManager _arcadeManager;
|
||||||
|
private PrivateServerShop _shop;
|
||||||
|
|
||||||
|
public OptionsButton(ArcadeManager arcadeManager, PrivateServerShop shop)
|
||||||
|
{
|
||||||
|
_shop = shop;
|
||||||
|
_arcadeManager = arcadeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_shop.OpenPageForPlayer(player, new OptionsPage(_arcadeManager, _shop, player));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.button;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.SetGamePage;
|
||||||
|
|
||||||
|
public class SetGameButton implements IButton
|
||||||
|
{
|
||||||
|
private ArcadeManager _arcadeManager;
|
||||||
|
private PrivateServerShop _shop;
|
||||||
|
|
||||||
|
public SetGameButton(ArcadeManager arcadeManager, PrivateServerShop shop)
|
||||||
|
{
|
||||||
|
_shop = shop;
|
||||||
|
_arcadeManager = arcadeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_shop.OpenPageForPlayer(player, new SetGamePage(_arcadeManager, _shop, player));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.button;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.page.UnbanPage;
|
||||||
|
|
||||||
|
public class UnbanButton implements IButton
|
||||||
|
{
|
||||||
|
private ArcadeManager _arcadeManager;
|
||||||
|
private PrivateServerShop _shop;
|
||||||
|
|
||||||
|
public UnbanButton(ArcadeManager arcadeManager, PrivateServerShop shop)
|
||||||
|
{
|
||||||
|
_shop = shop;
|
||||||
|
_arcadeManager = arcadeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_shop.OpenPageForPlayer(player, new UnbanPage(_arcadeManager, _shop, player));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public class BanPage extends PlayerPage
|
||||||
|
{
|
||||||
|
public BanPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Ban Players", player);
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean showPlayer(Player player)
|
||||||
|
{
|
||||||
|
return !_manager.isAdmin(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clicked(int slot, Player player)
|
||||||
|
{
|
||||||
|
RemoveButton(slot);
|
||||||
|
_manager.ban(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayString(Player player)
|
||||||
|
{
|
||||||
|
return "Click to Ban Player";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.managers.GameHostManager;
|
||||||
|
|
||||||
|
public abstract class BasePage extends ShopPageBase<ArcadeManager, PrivateServerShop>
|
||||||
|
{
|
||||||
|
protected GameHostManager _manager;
|
||||||
|
|
||||||
|
public BasePage(ArcadeManager plugin, PrivateServerShop shop, String pageName, Player player)
|
||||||
|
{
|
||||||
|
this(plugin, shop, pageName, player, 54);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePage(ArcadeManager plugin, PrivateServerShop shop, String pageName, Player player, int slots)
|
||||||
|
{
|
||||||
|
super(plugin, shop, plugin.GetClients(), plugin.GetDonation(), pageName, player, slots);
|
||||||
|
|
||||||
|
_manager = plugin.GetGameHostManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addBackButton(int slot)
|
||||||
|
{
|
||||||
|
AddButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] { }, 1, false), new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
Shop.OpenPageForPlayer(player, new MenuPage(Plugin, Shop, player));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getPlayerHead(String playerName, String title)
|
||||||
|
{
|
||||||
|
return getPlayerHead(playerName, title, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getPlayerHead(String playerName, String title, String[] lore)
|
||||||
|
{
|
||||||
|
ItemStack is = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
|
||||||
|
|
||||||
|
SkullMeta meta = ((SkullMeta) is.getItemMeta());
|
||||||
|
meta.setOwner(playerName);
|
||||||
|
meta.setDisplayName(title);
|
||||||
|
if (lore != null)
|
||||||
|
meta.setLore(Arrays.asList(lore));
|
||||||
|
is.setItemMeta(meta);
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.GameType;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public class EditRotationPage extends BasePage
|
||||||
|
{
|
||||||
|
public EditRotationPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Edit Rotation", player);
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void BuildPage()
|
||||||
|
{
|
||||||
|
addBackButton(4);
|
||||||
|
|
||||||
|
int slot = 9;
|
||||||
|
List<GameType> enabledGames = Plugin.GetServerConfig().GameList;
|
||||||
|
for (GameType type : _manager.getAvailableGames(Player))
|
||||||
|
{
|
||||||
|
addGameButton(slot, type, enabledGames.contains(type));
|
||||||
|
slot++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addGameButton(int slot, final GameType type, boolean enabled)
|
||||||
|
{
|
||||||
|
String titleString = ChatColor.RESET + (enabled ? C.cGreen : C.cRed) + ChatColor.BOLD + type.GetLobbyName();
|
||||||
|
String infoString = ChatColor.RESET + C.cGray + (enabled ? "Click to Disable" : "Click to Enable");
|
||||||
|
ShopItem shopItem = new ShopItem(type.GetMaterial(), type.GetMaterialData(), titleString, new String[]{infoString}, 1, false, false);
|
||||||
|
int itemCount = enabled ? 1 : 0;
|
||||||
|
|
||||||
|
AddButtonFakeCount(slot, shopItem, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
String announceString = C.Bold + type.GetLobbyName();
|
||||||
|
|
||||||
|
if (Plugin.GetServerConfig().GameList.contains(type))
|
||||||
|
{
|
||||||
|
Plugin.GetServerConfig().GameList.remove(type);
|
||||||
|
announceString = C.cRed + announceString + " removed from rotation.";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Plugin.GetServerConfig().GameList.add(type);
|
||||||
|
announceString = C.cGreen + announceString + " added to rotation.";
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.GetGame().Announce(announceString);
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
}, itemCount);
|
||||||
|
|
||||||
|
if (enabled)
|
||||||
|
addGlow(slot);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public class GiveAdminPage extends PlayerPage
|
||||||
|
{
|
||||||
|
public GiveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Give Admin", player);
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean showPlayer(Player player)
|
||||||
|
{
|
||||||
|
return !_manager.isAdmin(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clicked(int slot, Player player)
|
||||||
|
{
|
||||||
|
RemoveButton(slot);
|
||||||
|
_manager.giveAdmin(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayString(Player player)
|
||||||
|
{
|
||||||
|
return "Click to Make Admin";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.button.BanButton;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.button.EditRotationButton;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.button.GiveAdminButton;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.button.SetGameButton;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.button.OptionsButton;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.button.UnbanButton;
|
||||||
|
|
||||||
|
public class MenuPage extends BasePage
|
||||||
|
{
|
||||||
|
public MenuPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Private Server Menu", player, 9*3);
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void BuildPage()
|
||||||
|
{
|
||||||
|
ItemStack ownerHead = getOwnerHead();
|
||||||
|
setItem(4, ownerHead);
|
||||||
|
|
||||||
|
SetGameButton setGameButton = new SetGameButton(Plugin, Shop);
|
||||||
|
AddButton(1 + 9, new ShopItem(Material.BOOK_AND_QUILL, "Set Game", new String[] {}, 1, false), setGameButton);
|
||||||
|
|
||||||
|
EditRotationButton editRotationButton = new EditRotationButton(Plugin, Shop);
|
||||||
|
AddButton(1 + 18, new ShopItem(Material.BOOK, "Edit Game Rotation", new String[]{}, 1, false), editRotationButton);
|
||||||
|
|
||||||
|
GiveAdminButton giveAdminButton = new GiveAdminButton(Plugin, Shop);
|
||||||
|
AddButton(3 + 9, new ShopItem(Material.DIAMOND_SWORD, "Give Admin", new String[] {}, 1, false), giveAdminButton);
|
||||||
|
|
||||||
|
OptionsButton optionsButton = new OptionsButton(Plugin, Shop);
|
||||||
|
AddButton(5 + 9, new ShopItem(Material.REDSTONE_COMPARATOR, "Game Options", new String[] {}, 1, false), optionsButton);
|
||||||
|
|
||||||
|
BanButton banButton = new BanButton(Plugin, Shop);
|
||||||
|
AddButton(7 + 9, new ShopItem(Material.LAVA_BUCKET, "Ban Player", new String[] {}, 1, false), banButton);
|
||||||
|
|
||||||
|
UnbanButton unbanButton = new UnbanButton(Plugin, Shop);
|
||||||
|
AddButton(7 + 18, new ShopItem(Material.WATER_BUCKET, "Unban Player", new String[] {}, 1, false), unbanButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ItemStack getOwnerHead()
|
||||||
|
{
|
||||||
|
return getPlayerHead(Plugin.GetHost(), ChatColor.RESET + "Host: " + ChatColor.YELLOW + Plugin.GetHost());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,129 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.game.GameServerConfig;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public class OptionsPage extends BasePage
|
||||||
|
{
|
||||||
|
private GameServerConfig _config;
|
||||||
|
|
||||||
|
public OptionsPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Game Options", player);
|
||||||
|
|
||||||
|
_config = Plugin.GetServerConfig();
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void BuildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
addBackButton(4);
|
||||||
|
|
||||||
|
//TeamForceBalance
|
||||||
|
//GameAutoStart
|
||||||
|
//GameTimeout
|
||||||
|
//PlayerKickIdle
|
||||||
|
|
||||||
|
buildPreference(18, Material.LEVER, "Enforce Whitelist", true/* TODO */, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
toggleWhitelist();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buildPreference(20, Material.BONE, "Force Team Balancing", _config.TeamForceBalance, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
toggleTeamBalance();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buildPreference(22, Material.REDSTONE_TORCH_ON, "Game Auto Start", _config.GameAutoStart, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
toggleAutoStart();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buildPreference(24, Material.COMPASS, "Game Timeout", _config.GameTimeout, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
toggleTimeout();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buildPreference(26, Material.WATCH, "Kick Idle Players", _config.PlayerKickIdle, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
toggleKickIdle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleTeamBalance()
|
||||||
|
{
|
||||||
|
_config.TeamForceBalance = !_config.TeamForceBalance;
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleAutoStart()
|
||||||
|
{
|
||||||
|
_config.GameAutoStart = !_config.GameAutoStart;
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleTimeout()
|
||||||
|
{
|
||||||
|
_config.GameTimeout = !_config.GameTimeout;
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleKickIdle()
|
||||||
|
{
|
||||||
|
_config.PlayerKickIdle = !_config.PlayerKickIdle;
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleWhitelist()
|
||||||
|
{
|
||||||
|
// TODO CHISSPIE
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildPreference(int index, Material material, String name, boolean preference, IButton button)
|
||||||
|
{
|
||||||
|
buildPreference(index, material, (byte) 0, name, preference, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildPreference(int index, Material material, byte data, String name, boolean preference, IButton button)
|
||||||
|
{
|
||||||
|
String[] description = new String[] {
|
||||||
|
"" + (preference ? ChatColor.GREEN + "Enabled" : ChatColor.RED + "Disabled"),
|
||||||
|
ChatColor.RED + " ",
|
||||||
|
ChatColor.RESET + "Click to " + (preference ? "Disable" : "Enable") };
|
||||||
|
|
||||||
|
AddButton(index, new ShopItem(material, data, (preference ? ChatColor.GREEN : ChatColor.RED) + name, description, 1, false, false), button);
|
||||||
|
AddButton(index + 9, new ShopItem(Material.INK_SACK, (preference ? (byte)10 : (byte)8), (preference ? ChatColor.GREEN : ChatColor.RED) + name, description, 1, false, false), button);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public abstract class PlayerPage extends BasePage
|
||||||
|
{
|
||||||
|
public PlayerPage(ArcadeManager plugin, PrivateServerShop shop, String pageName, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, pageName, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void BuildPage()
|
||||||
|
{
|
||||||
|
addBackButton(4);
|
||||||
|
|
||||||
|
Player[] players = UtilServer.getPlayers();
|
||||||
|
|
||||||
|
int slot = 9;
|
||||||
|
for (Player player : players)
|
||||||
|
{
|
||||||
|
if (showPlayer(player))
|
||||||
|
{
|
||||||
|
ItemStack head = getPlayerHead(player.getName(), C.cGreen + C.Bold + player.getName(), new String[]{ ChatColor.RESET + C.cGray + getDisplayString(player) });
|
||||||
|
AddButton(slot, head, new Button(slot, player));
|
||||||
|
|
||||||
|
slot++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract boolean showPlayer(Player player);
|
||||||
|
|
||||||
|
public abstract void clicked(int slot, Player player);
|
||||||
|
|
||||||
|
public abstract String getDisplayString(Player player);
|
||||||
|
|
||||||
|
private class Button implements IButton
|
||||||
|
{
|
||||||
|
private int _slot;
|
||||||
|
private Player _player;
|
||||||
|
|
||||||
|
public Button(int slot, Player player)
|
||||||
|
{
|
||||||
|
_slot = slot;
|
||||||
|
_player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
clicked(_slot, _player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.GameType;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public class SetGamePage extends BasePage
|
||||||
|
{
|
||||||
|
public SetGamePage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Set Game", player);
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void BuildPage()
|
||||||
|
{
|
||||||
|
addBackButton(4);
|
||||||
|
|
||||||
|
int slot = 9;
|
||||||
|
for (GameType type : _manager.getAvailableGames(Player))
|
||||||
|
{
|
||||||
|
addGameButton(slot, type);
|
||||||
|
slot++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addGameButton(int slot, final GameType type)
|
||||||
|
{
|
||||||
|
String infoString = ChatColor.RESET + C.cGray + "Click to make this next Game Type";
|
||||||
|
ShopItem shopItem = new ShopItem(type.GetMaterial(), type.GetMaterialData(), type.GetLobbyName(), new String[]{infoString}, 1, false, false);
|
||||||
|
AddButton(slot, shopItem, new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
Plugin.GetGame().setGame(type, player, true);
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package nautilus.game.arcade.gui.privateServer.page;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
|
public class UnbanPage extends BasePage
|
||||||
|
{
|
||||||
|
public UnbanPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, "Unban Players", player);
|
||||||
|
|
||||||
|
BuildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void BuildPage()
|
||||||
|
{
|
||||||
|
addBackButton(4);
|
||||||
|
|
||||||
|
HashSet<String> blackList = _manager.getBlacklist();
|
||||||
|
Iterator<String> iterator = blackList.iterator();
|
||||||
|
|
||||||
|
int slot = 9;
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
String name = iterator.next();
|
||||||
|
ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Unban"});
|
||||||
|
AddButton(slot, head, getUnbanButton(slot, name));
|
||||||
|
|
||||||
|
slot++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// int arrayModifier = _currentPage * 9 * 4;
|
||||||
|
// for (int i = 0; i < _currentPage; i++)
|
||||||
|
// {
|
||||||
|
// int slot = 9 + i;
|
||||||
|
// ItemStack head = getPlayerHead(blackList.)
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
private IButton getUnbanButton(final int slot, final String playerName)
|
||||||
|
{
|
||||||
|
return new IButton()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_manager.getBlacklist().remove(playerName);
|
||||||
|
RemoveButton(slot);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user