Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/gem-hunters
This commit is contained in:
commit
7200572583
@ -32,11 +32,11 @@ public enum Rank
|
||||
TWITCH("Twitch", "tw", ChatColor.DARK_PURPLE, "A Twitch streamer who often features \nMineplex in their streams."),
|
||||
|
||||
//Player
|
||||
ETERNAL("Eternal", "et", ChatColor.DARK_AQUA, true, "???"),
|
||||
TITAN("Titan", "t", ChatColor.RED, true, "Ancient myths spoke of a gigantic being \nwith immense power... \n\nPurchase Titan at www.mineplex.com/shop"),
|
||||
LEGEND("Legend", "l", ChatColor.GREEN, true, "Mineplex's third premium rank. \n\nPurchase Legend at www.mineplex.com/shop"),
|
||||
HERO("Hero", "h", ChatColor.LIGHT_PURPLE, true, "There are many stories of a \nvaliant Hero who was brave enough to \ntame the most fearsome dragon in the land. \n\nPurchase Hero at www.mineplex.com/shop"),
|
||||
ULTRA("Ultra", "u", ChatColor.AQUA, true, "Mineplex's first premium rank. \n\nPurchase Ultra at www.mineplex.com/shop"),
|
||||
ETERNAL("Eternal", "et", ChatColor.DARK_AQUA, true, "Fantastic and magical, no one \nexcept the time lords truly understand \nthe power of this rank.\n\nThe fifth purchasable rank at Mineplex.com/shop"),
|
||||
TITAN("Titan", "t", ChatColor.RED, true, "Ancient myths spoke of a gigantic being \nwith immense power... \n\nThe fourth purchasable rank at Mineplex.com/shop"),
|
||||
LEGEND("Legend", "l", ChatColor.GREEN, true, "Years they have told stories of this rank, \nonly for the legends to be true. \n\nThe third purchasable rank at Mineplex.com/shop"),
|
||||
HERO("Hero", "h", ChatColor.LIGHT_PURPLE, true, "There are many stories of a \nvaliant Hero who was brave enough to \ntame the most fearsome dragon in the land. \n\nThe second purchasable rank at Mineplex.com/shop"),
|
||||
ULTRA("Ultra", "u", ChatColor.AQUA, true, "A first step into the stories of the mist. \nOnly those brave enough may enter. \n\nThe first purchasable rank at Mineplex.com/shop"),
|
||||
ALL("", "", ChatColor.WHITE, null);
|
||||
|
||||
private ChatColor _color;
|
||||
|
@ -6,6 +6,7 @@ import java.util.PriorityQueue;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
@ -130,6 +131,65 @@ public abstract class Animator
|
||||
}.runTaskTimer(_plugin, 0, 1);
|
||||
}
|
||||
|
||||
public void start(Entity entity)
|
||||
{
|
||||
if(isRunning()) return;
|
||||
|
||||
_queue.clear();
|
||||
_queue.addAll(_points);
|
||||
|
||||
if(_queue.isEmpty()) return;
|
||||
|
||||
_baseLoc = entity.getLocation().clone();
|
||||
_next = _queue.peek();
|
||||
_prev = new AnimationPoint(0, _next.getMove().clone(), _next.getDirection().clone());
|
||||
|
||||
_task = new BukkitRunnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
_tick++;
|
||||
|
||||
if(_next.getTick() < _tick)
|
||||
{
|
||||
_queue.remove();
|
||||
_prev = _next;
|
||||
_next = _queue.peek();
|
||||
}
|
||||
|
||||
if(_queue.isEmpty())
|
||||
{
|
||||
if(_repeat)
|
||||
{
|
||||
Location clone = _baseLoc.clone();
|
||||
stop();
|
||||
start(clone);
|
||||
}
|
||||
else
|
||||
{
|
||||
finish(_baseLoc);
|
||||
stop();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Location prev = _baseLoc.clone().add(_prev.getMove());
|
||||
Location next = _baseLoc.clone().add(_next.getMove());
|
||||
prev.setDirection(_prev.getDirection());
|
||||
|
||||
double diff = ((double)_tick-_prev.getTick())/(_next.getTick()-_prev.getTick());
|
||||
if(!Double.isFinite(diff)) diff = 0;
|
||||
prev.add(next.clone().subtract(prev).toVector().multiply(diff));
|
||||
|
||||
Vector dirDiff = _next.getDirection().subtract(prev.getDirection());
|
||||
dirDiff.multiply(diff);
|
||||
prev.setDirection(prev.getDirection().add(dirDiff));
|
||||
|
||||
tick(prev);
|
||||
}
|
||||
}.runTaskTimer(_plugin, 0, 1);
|
||||
}
|
||||
|
||||
public boolean isRunning()
|
||||
{
|
||||
return _task != null;
|
||||
|
@ -7,8 +7,6 @@ import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
import java.util.TimeZone;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -21,7 +21,6 @@ import mineplex.core.bonuses.BonusManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gui.GuiItem;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.powerplayclub.PowerPlayClubRepository;
|
||||
@ -36,16 +35,12 @@ public class PowerPlayClubButton implements GuiItem
|
||||
private Player _player;
|
||||
private PowerPlayClubRepository _powerPlayClubRepository;
|
||||
private InventoryManager _inventoryManager;
|
||||
private DonationManager _donationManager;
|
||||
private BonusManager _bonusManager;
|
||||
|
||||
public PowerPlayClubButton(Player player, BonusManager manager)
|
||||
{
|
||||
_player = player;
|
||||
_bonusManager = manager;
|
||||
_powerPlayClubRepository = manager.getPowerPlayClubRepository();
|
||||
_inventoryManager = manager.getInventoryManager();
|
||||
_donationManager = manager.getDonationManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -132,7 +127,7 @@ public class PowerPlayClubButton implements GuiItem
|
||||
itemName = C.cRedB + "Power Play Club";
|
||||
|
||||
lore.add(C.cYellow + YearMonth.now().getMonth().getDisplayName(TextStyle.FULL, Locale.US) + "'s Cosmetic");
|
||||
lore.add(C.cWhite + " " + PowerPlayClubRewards.rewards().get(YearMonth.now()).getPrize());
|
||||
lore.add(C.cWhite + " " + PowerPlayClubRewards.rewards().get(YearMonth.now()).getPrizeName());
|
||||
lore.add(" ");
|
||||
lore.addAll(buildOtherRewardsLore(1));
|
||||
lore.add(C.cRed + "Get Power Play Club months at");
|
||||
@ -152,7 +147,7 @@ public class PowerPlayClubButton implements GuiItem
|
||||
.forEach(entry ->
|
||||
{
|
||||
YearMonth yearMonth = entry.getKey();
|
||||
lore.add(C.cWhite + " " + entry.getValue().getPrize() + " " + C.cGold + yearMonth.getMonth().getDisplayName(TextStyle.SHORT, Locale.US) + " " + yearMonth.getYear());
|
||||
lore.add(C.cWhite + " " + entry.getValue().getPrizeName() + " " + C.cGold + yearMonth.getMonth().getDisplayName(TextStyle.SHORT, Locale.US) + " " + yearMonth.getYear());
|
||||
});
|
||||
lore.add(" ");
|
||||
return lore;
|
||||
|
@ -1,10 +1,14 @@
|
||||
package mineplex.core.cosmetic.ui.page;
|
||||
|
||||
import java.time.Month;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.TextStyle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.Blocks;
|
||||
import net.minecraft.server.v1_8_R3.ChatMessage;
|
||||
@ -110,12 +114,18 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
else if (pet.getPrice() == -14)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Power Play Club");
|
||||
}
|
||||
else if (pet.getPrice() == -14)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Power Play Club");
|
||||
YearMonth yearMonth = pet.getYearMonth();
|
||||
if (yearMonth != null)
|
||||
{
|
||||
int year = yearMonth.getYear();
|
||||
Month month = yearMonth.getMonth();
|
||||
String monthName = month.getDisplayName(TextStyle.FULL, Locale.US);
|
||||
itemLore.addAll(UtilText.splitLine(C.cBlue + "Monthly Power Play Club Reward for " + monthName + " " + year, LineFormat.LORE));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemLore.add(C.cBlue + "Bonus Item Unlocked with Power Play Club");
|
||||
}
|
||||
}
|
||||
|
||||
//Rank Unlocks
|
||||
@ -154,8 +164,8 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Disable");
|
||||
|
||||
addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.getEntityType().getTypeId(),
|
||||
|
||||
addButton(slot, new ShopItem(pet.getMaterial(), pet.getData(),
|
||||
pet.getName() + " (" + C.cWhite + petName + C.cGreen + ")",
|
||||
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivatePetButton(this, getPlugin().getPetManager()));
|
||||
|
||||
@ -185,7 +195,7 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
}
|
||||
}*/
|
||||
|
||||
addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.getEntityType().getTypeId(),
|
||||
addButton(slot, new ShopItem(pet.getMaterial(), pet.getData(),
|
||||
pet.getName() + " (" + C.cWhite + petName + C.cGreen + ")",
|
||||
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivatePetButton(pet, this));
|
||||
//addButton(slot, new ShopItem(petItem, false, false), iButton);
|
||||
|
@ -11,7 +11,7 @@ public class DisguiseCommand extends CommandBase<PlayerDisguiseManager> implemen
|
||||
{
|
||||
DisguiseCommand(PlayerDisguiseManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new Rank[]{Rank.YOUTUBE, Rank.TWITCH}, "disguise");
|
||||
super(plugin, Rank.ADMIN, new Rank[]{Rank.YOUTUBE_SMALL, Rank.YOUTUBE, Rank.TWITCH}, "disguise");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,6 +35,7 @@ public class DeathPresentDanger extends DeathEffectGadget
|
||||
UtilText.splitLineToArray(C.cGray + "Leave behind a little gift for your enemies.", LineFormat.LORE),
|
||||
-16,
|
||||
Material.INK_SACK, (byte)1);
|
||||
setDisplayItem(SkinData.PRESENT.getSkull());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,7 +19,7 @@ public enum MineStrikeSkin
|
||||
P2000_Fire_Elemental( "P2000", "P2000 Fire Elemental", Material.INK_SACK, (byte) 6),
|
||||
FAMAS_Pulse( "FAMAS", "FAMAS Pulse", Material.CLAY_BALL, (byte) 0),
|
||||
M4A4_Howl( "M4A4", "M4A4 Howl", Material.INK_SACK, (byte) 11),
|
||||
//M4A4_Enderman( "M4A4", "Enderman M4", )
|
||||
M4A4_Enderman( "M4A4", "Enderman M4", Material.COAL, (byte) 0),
|
||||
Steyr_AUG_Torque( "Steyr AUG", "Steyr AUG Torque", Material.BLAZE_ROD, (byte) 0),
|
||||
Glock_18_Fade( "Glock 18", "Glock 18 Fade", Material.INK_SACK, (byte) 9),
|
||||
Galil_AR_Eco( "Galil AR", "Galil AR Eco", Material.INK_SACK, (byte) 10),
|
||||
|
@ -2,8 +2,6 @@ package mineplex.core.gadget.gadgets.hat;
|
||||
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.HatGadget;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class HatItem extends HatGadget
|
||||
{
|
||||
@ -13,14 +11,4 @@ public class HatItem extends HatGadget
|
||||
super(manager, hatType);
|
||||
}
|
||||
|
||||
public HatItem(GadgetManager manager, String name, String[] desc, int cost, Material material, byte data)
|
||||
{
|
||||
super(manager, name, desc, cost, new ItemStack(material, 1, data));
|
||||
}
|
||||
|
||||
public HatItem(GadgetManager manager, String name, String[] desc, int cost, String playerName)
|
||||
{
|
||||
super(manager, name, desc, cost, playerName);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,22 +1,20 @@
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public class ParticleFireRings extends ParticleGadget
|
||||
{
|
||||
@ -25,7 +23,7 @@ public class ParticleFireRings extends ParticleGadget
|
||||
{
|
||||
super(manager, "Flame Rings",
|
||||
UtilText.splitLineToArray(C.cGray + "Forged from the blazing rods of 1000 Blazes by the infamous Nether King.", LineFormat.LORE),
|
||||
-2, Material.BLAZE_POWDER, (byte) 0);
|
||||
-2, Material.BLAZE_ROD, (byte) 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -96,6 +96,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
private InventoryManager _inventoryManager;
|
||||
|
||||
private Map<Creature, FlyingPetManager> _flyingPets = new HashMap<>();
|
||||
private Map<Creature, TrueLoveData> _trueLovePets = new HashMap<>();
|
||||
|
||||
private ShapeWings _wings = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.2,0.2,0.2), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN);
|
||||
private ShapeWings _wingsEdge = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.1,0.1,0.1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN);
|
||||
@ -347,6 +348,25 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
zombie.setCustomNameVisible(true);
|
||||
}
|
||||
}
|
||||
else if (petType.equals(PetType.TRUE_LOVE_PET))
|
||||
{
|
||||
Zombie zombie = (Zombie) pet;
|
||||
zombie.setBaby(true);
|
||||
|
||||
UtilEnt.silence(zombie, true);
|
||||
|
||||
if (Get(player).getPets().get(entityType) != null && Get(player).getPets().get(entityType).length() > 0)
|
||||
{
|
||||
zombie.setCustomName(Get(player).getPets().get(entityType));
|
||||
zombie.setCustomNameVisible(true);
|
||||
}
|
||||
|
||||
// Spawns villager
|
||||
Villager villager = _creatureModule.SpawnEntity(zombie.getLocation(), Villager.class);
|
||||
villager.setBaby();
|
||||
UtilEnt.silence(villager, true);
|
||||
_trueLovePets.put(zombie, new TrueLoveData(player, zombie, villager));
|
||||
}
|
||||
|
||||
_activePetOwnerTypes.put(player.getName(), petType);
|
||||
_activePetOwners.put(player.getName(), pet);
|
||||
@ -381,6 +401,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
_flyingPets.remove(pet);
|
||||
}
|
||||
|
||||
if (_trueLovePets.containsKey(pet))
|
||||
{
|
||||
_trueLovePets.get(pet).remove();
|
||||
_trueLovePets.remove(pet);
|
||||
}
|
||||
|
||||
pet.remove();
|
||||
|
||||
if (removeOwner)
|
||||
@ -465,7 +491,6 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
|
||||
if (event.getType() == UpdateType.FAST) _wings.display(loc);
|
||||
if (event.getType() == UpdateType.FAST) _wingsEdge.display(loc);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -566,6 +591,23 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void trueLovePetWalk(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FASTEST)
|
||||
return;
|
||||
|
||||
Iterator<Entry<Creature, TrueLoveData>> iterator = _trueLovePets.entrySet().iterator();
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Entry<Creature, TrueLoveData> entry = iterator.next();
|
||||
Creature zombie = entry.getKey();
|
||||
UtilParticle.PlayParticle(ParticleType.HEART, zombie.getLocation().add(0, 0.25, 0), 0.25f, 0.25f, 0.25f, 0, 1, ViewDist.NORMAL);
|
||||
TrueLoveData trueLoveData = entry.getValue();
|
||||
trueLoveData.update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Blocks zombie pets catching fire
|
||||
* @param event
|
||||
@ -581,7 +623,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected PetClient addPlayer(UUID uuid)
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.pet;
|
||||
|
||||
import java.time.Month;
|
||||
import java.time.YearMonth;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.bukkit.Material;
|
||||
@ -27,6 +29,7 @@ public enum PetType
|
||||
RABBIT("Baby Zombie", EntityType.RABBIT, -9, "They're so cute - until a pack of them chases down your family and eats them."),
|
||||
BLAZE("Grim Reaper", EntityType.BLAZE, -8, "Aww isn't he so cute with his little wings and little scythe?"),
|
||||
GINGERBREAD_MAN("Gingerbread Man", EntityType.ZOMBIE, -16, "Looks like you can catch him after all."),
|
||||
TRUE_LOVE_PET("True Love", EntityType.ZOMBIE, -14, "Sometimes love means chasing the person of your dreams until you catch them.", Material.APPLE, YearMonth.of(2017, Month.FEBRUARY))
|
||||
// TODO CHECK IF LOBBY IS 1.9+
|
||||
// Not in this update
|
||||
//SHULKER("Shulker Pet", EntityType.BAT, 0, "Is it a turtle or an alien? Either way its shot can be really UPLIFTING.")
|
||||
@ -37,6 +40,7 @@ public enum PetType
|
||||
private final Optional<String> _lore;
|
||||
private final Material _material;
|
||||
private final byte _data;
|
||||
private YearMonth _yearMonth;
|
||||
|
||||
PetType(String name, EntityType entityType, int price)
|
||||
{
|
||||
@ -68,6 +72,17 @@ public enum PetType
|
||||
_data = data;
|
||||
}
|
||||
|
||||
PetType(String name, EntityType entityType, int price, String lore, Material material, YearMonth yearMonth)
|
||||
{
|
||||
this(name, entityType, price, lore, material, (byte) 0, yearMonth);
|
||||
}
|
||||
|
||||
PetType(String name, EntityType entityType, int price, String lore, Material material, byte data, YearMonth yearMonth)
|
||||
{
|
||||
this(name, entityType, price, lore, material, data);
|
||||
_yearMonth = yearMonth;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return _name;
|
||||
@ -98,6 +113,11 @@ public enum PetType
|
||||
return _data;
|
||||
}
|
||||
|
||||
public YearMonth getYearMonth()
|
||||
{
|
||||
return _yearMonth;
|
||||
}
|
||||
|
||||
public PetSalesPackage toSalesPackage(String tagName)
|
||||
{
|
||||
return new PetSalesPackage(this, tagName);
|
||||
|
@ -0,0 +1,66 @@
|
||||
package mineplex.core.pet;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class TrueLoveData
|
||||
{
|
||||
|
||||
private Player _player;
|
||||
private Zombie _zombie;
|
||||
private Villager _villager;
|
||||
private int _step = 0;
|
||||
|
||||
private static final int POINTS = 12;
|
||||
private static final float RADIUS = 1.75F;
|
||||
|
||||
public TrueLoveData(Player player, Zombie zombie, Villager villager)
|
||||
{
|
||||
_player = player;
|
||||
_zombie = zombie;
|
||||
_villager = villager;
|
||||
}
|
||||
|
||||
public void update()
|
||||
{
|
||||
double increment = (2 * Math.PI) / POINTS;
|
||||
|
||||
// Villager
|
||||
double angle = _step * increment;
|
||||
Vector vector = new Vector(Math.cos(angle) * RADIUS, 0, Math.sin(angle) * RADIUS);
|
||||
_villager.setVelocity(new Vector(0,0,0));
|
||||
_villager.teleport(_player.getLocation().clone().add(vector));
|
||||
// Make villager look at right location
|
||||
angle = (_step + 1) * increment;
|
||||
vector = new Vector(Math.cos(angle) * RADIUS, 0, Math.sin(angle) * RADIUS);
|
||||
Location targetLoc = _player.getLocation().clone().add(vector);
|
||||
Vector directionBetweenLocs = targetLoc.toVector().subtract(_villager.getEyeLocation().toVector());
|
||||
Location villagerLoc = _villager.getLocation().setDirection(directionBetweenLocs);
|
||||
_villager.teleport(villagerLoc);
|
||||
|
||||
// Zombie
|
||||
angle = (_step - 3) * increment;
|
||||
vector = new Vector(Math.cos(angle) * RADIUS, 0, Math.sin(angle) * RADIUS);
|
||||
_zombie.setVelocity(new Vector(0, 0, 0));
|
||||
_zombie.teleport(_player.getLocation().clone().add(vector));
|
||||
// Make zombie look at right location
|
||||
angle = (_step - 2) * increment;
|
||||
vector = new Vector(Math.cos(angle) * RADIUS, 0, Math.sin(angle) * RADIUS);
|
||||
targetLoc = _player.getLocation().clone().add(vector);
|
||||
directionBetweenLocs = targetLoc.toVector().subtract(_zombie.getEyeLocation().toVector());
|
||||
Location zombieLoc = _zombie.getLocation().setDirection(directionBetweenLocs);
|
||||
_zombie.teleport(zombieLoc);
|
||||
|
||||
_step++;
|
||||
}
|
||||
|
||||
public void remove()
|
||||
{
|
||||
_villager.remove();
|
||||
_zombie.remove();
|
||||
}
|
||||
|
||||
}
|
@ -9,10 +9,8 @@ import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
@ -104,9 +102,10 @@ public class PowerPlayClubRepository implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
PowerPlayData cached = getCachedData(player);
|
||||
PowerPlayClubRewards.rewardsForMonths(cached.getUsableCosmeticMonths()).stream()
|
||||
.map(PowerPlayClubRewards.PowerPlayClubItem::getPrize)
|
||||
.forEach(_donationManager.Get(player)::addOwnedUnknownSalesPackage);
|
||||
|
||||
List<PowerPlayClubRewards.PowerPlayClubItem> list = PowerPlayClubRewards.rewardsForMonths(cached.getUsableCosmeticMonths());
|
||||
|
||||
PowerPlayClubRewards.rewardsForMonths(cached.getUsableCosmeticMonths()).forEach(item -> item.reward(player));
|
||||
|
||||
// Gives Metal Man for anyone subscribed
|
||||
if (cached.getUsableCosmeticMonths().size() > 0)
|
||||
|
@ -8,18 +8,20 @@ import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import mineplex.core.common.skin.SkinData;
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.common.util.BukkitFuture;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.inventory.data.Item;
|
||||
import mineplex.core.pet.PetClient;
|
||||
import mineplex.core.pet.PetManager;
|
||||
import mineplex.core.pet.PetType;
|
||||
|
||||
public class PowerPlayClubRewards
|
||||
{
|
||||
@ -27,32 +29,72 @@ public class PowerPlayClubRewards
|
||||
public static final int CHESTS_PER_MONTH = 1;
|
||||
|
||||
private static final Map<YearMonth, PowerPlayClubItem> rewards = ImmutableMap.<YearMonth, PowerPlayClubItem>builder()
|
||||
.put(YearMonth.of(2016, Month.SEPTEMBER), new PowerPlayClubItem("Squid Morph", new ItemStack(Material.INK_SACK)))
|
||||
.put(YearMonth.of(2016, Month.OCTOBER), new PowerPlayClubItem("Witch Morph", SkinData.WITCH.getSkull()))
|
||||
.put(YearMonth.of(2016, Month.NOVEMBER), new PowerPlayClubItem("Turkey Morph", SkinData.TURKEY.getSkull()))
|
||||
.put(YearMonth.of(2016, Month.DECEMBER), new PowerPlayClubItem("Santa Morph", SkinData.SANTA.getSkull()))
|
||||
.put(YearMonth.of(2017, Month.JANUARY), new PowerPlayClubItem("Over Easy Morph", new ItemStack(Material.EGG)))
|
||||
.put(YearMonth.of(2016, Month.SEPTEMBER), new UnknownSalesPackageItem("Squid Morph"))
|
||||
.put(YearMonth.of(2016, Month.OCTOBER), new UnknownSalesPackageItem("Witch Morph"))
|
||||
.put(YearMonth.of(2016, Month.NOVEMBER), new UnknownSalesPackageItem("Turkey Morph"))
|
||||
.put(YearMonth.of(2016, Month.DECEMBER), new UnknownSalesPackageItem("Santa Morph"))
|
||||
.put(YearMonth.of(2017, Month.JANUARY), new UnknownSalesPackageItem("Over Easy Morph"))
|
||||
.put(YearMonth.of(2017, Month.FEBRUARY), new PetItem(PetType.TRUE_LOVE_PET))
|
||||
.build();
|
||||
|
||||
public static class PowerPlayClubItem
|
||||
public interface PowerPlayClubItem
|
||||
{
|
||||
private final String _prize;
|
||||
private final ItemStack _display;
|
||||
// The name of the Power Play Club prize to be shown as lore in Carl's GUI
|
||||
String getPrizeName();
|
||||
// Give the player this reward
|
||||
void reward(Player player);
|
||||
}
|
||||
|
||||
PowerPlayClubItem(String prize, ItemStack display)
|
||||
private static class UnknownSalesPackageItem implements PowerPlayClubItem
|
||||
{
|
||||
private static final DonationManager _donationManager = Managers.require(DonationManager.class);
|
||||
private final String _name;
|
||||
|
||||
UnknownSalesPackageItem(String name)
|
||||
{
|
||||
_prize = prize;
|
||||
_display = display;
|
||||
_name = name;
|
||||
}
|
||||
|
||||
public String getPrize()
|
||||
@Override
|
||||
public String getPrizeName()
|
||||
{
|
||||
return _prize;
|
||||
return _name;
|
||||
}
|
||||
|
||||
public ItemStack getDisplay()
|
||||
@Override
|
||||
public void reward(Player player)
|
||||
{
|
||||
return _display;
|
||||
_donationManager.Get(player).addOwnedUnknownSalesPackage(_name);
|
||||
}
|
||||
}
|
||||
|
||||
private static class PetItem implements PowerPlayClubItem
|
||||
{
|
||||
private final PetType _type;
|
||||
|
||||
PetItem(PetType type)
|
||||
{
|
||||
_type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrizeName()
|
||||
{
|
||||
return _type.getName() + " Pet";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reward(Player player)
|
||||
{
|
||||
PetManager petManager = Managers.get(PetManager.class);
|
||||
if (petManager != null)
|
||||
{
|
||||
PetClient client = petManager.Get(player);
|
||||
if (!client.getPets().containsKey(_type))
|
||||
{
|
||||
client.getPets().put(_type, _type.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -614,6 +614,7 @@ public class RewardManager
|
||||
addMineStrikeSkin(Type.MINESTRIKE, MineStrikeSkin.AWP_Asiimov, rarity, 100, 5000);
|
||||
addMineStrikeSkin(Type.MINESTRIKE, MineStrikeSkin.FAMAS_Pulse, rarity, 100, 5000);
|
||||
addMineStrikeSkin(Type.MINESTRIKE, MineStrikeSkin.XM1014_Pig_Gun, rarity, 10, 7500);
|
||||
addMineStrikeSkin(Type.MINESTRIKE, MineStrikeSkin.M4A4_Enderman, rarity, 10, 7500);
|
||||
|
||||
//WINTER
|
||||
|
||||
|
@ -65,6 +65,11 @@ public class BuyChestButton implements IButton
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (_chestType == TreasureType.GINGERBREAD)
|
||||
{
|
||||
player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!"));
|
||||
return;
|
||||
}
|
||||
if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED)
|
||||
{
|
||||
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
||||
|
@ -1,6 +1,5 @@
|
||||
package mineplex.core.treasure.gui;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -137,6 +136,13 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName());
|
||||
int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName());
|
||||
|
||||
boolean availableChristmas = false;
|
||||
boolean availableFreedom = false;
|
||||
boolean availableHaunted = false;
|
||||
boolean availableTrick = false;
|
||||
boolean availableThank = false;
|
||||
boolean availableGingerbread = false;
|
||||
|
||||
List<String> shardLore = new ArrayList<>();
|
||||
shardLore.add(" ");
|
||||
shardLore.add(C.cGray + "This seems like it might come in");
|
||||
@ -296,8 +302,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean available = new File("../../update/files/EnableTrickOrTreat.dat").exists();
|
||||
if (!available)
|
||||
if (!availableTrick)
|
||||
{
|
||||
trickLore.add(C.cRed + "This item is no longer available!");
|
||||
}
|
||||
@ -323,8 +328,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean available = new File("../../update/files/EnableThankful.dat").exists();
|
||||
if (!available)
|
||||
if (!availableThank)
|
||||
{
|
||||
thankLore.add(C.cRed + "This item is no longer available!");
|
||||
}
|
||||
@ -351,9 +355,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
}
|
||||
else
|
||||
{
|
||||
gingerbreadLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + "20000 Treasure Shards");
|
||||
gingerbreadLore.add(" ");
|
||||
gingerbreadLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
||||
gingerbreadLore.add(C.cRed + "This item is no longer available!");
|
||||
}
|
||||
|
||||
List<String> minestrikeLore = Lists.newArrayList();
|
||||
@ -424,13 +426,37 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
_normalTreasures.add(omegaTreasureItem);
|
||||
_normalTreasures.add(minestrikeTreasureItem);
|
||||
|
||||
_seasonalTreasures.add(winterTreasureItem);
|
||||
_seasonalTreasures.add(freedomTreasureItem);
|
||||
_seasonalTreasures.add(hauntedTreasureItem);
|
||||
_seasonalTreasures.add(trickTreasureItem);
|
||||
_seasonalTreasures.add(thankTreasureItem);
|
||||
|
||||
_specialTreasures.add(gingerbreadTreasureItem);
|
||||
|
||||
if (availableChristmas)
|
||||
_specialTreasures.add(winterTreasureItem);
|
||||
else
|
||||
_seasonalTreasures.add(winterTreasureItem);
|
||||
|
||||
if (availableFreedom)
|
||||
_specialTreasures.add(freedomTreasureItem);
|
||||
else
|
||||
_seasonalTreasures.add(freedomTreasureItem);
|
||||
|
||||
if (availableHaunted)
|
||||
_specialTreasures.add(hauntedTreasureItem);
|
||||
else
|
||||
_seasonalTreasures.add(hauntedTreasureItem);
|
||||
|
||||
if (availableTrick)
|
||||
_specialTreasures.add(trickTreasureItem);
|
||||
else
|
||||
_seasonalTreasures.add(trickTreasureItem);
|
||||
|
||||
if (availableThank)
|
||||
_specialTreasures.add(thankTreasureItem);
|
||||
else
|
||||
_seasonalTreasures.add(thankTreasureItem);
|
||||
|
||||
if (availableGingerbread)
|
||||
_specialTreasures.add(gingerbreadTreasureItem);
|
||||
else
|
||||
_seasonalTreasures.add(gingerbreadTreasureItem);
|
||||
}
|
||||
|
||||
private void buildFirstPage()
|
||||
|
Loading…
Reference in New Issue
Block a user