Amplifiers GM Candidate
This commit is contained in:
parent
6e2c751be1
commit
a9f291338f
@ -100,7 +100,7 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.RED.getData(), 1, ChatColor.RED + "No Thanks to Claim!"), "You have no thanks to claim!", 6*9, 20*3, getGui()).openInventory();
|
||||
}
|
||||
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "You have no thanks to claim!"));
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "You have no rewards to claim!"));
|
||||
getPlayer().playSound(getPlayer().getLocation(), Sound.ENDERDRAGON_GROWL, 1, 10);
|
||||
}
|
||||
else
|
||||
@ -146,8 +146,9 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
itemName = C.cRed + C.Bold + "Game Amplifiers";
|
||||
|
||||
lore.add(" ");
|
||||
lore.add(C.Reset + "Activate Amplifiers to earn rewards");
|
||||
lore.add(C.Reset + "Amplifiers can be purchased at mineplex.com/shop");
|
||||
lore.add(C.cGray + "Use Amplifiers to earn rewards");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Get Amplifiers at " + C.cGreen + "mineplex.com/shop");
|
||||
}
|
||||
|
||||
_item = new ShopItem(material, itemName, lore.toArray(new String[0]), 1, false, false);
|
||||
|
@ -37,10 +37,10 @@ public class BoosterPage extends ShopPageBase<BoosterManager, BoosterShop>
|
||||
{
|
||||
ArrayList<String> lore = new ArrayList<>();
|
||||
|
||||
int count = getPlugin().getAvailableBoosterCount(getPlayer());
|
||||
int amplifierCount = getPlugin().getAvailableBoosterCount(getPlayer());
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "You own " + C.cGreen + getPlugin().getAvailableBoosterCount(getPlayer()) + C.cWhite + " Game Amplifiers");
|
||||
if (getPlugin().canActivateBoosters() && count > 0)
|
||||
lore.add(C.cWhite + "You own " + C.cGreen + amplifierCount + C.cWhite + " Game Amplifiers");
|
||||
if (getPlugin().canActivateBoosters() && amplifierCount > 0)
|
||||
{
|
||||
List<Booster> boosters = getPlugin().getBoosters();
|
||||
|
||||
@ -80,16 +80,18 @@ public class BoosterPage extends ShopPageBase<BoosterManager, BoosterShop>
|
||||
else
|
||||
{
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Game Amplifiers allow you to increase");
|
||||
lore.add(C.cGray + "gems and shards earned in that game for 1 hour.");
|
||||
lore.add(C.cGray + "You can also earn bonus rewards from players");
|
||||
lore.add(C.cGray + "thanking you while your booster is active.");
|
||||
lore.add(C.cGray + "Game Amplifiers allow you to");
|
||||
lore.add(C.cGray + "increase the gems and shards");
|
||||
lore.add(C.cGray + "earned in that game for 1 hour.");
|
||||
lore.add(C.cGray + "You will also earn bonus rewards");
|
||||
lore.add(C.cGray + "from players thanking you while");
|
||||
lore.add(C.cGray + "your amplifier is active.");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "You can purchase Amplifiers at " + C.cGreen + "mineplex.com/shop");
|
||||
lore.add(C.cWhite + "Get Amplifiers at " + C.cGreen + "mineplex.com/shop");
|
||||
}
|
||||
|
||||
ShopItem booster = new ShopItem(Material.SUGAR, "Game Amplifier", lore.toArray(new String[0]), 0, false, false);
|
||||
if (getPlugin().canActivateBoosters())
|
||||
if (getPlugin().canActivateBoosters() && amplifierCount > 0)
|
||||
{
|
||||
addButton(13, booster, this::openConfirmation);
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
package mineplex.core.hologram;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -45,6 +41,7 @@ public class Hologram {
|
||||
private boolean _makeDestroyPackets = true;
|
||||
private boolean _makeSpawnPackets = true;
|
||||
private Packet[] _packets1_8;
|
||||
private Packet[] _packets1_9;
|
||||
private HashSet<String> _playersInList = new HashSet<String>();
|
||||
private ArrayList<Player> _playersTracking = new ArrayList<Player>();
|
||||
private boolean _removeEntityDeath;
|
||||
@ -58,13 +55,18 @@ public class Hologram {
|
||||
private long _startTime;
|
||||
|
||||
public Hologram(HologramManager hologramManager, Location location, String... text) {
|
||||
this(hologramManager, location, -1l, text);
|
||||
this(hologramManager, location, false, -1l, text);
|
||||
}
|
||||
|
||||
public Hologram(HologramManager hologramManager, Location location, long maxLifetime, String... text) {
|
||||
public Hologram(HologramManager hologramManager, Location location, boolean hideBoundingBox, String... text) {
|
||||
this(hologramManager, location, hideBoundingBox, -1l, text);
|
||||
}
|
||||
|
||||
public Hologram(HologramManager hologramManager, Location location, boolean hideBoundingBox, long maxLifetime, String... text) {
|
||||
_hologramManager = hologramManager;
|
||||
_location = location.clone();
|
||||
_maxLifetime = maxLifetime;
|
||||
_hideBoundingBox = hideBoundingBox;
|
||||
setText(text);
|
||||
}
|
||||
|
||||
@ -163,13 +165,11 @@ public class Hologram {
|
||||
return _playersTracking;
|
||||
}
|
||||
|
||||
protected Packet[] getSpawnPackets() {
|
||||
protected void checkSpawnPackets() {
|
||||
if (_makeSpawnPackets) {
|
||||
makeSpawnPackets();
|
||||
_makeSpawnPackets = false;
|
||||
}
|
||||
|
||||
return _packets1_8;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -228,7 +228,8 @@ public class Hologram {
|
||||
}
|
||||
|
||||
private void makeSpawnPackets() {
|
||||
_packets1_8 = new Packet[_hologramText.length * 1];
|
||||
_packets1_8 = new Packet[_hologramText.length];
|
||||
_packets1_9 = new Packet[_hologramText.length];
|
||||
|
||||
if (_entityIds.size() < _hologramText.length) {
|
||||
_makeDestroyPackets = true;
|
||||
@ -244,22 +245,39 @@ public class Hologram {
|
||||
}
|
||||
}
|
||||
for (int textRow = 0; textRow < _hologramText.length; textRow++) {
|
||||
Packet[] packets1_8 = makeSpawnPackets1_8(textRow, _entityIds.get(textRow), _hologramText[textRow]);
|
||||
PacketPlayOutSpawnEntityLiving packet1_8 = makeSpawnPacket1_8(textRow, _entityIds.get(textRow), _hologramText[textRow]);
|
||||
PacketPlayOutSpawnEntityLiving packet1_9 = makeSpawnPacket1_9(textRow, _entityIds.get(textRow), _hologramText[textRow]);
|
||||
|
||||
for (int i = 0; i < packets1_8.length; i++) {
|
||||
_packets1_8[textRow + i] = packets1_8[i];
|
||||
}
|
||||
_packets1_8[textRow] = packet1_8;
|
||||
_packets1_9[textRow] = packet1_9;
|
||||
}
|
||||
}
|
||||
|
||||
private Packet[] makeSpawnPackets1_8(int textRow, int entityId, String lineOfText) {
|
||||
/**
|
||||
* Used for sending 1.9 clients holograms with no bounding boxes
|
||||
*/
|
||||
private PacketPlayOutSpawnEntityLiving makeSpawnPacket1_9(int textRow, int entityId, String lineOfText)
|
||||
{
|
||||
PacketPlayOutSpawnEntityLiving packet = makeSpawnPacket1_8(textRow, entityId, lineOfText);
|
||||
|
||||
if (_hideBoundingBox)
|
||||
{
|
||||
DataWatcher watcher = packet.l;
|
||||
packet.d = (int) ((getLocation().getY() + ((double) textRow * 0.285)) * 32);
|
||||
watcher.a(10, (byte) 16, EntityArmorStand.META_ARMOR_OPTION, (byte) 16);
|
||||
}
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
private PacketPlayOutSpawnEntityLiving makeSpawnPacket1_8(int textRow, int entityId, String lineOfText) {
|
||||
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
|
||||
packet.a = entityId;
|
||||
packet.b = 30;
|
||||
packet.c = (int) (getLocation().getX() * 32);
|
||||
packet.d = (int) ((getLocation().getY() + (_hideBoundingBox ? 0 : -2.1) + ((double) textRow * 0.285)) * 32);
|
||||
packet.d = (int) ((getLocation().getY() - 2.1 + ((double) textRow * 0.285)) * 32);
|
||||
packet.e = (int) (getLocation().getZ() * 32);
|
||||
packet.l = watcher;
|
||||
packet.uuid = UUID.randomUUID();
|
||||
@ -269,18 +287,7 @@ public class Hologram {
|
||||
watcher.a(2, lineOfText, EntityArmorStand.META_CUSTOMNAME, lineOfText);
|
||||
watcher.a(3, (byte) 1, EntityArmorStand.META_CUSTOMNAME_VISIBLE, true);
|
||||
|
||||
if (_hideBoundingBox) {
|
||||
watcher.a(10, (byte) 16, EntityArmorStand.META_ARMOR_OPTION, (byte) 16); // TODO
|
||||
// Uncomment
|
||||
// after
|
||||
// we
|
||||
// can
|
||||
// enforce
|
||||
// 1.8.3
|
||||
}
|
||||
// Also correct hologram positioning
|
||||
|
||||
return new Packet[] { packet };
|
||||
return packet;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -352,6 +359,7 @@ public class Hologram {
|
||||
}
|
||||
}
|
||||
itel = canSee.iterator();
|
||||
checkSpawnPackets();
|
||||
while (itel.hasNext()) {
|
||||
Player player = itel.next();
|
||||
|
||||
@ -359,7 +367,7 @@ public class Hologram {
|
||||
_playersTracking.add(player);
|
||||
itel.remove();
|
||||
|
||||
UtilPlayer.sendPacket(player, getSpawnPackets());
|
||||
UtilPlayer.sendPacket(player, UtilPlayer.is1_9(player) ? _packets1_9 : _packets1_8);
|
||||
}
|
||||
}
|
||||
if (!canSee.isEmpty()) {
|
||||
@ -452,6 +460,7 @@ public class Hologram {
|
||||
int[] destroy1_8 = new int[0];
|
||||
|
||||
ArrayList<Packet> packets1_8 = new ArrayList<Packet>();
|
||||
ArrayList<Packet> packets1_9 = new ArrayList<>();
|
||||
|
||||
if (_hologramText.length != newText.length) {
|
||||
_makeDestroyPackets = true;
|
||||
@ -465,7 +474,8 @@ public class Hologram {
|
||||
int entityId = UtilEnt.getNewEntityId();
|
||||
_entityIds.add(entityId);
|
||||
|
||||
packets1_8.addAll(Arrays.asList(makeSpawnPackets1_8(i, entityId, newText[i])));
|
||||
packets1_8.add(makeSpawnPacket1_8(i, entityId, newText[i]));
|
||||
packets1_9.add(makeSpawnPacket1_9(i, entityId, newText[i]));
|
||||
}
|
||||
// If less lines than previously
|
||||
else if (i >= newText.length) {
|
||||
@ -479,29 +489,45 @@ public class Hologram {
|
||||
Integer entityId = _entityIds.get(i);
|
||||
|
||||
PacketPlayOutEntityMetadata metadata1_8 = new PacketPlayOutEntityMetadata();
|
||||
PacketPlayOutEntityMetadata metadata1_9 = new PacketPlayOutEntityMetadata();
|
||||
|
||||
metadata1_8.a = entityId;
|
||||
metadata1_9.a = entityId;
|
||||
|
||||
DataWatcher watcher1_8 = new DataWatcher(null);
|
||||
DataWatcher watcher1_9 = new DataWatcher(null);
|
||||
|
||||
watcher1_8.a(0, (byte) 32, EntityArmorStand.META_ENTITYDATA, (byte) 32);
|
||||
watcher1_8.a(2, newText[i], EntityArmorStand.META_CUSTOMNAME, newText[i]);
|
||||
watcher1_8.a(3, (byte) 1, EntityArmorStand.META_CUSTOMNAME_VISIBLE, true);
|
||||
// watcher1_8.a(10, (byte) 16);// TODO Uncomment after we
|
||||
// can enforce 1.8.3
|
||||
// Also correct hologram positioning
|
||||
{
|
||||
watcher1_8.a(0, (byte) 32, EntityArmorStand.META_ENTITYDATA, (byte) 32);
|
||||
watcher1_8.a(2, newText[i], EntityArmorStand.META_CUSTOMNAME, newText[i]);
|
||||
watcher1_8.a(3, (byte) 1, EntityArmorStand.META_CUSTOMNAME_VISIBLE, true);
|
||||
}
|
||||
{
|
||||
watcher1_9.a(0, (byte) 32, EntityArmorStand.META_ENTITYDATA, (byte) 32);
|
||||
watcher1_9.a(2, newText[i], EntityArmorStand.META_CUSTOMNAME, newText[i]);
|
||||
watcher1_9.a(3, (byte) 1, EntityArmorStand.META_CUSTOMNAME_VISIBLE, true);
|
||||
if (_hideBoundingBox)
|
||||
{
|
||||
watcher1_9.a(10, (byte) 16, EntityArmorStand.META_ARMOR_OPTION, (byte) 16);
|
||||
}
|
||||
}
|
||||
metadata1_8.b = watcher1_8.c();
|
||||
metadata1_9.b = watcher1_9.c();
|
||||
|
||||
packets1_8.add(metadata1_8);
|
||||
packets1_9.add(metadata1_9);
|
||||
}
|
||||
}
|
||||
|
||||
if (destroy1_8.length > 0) {
|
||||
packets1_8.add(new PacketPlayOutEntityDestroy(destroy1_8));
|
||||
packets1_9.add(new PacketPlayOutEntityDestroy(destroy1_8));
|
||||
}
|
||||
|
||||
for (Player player : _playersTracking) {
|
||||
for (Packet packet : packets1_8) {
|
||||
List<Packet> packets = UtilPlayer.is1_9(player) ? packets1_9 : packets1_8;
|
||||
for (Packet packet : packets)
|
||||
{
|
||||
UtilPlayer.sendPacket(player, packet);
|
||||
}
|
||||
}
|
||||
@ -532,15 +558,30 @@ public class Hologram {
|
||||
_hologramManager.addHologram(this);
|
||||
_playersTracking.addAll(getNearbyPlayers());
|
||||
|
||||
for (Player player : _playersTracking) {
|
||||
UtilPlayer.sendPacket(player, getSpawnPackets());
|
||||
}
|
||||
sendPackets();
|
||||
|
||||
_lastMovement = new Vector();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private void sendPackets()
|
||||
{
|
||||
checkSpawnPackets();
|
||||
|
||||
for (Player player : _playersTracking)
|
||||
{
|
||||
UtilPlayer.sendPacket(player, UtilPlayer.is1_9(player) ? _packets1_9 : _packets1_8);
|
||||
}
|
||||
}
|
||||
|
||||
public Packet[] getSpawnPackets(Player player)
|
||||
{
|
||||
checkSpawnPackets();
|
||||
|
||||
return UtilPlayer.is1_9(player) ? _packets1_9 : _packets1_8;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the hologram
|
||||
*/
|
||||
|
@ -116,7 +116,7 @@ public class HologramManager implements Listener, IPacketHandler
|
||||
{
|
||||
hologram.getPlayersTracking().add(player);
|
||||
|
||||
UtilPlayer.sendPacket(player, hologram.getSpawnPackets());
|
||||
UtilPlayer.sendPacket(player, hologram.getSpawnPackets(player));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -530,6 +530,7 @@ public abstract class SiegeWeapon implements Listener
|
||||
new Hologram(
|
||||
_siegeManager.getClansManager().getHologramManager(),
|
||||
_location.clone().add(UtilMath.random(-1, 1),1.4, UtilMath.random(-1, 1)),
|
||||
false,
|
||||
3500l,
|
||||
C.cRed + "-" + health)
|
||||
.start();
|
||||
|
@ -48,7 +48,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Memorize Gwen the Guardian's builds",
|
||||
C.Reset + "Then recreate them in a short amount of time.",
|
||||
C.Reset + "The least correct builder is eliminated.",
|
||||
}, "SB", "SpeedBuilders", new SelectSBButton(this));
|
||||
}, "SB", "Speed Builders", new SelectSBButton(this));
|
||||
|
||||
add(4, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
{
|
||||
@ -57,7 +57,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Players take turns at drawing a random",
|
||||
C.Reset + "word. Whoever guesses it within the time",
|
||||
C.Reset + "limit gets some points!",
|
||||
}, "DMT", "DrawMyThing", new SelectDMTButton(this));
|
||||
}, "DMT", "Draw My Thing", new SelectDMTButton(this));
|
||||
|
||||
add(6, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
{
|
||||
@ -75,7 +75,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Then the bridges drop, and all hell",
|
||||
C.Reset + "breaks loose as you battle to the",
|
||||
C.Reset + "death with the other teams.",
|
||||
}, "BR", "Bridge", new SelectBRButton(this));
|
||||
}, "BR", "Bridges", new SelectBRButton(this));
|
||||
|
||||
add(11, Material.DIAMOND_SWORD, (byte) 0, C.cYellowB + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
|
||||
{
|
||||
@ -83,7 +83,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Search for chests to find loot and ",
|
||||
C.Reset + "fight others to be the last man standing. ",
|
||||
C.Reset + "Stay away from the borders!",
|
||||
}, new String[] {"HG", "SG2"}, "SurvivalGames", new SelectSGButton(this));
|
||||
}, new String[] {"HG", "SG2"}, "Survival Games", new SelectSGButton(this));
|
||||
|
||||
add(13, Material.FEATHER, (byte) 0, C.cYellowB + "Skywars " + C.cGray + "Solo/Team Survival", new String[]
|
||||
{
|
||||
@ -93,7 +93,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Find weapons to take your enemies down!",
|
||||
C.Reset + "Up in the skies, death looming if you fall..",
|
||||
C.Reset + "Win! Fight! Send enemies flying in Skywars!",
|
||||
}, new String[] {"SKY", "SKY2"}, "SkyWars", new SelectSKYButton(this));
|
||||
}, new String[] {"SKY", "SKY2"}, "Skywars", new SelectSKYButton(this));
|
||||
|
||||
add(15, Material.GOLDEN_APPLE, C.cYellowB + "UHC " + C.cGray + "Ultra Hardcore Mode", new String[]
|
||||
{
|
||||
@ -133,7 +133,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Customize one of five exciting champions",
|
||||
C.Reset + "and battle with the opposing team to the",
|
||||
C.Reset + "last man standing.",
|
||||
}, "TDM", "TeamDeathMatch", new SelectTDMButton(this));
|
||||
}, "TDM", "Team Deathmatch", new SelectTDMButton(this));
|
||||
|
||||
add(24, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Siege " + C.cGray + "Team Game", new String[]
|
||||
{
|
||||
@ -141,7 +141,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Defenders must protect King Sparklez",
|
||||
C.Reset + "from the endless waves of Undead",
|
||||
C.Reset + "until the sun rises!",
|
||||
}, "CS", "CastleSiege", new SelectCSButton(this));
|
||||
}, "CS", "Castle Siege", new SelectCSButton(this));
|
||||
|
||||
add(26, Material.GRASS, C.cYellowB + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
|
||||
{
|
||||
@ -149,7 +149,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Hide as blocks/animals, upgrade your ",
|
||||
C.Reset + "weapon and fight to survive against",
|
||||
C.Reset + "the Hunters!",
|
||||
}, "BH", "BlockHunt", new SelectBHButton(this));
|
||||
}, "BH", "Block Hunt", new SelectBHButton(this));
|
||||
|
||||
add(28, Material.TNT, C.cYellowB + "MineStrike " + C.cGray + "Team Survival", new String[]
|
||||
{
|
||||
@ -171,7 +171,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Players are given a Build Theme and ",
|
||||
C.Reset + "must use blocks, monsters and more",
|
||||
C.Reset + "to create a masterpiece!",
|
||||
}, "BLD", "MasterBuilders", new SelectBLDButton(this));
|
||||
}, "BLD", "Master Builders", new SelectBLDButton(this));
|
||||
|
||||
add(39, Material.SKULL_ITEM, (byte) 3, C.cYellowB + "Player Servers " + C.cGray + "Player Hosted Games", new String[]
|
||||
{
|
||||
@ -188,7 +188,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Equip custom skills and builds",
|
||||
C.Reset + "and join your clan to destroy",
|
||||
C.Reset + "and raid others!",
|
||||
}, "Clans", "Clans", new SelectCLANSButton(this));
|
||||
}, "Clans", null, new SelectCLANSButton(this));
|
||||
|
||||
add(41, Material.BREWING_STAND_ITEM, C.cYellowB + "Monster Maze " + C.cGray + "Snow Sprint", new String[]
|
||||
{
|
||||
@ -197,17 +197,17 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Run along a maze avoiding",
|
||||
C.Reset + "evil monsters. Get to the",
|
||||
C.Reset + "Safe-Pad or be killed!",
|
||||
}, "BETA", "Beta", new SelectBETAButton(this));
|
||||
}, "BETA", null, new SelectBETAButton(this));
|
||||
}
|
||||
|
||||
private void add(int slot, Material material, String title, String[] lore, String serverTag, String serverGroup, IButton button)
|
||||
private void add(int slot, Material material, String title, String[] lore, String serverTag, String boosterGroup, IButton button)
|
||||
{
|
||||
add(slot, material, (byte) 0, title, lore, serverTag == null ? null : new String[]{serverTag}, serverGroup, button);
|
||||
add(slot, material, (byte) 0, title, lore, serverTag == null ? null : new String[]{serverTag}, boosterGroup, button);
|
||||
}
|
||||
|
||||
private void add(int slot, Material material, byte data, String title, String[] lore, String[] serverTags, String serverGroup, IButton button)
|
||||
private void add(int slot, Material material, byte data, String title, String[] lore, String[] serverTags, String boosterGroup, IButton button)
|
||||
{
|
||||
add(slot, new ItemBuilder(material, 1, data), title, lore, serverTags, serverGroup, button);
|
||||
add(slot, new ItemBuilder(material, 1, data), title, lore, serverTags, boosterGroup, button);
|
||||
}
|
||||
|
||||
private void add(int slot, ItemBuilder builder, String title, String[] lore, String[] serverTags, String boosterGroup, IButton button)
|
||||
@ -219,7 +219,8 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
if (booster != null)
|
||||
{
|
||||
// append to start of lore
|
||||
builder.getLore().add(0, C.cGreen + "Boosted by " + C.cWhite + booster.getPlayerName() + C.cGreen + " - " + C.cWhite + booster.getTimeRemainingString());
|
||||
builder.getLore().add(0, C.cWhite + "Amplified by " + C.cGreen + booster.getPlayerName() + C.cWhite + " - " + C.cGreen + booster.getTimeRemainingString());
|
||||
builder.getLore().add(1, C.cWhite + "All players earn " + C.cYellow + "2x Exp" + C.cWhite + " and " + C.cAqua + "2x Shards");
|
||||
builder.setGlow(true);
|
||||
}
|
||||
}
|
||||
|
@ -127,6 +127,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
||||
int winterChestsReceived = 0;
|
||||
int illuminatedChestsReceived = 0;
|
||||
int valentinesGiftsReceived = 0;
|
||||
int boostersReceived = 0;
|
||||
|
||||
for (CoinTransactionToken transaction : donor.getCoinTransactions())
|
||||
{
|
||||
@ -205,6 +206,17 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
||||
}
|
||||
|
||||
}
|
||||
if (transaction.SalesPackageName.startsWith("Game Booster"))
|
||||
{
|
||||
if (transaction.Coins == 0 && transaction.Gems == 0)
|
||||
{
|
||||
if (transaction.SalesPackageName.split(" ").length == 3)
|
||||
boostersReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
|
||||
else if (transaction.SalesPackageName.split(" ").length == 2)
|
||||
boostersReceived += 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Strutt20 asked me to remove some stuff from the menu
|
||||
@ -213,6 +225,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
||||
caller.sendMessage(C.cBlue + "Ancient Chests Received: " + C.cYellow + ancientChestsReceived);
|
||||
caller.sendMessage(C.cBlue + "Mythical Chests Received: " + C.cYellow + mythicalChestsReceived);
|
||||
caller.sendMessage(C.cBlue + "Illuminated Chests Received: " + C.cYellow + illuminatedChestsReceived);
|
||||
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
|
||||
caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):");
|
||||
|
||||
if (_accountBonusLog.containsKey(client.getAccountId()))
|
||||
|
@ -1,6 +1,5 @@
|
||||
package nautilus.game.arcade.booster;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.boosters.Booster;
|
||||
import mineplex.core.boosters.event.BoosterActivateEvent;
|
||||
@ -16,7 +15,6 @@ import mineplex.core.npc.NpcManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.database.tables.records.NpcsRecord;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -27,7 +25,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashSet;
|
||||
@ -91,34 +88,30 @@ public class BoosterPodium extends MiniPlugin
|
||||
|
||||
if (_activeArmorStand != null)
|
||||
{
|
||||
if (_activeArmorStand.isValid())
|
||||
_activeArmorStand.teleport(new Location(_activeArmorStand.getLocation().getWorld(), 0, 0, 0));
|
||||
|
||||
_activeArmorStand.remove();
|
||||
}
|
||||
|
||||
if (_hologram == null)
|
||||
{
|
||||
_hologram = new Hologram(_hologramManager, _npcLocation.clone().add(0, 2.5, 0), true, getHologramText(activeBooster));
|
||||
_hologram.start();
|
||||
}
|
||||
|
||||
ArmorStand armorStand = _podiumLocation.getWorld().spawn(_npcLocation, ArmorStand.class);
|
||||
armorStand.setVisible(true);
|
||||
armorStand.setCustomNameVisible(false);
|
||||
armorStand.setCustomName("" + activeBooster.getId());
|
||||
armorStand.setCustomName("");
|
||||
armorStand.setGravity(true);
|
||||
armorStand.setArms(true);
|
||||
armorStand.setBasePlate(true);
|
||||
armorStand.setRemoveWhenFarAway(false);
|
||||
|
||||
|
||||
armorStand.setHelmet(UtilSkull.getPlayerHead(activeBooster.getPlayerName(), activeBooster.getPlayerName(), null));
|
||||
armorStand.setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(Color.LIME).build());
|
||||
armorStand.setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setColor(Color.LIME).build());
|
||||
armorStand.setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setColor(Color.LIME).build());
|
||||
// armorStand.setItemInHand();
|
||||
|
||||
if (_hologram == null)
|
||||
{
|
||||
_hologram = new Hologram(_hologramManager, _npcLocation.clone().add(0, 2, 0), getHologramText(activeBooster));
|
||||
_hologram.start();
|
||||
}
|
||||
|
||||
/*
|
||||
runAsync(() -> {
|
||||
GameProfile profile = null;
|
||||
@ -219,7 +212,6 @@ public class BoosterPodium extends MiniPlugin
|
||||
@EventHandler
|
||||
public void one(PlayerInteractAtEntityEvent event)
|
||||
{
|
||||
Bukkit.broadcastMessage("Interact Event. Target=" + event.getRightClicked() + ", Equals=" + event.getRightClicked().equals(_activeArmorStand));
|
||||
if (event.getRightClicked().equals(_activeArmorStand))
|
||||
{
|
||||
_gameBoosterManager.attemptTip(event.getPlayer());
|
||||
|
Loading…
Reference in New Issue
Block a user