Add all old chest types
This commit is contained in:
parent
b0b581bb0b
commit
029b0606d0
@ -54,7 +54,7 @@ public class AchievementManager extends MiniPlugin
|
|||||||
_clientManager = clientManager;
|
_clientManager = clientManager;
|
||||||
_shop = new AchievementShop(this, _statsManager, clientManager, donationManager, "Achievement");
|
_shop = new AchievementShop(this, _statsManager, clientManager, donationManager, "Achievement");
|
||||||
|
|
||||||
new LevelingManager(this);
|
//new LevelingManager(this);
|
||||||
|
|
||||||
generatePermissions();
|
generatePermissions();
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ public class MorphAnath extends MorphGadget
|
|||||||
|
|
||||||
Block block = player.getLocation().getBlock();
|
Block block = player.getLocation().getBlock();
|
||||||
|
|
||||||
while (!UtilBlock.solid(block))
|
while (!UtilBlock.solid(block) && block.getLocation().getBlockY() > 10)
|
||||||
{
|
{
|
||||||
block = block.getRelative(BlockFace.DOWN);
|
block = block.getRelative(BlockFace.DOWN);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilEnt;
|
|||||||
import mineplex.core.hologram.Hologram;
|
import mineplex.core.hologram.Hologram;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.utils.UtilVariant;
|
||||||
import mineplex.serverdata.database.column.Column;
|
import mineplex.serverdata.database.column.Column;
|
||||||
import mineplex.serverdata.database.column.ColumnByte;
|
import mineplex.serverdata.database.column.ColumnByte;
|
||||||
import mineplex.serverdata.database.column.ColumnDouble;
|
import mineplex.serverdata.database.column.ColumnDouble;
|
||||||
@ -59,7 +60,18 @@ public class NPC
|
|||||||
public LivingEntity spawnEntity()
|
public LivingEntity spawnEntity()
|
||||||
{
|
{
|
||||||
_spawn.getChunk().load(true);
|
_spawn.getChunk().load(true);
|
||||||
LivingEntity entity = (LivingEntity) _spawn.getWorld().spawnEntity(_spawn, _entityType);
|
LivingEntity entity;
|
||||||
|
|
||||||
|
//TODO remove this terrible hack
|
||||||
|
if (_name.contains("Halloween"))
|
||||||
|
{
|
||||||
|
entity = UtilVariant.spawnWitherSkeleton(_spawn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entity = (LivingEntity) _spawn.getWorld().spawnEntity(_spawn, _entityType);
|
||||||
|
}
|
||||||
|
|
||||||
boolean nullName = _name.equals("NULL");
|
boolean nullName = _name.equals("NULL");
|
||||||
|
|
||||||
entity.setCanPickupItems(false);
|
entity.setCanPickupItems(false);
|
||||||
|
@ -472,13 +472,13 @@ public class NewNPCManager extends MiniPlugin
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param metadata The metadata you wish to find all the NPCs of.
|
* @param metadata The metadata you wish to find all the NPCs of.
|
||||||
* @return A list of {@link NPC} that are unloaded (have no entity attached to them) and that have the metadata
|
* @return A list of {@link NPC} that are unloaded (have no entity attached to them) and that have the metadata which
|
||||||
* specified.
|
* starts with that specified.
|
||||||
*/
|
*/
|
||||||
private List<NPC> getUnloadedNPCs(String metadata)
|
private List<NPC> getUnloadedNPCs(String metadata)
|
||||||
{
|
{
|
||||||
return _npcs.stream()
|
return _npcs.stream()
|
||||||
.filter(npc -> npc.getMetadata().equals(metadata) && npc.getEntity() == null)
|
.filter(npc -> npc.getMetadata().startsWith(metadata) && npc.getEntity() == null)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,4 @@ public class ChestReward extends InventoryReward
|
|||||||
{
|
{
|
||||||
super(type.getName(), type.getItemName(), "Treasure Chest", min, max, type.getItemStack(), rarity, shardValue);
|
super(type.getName(), type.getItemName(), "Treasure Chest", min, max, type.getItemStack(), rarity, shardValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -185,6 +185,7 @@ public class TreasureLocation implements Listener
|
|||||||
|
|
||||||
if (_session.hasFailed())
|
if (_session.hasFailed())
|
||||||
{
|
{
|
||||||
|
getManager().getInventoryManager().addItemToInventory(null, player, treasure.getTreasureType().getItemName(), 1);
|
||||||
_session = null;
|
_session = null;
|
||||||
player.sendMessage(F.main(getManager().getName(), "Sorry, it looks like the rewards for the chest could not be generated."));
|
player.sendMessage(F.main(getManager().getName(), "Sorry, it looks like the rewards for the chest could not be generated."));
|
||||||
return;
|
return;
|
||||||
|
@ -24,8 +24,11 @@ import mineplex.core.recharge.Recharge;
|
|||||||
import mineplex.core.treasure.reward.TreasureRewardManager;
|
import mineplex.core.treasure.reward.TreasureRewardManager;
|
||||||
import mineplex.core.treasure.types.AncientTreasure;
|
import mineplex.core.treasure.types.AncientTreasure;
|
||||||
import mineplex.core.treasure.types.IlluminatedTreasure;
|
import mineplex.core.treasure.types.IlluminatedTreasure;
|
||||||
|
import mineplex.core.treasure.types.MOBATreasure;
|
||||||
|
import mineplex.core.treasure.types.MinestrikeTreasure;
|
||||||
import mineplex.core.treasure.types.MythicalTreasure;
|
import mineplex.core.treasure.types.MythicalTreasure;
|
||||||
import mineplex.core.treasure.types.OldTreasure;
|
import mineplex.core.treasure.types.OldTreasure;
|
||||||
|
import mineplex.core.treasure.types.OmegaTreasure;
|
||||||
import mineplex.core.treasure.types.Treasure;
|
import mineplex.core.treasure.types.Treasure;
|
||||||
import mineplex.core.treasure.types.TrickOrTreatTreasure;
|
import mineplex.core.treasure.types.TrickOrTreatTreasure;
|
||||||
|
|
||||||
@ -66,6 +69,9 @@ public class TreasureManager extends MiniPlugin
|
|||||||
addTreasureType(new AncientTreasure());
|
addTreasureType(new AncientTreasure());
|
||||||
addTreasureType(new MythicalTreasure());
|
addTreasureType(new MythicalTreasure());
|
||||||
addTreasureType(new IlluminatedTreasure());
|
addTreasureType(new IlluminatedTreasure());
|
||||||
|
addTreasureType(new OmegaTreasure());
|
||||||
|
addTreasureType(new MinestrikeTreasure());
|
||||||
|
addTreasureType(new MOBATreasure());
|
||||||
addTreasureType(new TrickOrTreatTreasure());
|
addTreasureType(new TrickOrTreatTreasure());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,11 +82,6 @@ public class TreasureSession implements Listener
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Location location = event.getClickedBlock().getLocation();
|
Location location = event.getClickedBlock().getLocation();
|
||||||
|
|
||||||
if (!player.equals(getPlayer()))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
|
||||||
for (Location chestLocation : _treasureLocation.getChestLocations())
|
for (Location chestLocation : _treasureLocation.getChestLocations())
|
||||||
@ -107,7 +102,7 @@ public class TreasureSession implements Listener
|
|||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if (_openedChests.contains(location) || isDone())
|
if (!player.equals(event.getPlayer()) || _openedChests.contains(location) || isDone())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
package mineplex.core.treasure.animation.animations;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||||
|
import mineplex.core.treasure.TreasureLocation;
|
||||||
|
import mineplex.core.treasure.animation.TreasureOpenAnimation;
|
||||||
|
import mineplex.core.treasure.types.Treasure;
|
||||||
|
|
||||||
|
public class MOBAChestAnimation extends TreasureOpenAnimation
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final int RADIUS = 3;
|
||||||
|
private static final double OFFSET_THETA = Math.PI / 10;
|
||||||
|
private static final double DELTA_THETA = Math.PI / 40;
|
||||||
|
private static final double TOTAL_THETA = 2 * Math.PI;
|
||||||
|
|
||||||
|
private double _deltaTheta;
|
||||||
|
private double _totalTheta;
|
||||||
|
|
||||||
|
public MOBAChestAnimation(Treasure treasure, TreasureLocation treasureLocation)
|
||||||
|
{
|
||||||
|
super(treasure, treasureLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart()
|
||||||
|
{
|
||||||
|
changeFloor(Material.PRISMARINE, 0, Material.PRISMARINE, 1);
|
||||||
|
|
||||||
|
List<Location> chests = getTreasureLocation().getChestLocations();
|
||||||
|
_deltaTheta = Math.PI * 2 / (double) chests.size();
|
||||||
|
|
||||||
|
for (Location location : chests)
|
||||||
|
{
|
||||||
|
ArmorStand stand = spawnArmourStand(location);
|
||||||
|
disguise(new DisguiseGuardian(stand));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick()
|
||||||
|
{
|
||||||
|
_totalTheta += DELTA_THETA;
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
for (ArmorStand stand : _stands)
|
||||||
|
{
|
||||||
|
Location location = getTreasureLocation().getChest().clone();
|
||||||
|
double x = RADIUS * Math.cos(_totalTheta + OFFSET_THETA + index * _deltaTheta);
|
||||||
|
double z = RADIUS * Math.sin(_totalTheta + OFFSET_THETA + index * _deltaTheta);
|
||||||
|
|
||||||
|
location.add(x, 0, z);
|
||||||
|
|
||||||
|
location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(location, getTreasureLocation().getChest())));
|
||||||
|
|
||||||
|
stand.teleport(location);
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.DRIP_WATER, location.add(0, 1, 0), 0.25F, 0.25F, 0.25F, 0.1F, 1, ViewDist.NORMAL);
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_totalTheta >= TOTAL_THETA)
|
||||||
|
{
|
||||||
|
for (ArmorStand stand : _stands)
|
||||||
|
{
|
||||||
|
Location location = stand.getLocation();
|
||||||
|
stand.getWorld().playSound(location, Sound.NOTE_PLING, 1, 1.2F);
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, location, 0, 0, 0, 0.1F, 1, ViewDist.NORMAL);
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.PORTAL, location, 0.8F, 0.8F, 0.8F, 0.1F, 20, ViewDist.NORMAL);
|
||||||
|
stand.remove();
|
||||||
|
|
||||||
|
createChestAt(location, Material.ENDER_CHEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
setRunning(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFinish()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package mineplex.core.treasure.animation.animations;
|
||||||
|
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.treasure.TreasureLocation;
|
||||||
|
import mineplex.core.treasure.animation.TreasureOpenAnimation;
|
||||||
|
import mineplex.core.treasure.types.Treasure;
|
||||||
|
|
||||||
|
public class MinestrikeChestAnimation extends TreasureOpenAnimation
|
||||||
|
{
|
||||||
|
|
||||||
|
public MinestrikeChestAnimation(Treasure treasure, TreasureLocation treasureLocation)
|
||||||
|
{
|
||||||
|
super(treasure, treasureLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart()
|
||||||
|
{
|
||||||
|
changeFloor(Material.SAND, 0, Material.SANDSTONE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick()
|
||||||
|
{
|
||||||
|
if (getTicks() % 3 == 0)
|
||||||
|
{
|
||||||
|
for (Location location : getTreasureLocation().getChestLocations())
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.BLOCK_DUST.getParticle(Material.OBSIDIAN, 0), location.clone().add(0, 0.4, 0), 0.25F, 0.25F, 0.25F, 0, 3, ViewDist.NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getTicks() > 50)
|
||||||
|
{
|
||||||
|
setRunning(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFinish()
|
||||||
|
{
|
||||||
|
for (Location location : getTreasureLocation().getChestLocations())
|
||||||
|
{
|
||||||
|
location = location.clone();
|
||||||
|
location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(location, getTreasureLocation().getChest())));
|
||||||
|
location.getWorld().playEffect(location, Effect.STEP_SOUND, Material.CHEST);
|
||||||
|
createChestAt(location, Material.CHEST);
|
||||||
|
|
||||||
|
location.add(0, 1, 0);
|
||||||
|
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, location, 0, 0, 0, 0.1F, 1, ViewDist.NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package mineplex.core.treasure.animation.animations;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.skin.SkinData;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.treasure.TreasureLocation;
|
||||||
|
import mineplex.core.treasure.animation.TreasureOpenAnimation;
|
||||||
|
import mineplex.core.treasure.types.Treasure;
|
||||||
|
|
||||||
|
public class OmegaChestAnimation extends TreasureOpenAnimation
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final ItemStack HELMET = SkinData.OMEGA_CHEST.getSkull();
|
||||||
|
private static final double SHAKE_MAGNITUDE = Math.PI / 35D;
|
||||||
|
|
||||||
|
private int _index;
|
||||||
|
|
||||||
|
public OmegaChestAnimation(Treasure treasure, TreasureLocation treasureLocation)
|
||||||
|
{
|
||||||
|
super(treasure, treasureLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart()
|
||||||
|
{
|
||||||
|
changeFloor(Material.WOOL, 15, Material.WOOL, 7);
|
||||||
|
|
||||||
|
for (Location location : getTreasureLocation().getChestLocations())
|
||||||
|
{
|
||||||
|
ArmorStand stand = spawnArmourStand(location.clone().subtract(0, 2.5, 0));
|
||||||
|
|
||||||
|
stand.setHelmet(HELMET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick()
|
||||||
|
{
|
||||||
|
if (getTicks() % 10 == 0 && _index != _stands.size())
|
||||||
|
{
|
||||||
|
_index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int chestY = getTreasureLocation().getChest().getBlockY();
|
||||||
|
boolean moved = false;
|
||||||
|
|
||||||
|
for (int i = 0; i < _index; i++)
|
||||||
|
{
|
||||||
|
ArmorStand stand = _stands.get(i);
|
||||||
|
Location location = stand.getLocation();
|
||||||
|
|
||||||
|
if (location.getY() > chestY - 1)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (Math.random() < 0.1)
|
||||||
|
{
|
||||||
|
stand.getWorld().playSound(location, Sound.ZOMBIE_UNFECT, 1, 0.7F);
|
||||||
|
}
|
||||||
|
|
||||||
|
moved = true;
|
||||||
|
location.add(0, 0.05, 0);
|
||||||
|
stand.teleport(location);
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.BLOCK_DUST.getParticle(Material.OBSIDIAN, 0), stand.getLocation().add(0, 1.5, 0), 0.25F, 0.25F, 0.25F, 0, 3, ViewDist.NORMAL);
|
||||||
|
|
||||||
|
if (location.getY() > chestY - 1)
|
||||||
|
{
|
||||||
|
resetArmourStand(stand);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shakeArmourStand(stand, SHAKE_MAGNITUDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!moved)
|
||||||
|
{
|
||||||
|
for (ArmorStand stand : _stands)
|
||||||
|
{
|
||||||
|
Location location = stand.getLocation().add(0, 1, 0);
|
||||||
|
UtilParticle.PlayParticleToAll(ParticleType.WITCH_MAGIC, location, 0.5F, 0.5F, 0.5F, 0.5F, 20, ViewDist.NORMAL);
|
||||||
|
createChestAt(location, Material.ENDER_CHEST);
|
||||||
|
stand.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
setRunning(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFinish()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,125 @@
|
|||||||
|
package mineplex.core.treasure.types;
|
||||||
|
|
||||||
|
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphType;
|
||||||
|
import mineplex.core.gadget.gadgets.gamemodifiers.moba.skins.HeroSkinGadget;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphAnath;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphBardolf;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphBiff;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphDana;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphDevon;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphHattori;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphIvy;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphLarissa;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.moba.MorphRowena;
|
||||||
|
import mineplex.core.reward.RewardType;
|
||||||
|
import mineplex.core.reward.rewards.GadgetReward;
|
||||||
|
import mineplex.core.treasure.animation.animations.MOBAChestAnimation;
|
||||||
|
import mineplex.core.treasure.animation.animations.TrickOrTreatChestAnimation;
|
||||||
|
import mineplex.core.treasure.reward.RewardRarity;
|
||||||
|
|
||||||
|
public class MOBATreasure extends Treasure
|
||||||
|
{
|
||||||
|
|
||||||
|
public MOBATreasure()
|
||||||
|
{
|
||||||
|
super(TreasureType.MOBA);
|
||||||
|
|
||||||
|
setAnimation(treasureLocation -> new MOBAChestAnimation(this, treasureLocation));
|
||||||
|
setRewards(RewardType.MOBA);
|
||||||
|
setRewardsPerChest(4);
|
||||||
|
setPurchasable(20000);
|
||||||
|
purchasableFromStore();
|
||||||
|
enabledByDefault();
|
||||||
|
allowDuplicates();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addUncommon(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
for (ShopMorphType shopMorphType : ShopMorphType.values())
|
||||||
|
{
|
||||||
|
if (shopMorphType.getRarity() == rarity)
|
||||||
|
{
|
||||||
|
addMOBAShopSkin(shopMorphType, rarity, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addAllMOBASkins(rarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addRare(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
for (ShopMorphType shopMorphType : ShopMorphType.values())
|
||||||
|
{
|
||||||
|
if (shopMorphType.getRarity() == rarity)
|
||||||
|
{
|
||||||
|
addMOBAShopSkin(shopMorphType, rarity, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addAllMOBASkins(rarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addLegendary(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
addGadgetReward(getGadget(MorphHattori.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphDevon.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphAnath.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphDana.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphBardolf.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphRowena.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphLarissa.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphBiff.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphIvy.class), rarity, 1);
|
||||||
|
|
||||||
|
addAllMOBASkins(rarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addMythical(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addAllMOBASkins(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
HeroSkinGadget.getSkins().forEach((name, dataList) ->
|
||||||
|
{
|
||||||
|
if (name.equals("Bardolf-Werewolf"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dataList.forEach(data ->
|
||||||
|
{
|
||||||
|
if (data.getRarity() != rarity)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
addMOBASkin(data.getGadget(), rarity, 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public GadgetReward addMOBASkin(HeroSkinGadget gadget, RewardRarity rarity, int weight)
|
||||||
|
{
|
||||||
|
return addMOBASkin(gadget, rarity, weight, getShards(rarity));
|
||||||
|
}
|
||||||
|
|
||||||
|
public GadgetReward addMOBASkin(HeroSkinGadget gadget, RewardRarity rarity, int weight, int shards)
|
||||||
|
{
|
||||||
|
return addGadgetReward(gadget, rarity, weight, shards);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GadgetReward addMOBAShopSkin(ShopMorphType morphType, RewardRarity rarity, int weight)
|
||||||
|
{
|
||||||
|
return addMOBAShopSkin(morphType, rarity, weight, getShards(rarity));
|
||||||
|
}
|
||||||
|
|
||||||
|
public GadgetReward addMOBAShopSkin(ShopMorphType morphType, RewardRarity rarity, int weight, int shards)
|
||||||
|
{
|
||||||
|
return addGadgetReward(GADGET_MANAGER.getGameCosmeticManager().getGadgetFrom(morphType.getName()), rarity, weight, shards);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package mineplex.core.treasure.types;
|
||||||
|
|
||||||
|
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
|
||||||
|
import mineplex.core.reward.RewardType;
|
||||||
|
import mineplex.core.reward.rewards.GadgetReward;
|
||||||
|
import mineplex.core.treasure.animation.animations.MinestrikeChestAnimation;
|
||||||
|
import mineplex.core.treasure.reward.RewardRarity;
|
||||||
|
|
||||||
|
public class MinestrikeTreasure extends Treasure
|
||||||
|
{
|
||||||
|
|
||||||
|
public MinestrikeTreasure()
|
||||||
|
{
|
||||||
|
super(TreasureType.MINESTRIKE);
|
||||||
|
|
||||||
|
setAnimation(treasureLocation -> new MinestrikeChestAnimation(this, treasureLocation));
|
||||||
|
setRewards(RewardType.MINESTRIKE_CHEST);
|
||||||
|
setRewardsPerChest(2);
|
||||||
|
setPurchasable(10000);
|
||||||
|
purchasableFromStore();
|
||||||
|
enabledByDefault();
|
||||||
|
allowDuplicates();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addRare(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.SSG_08_Blood_in_the_Water, rarity, 150, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Galil_AR_Eco, rarity, 150, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Nova_Koi, rarity, 100, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Knife_M9_Bayonette_Fade, rarity, 30, 2500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.PP_Bizon_Streak, rarity, 150, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.CZ75_Auto_Tigris, rarity, 100, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.XM1014_Tranquility, rarity, 100, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Desert_Eagle_Golden_Gun, rarity, 30, 2500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.P90_Asiimov, rarity, 100, 1000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.SG553_Pulse, rarity, 100, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addLegendary(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Desert_Eagle_Blaze, rarity, 100, 5000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Glock_18_Fade, rarity, 100, 5000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.P250_Muertos, rarity, 100, 5000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.AK_47_Vulcan, rarity, 100, 5000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Knife_Counter_Terrorist_Sword, rarity, 50, 6500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Knife_Terrorist_Sword, rarity, 50, 6500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.Knife_M9_Bayonette_Glass, rarity, 50, 6500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.AK_47_Guardian, rarity, 10, 7500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.AWP_Asiimov, rarity, 100, 5000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.FAMAS_Pulse, rarity, 100, 5000);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.XM1014_Pig_Gun, rarity, 10, 7500);
|
||||||
|
addMineStrikeSkinReward(MineStrikeSkin.M4A4_Enderman, rarity, 10, 7500);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addMythical(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private GadgetReward addMineStrikeSkinReward(MineStrikeSkin skin, RewardRarity rarity, int weight, int shards)
|
||||||
|
{
|
||||||
|
return addGadgetReward(GADGET_MANAGER.getGameCosmeticManager().getGadgetFrom(skin.getSkinName()), rarity, weight, shards);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,399 @@
|
|||||||
|
package mineplex.core.treasure.types;
|
||||||
|
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailBlood;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailConfetti;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCupid;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEmerald;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailSpring;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm;
|
||||||
|
import mineplex.core.gadget.gadgets.balloons.BalloonType;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathBlood;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathCandyCane;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathCupidsBrokenHeart;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathEmerald;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathFreedom;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathFrostLord;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathMapleLeaf;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathMusic;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathPinataBurst;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathPresentDanger;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathSpring;
|
||||||
|
import mineplex.core.gadget.gadgets.death.DeathStorm;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCupidsWings;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEmerald;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFirecracker;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFreedom;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpSpring;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
|
||||||
|
import mineplex.core.gadget.gadgets.hat.HatType;
|
||||||
|
import mineplex.core.gadget.gadgets.kitselector.HaloKitSelector;
|
||||||
|
import mineplex.core.gadget.gadgets.kitselector.RainbowDanceKitSelector;
|
||||||
|
import mineplex.core.gadget.gadgets.kitselector.ShimmeringRingKitSelector;
|
||||||
|
import mineplex.core.gadget.gadgets.kitselector.SingleParticleKitSelector.SingleParticleSelectors;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphAwkwardRabbit;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphBunny;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphChicken;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphCow;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphLoveDoctor;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphUncleSam;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphVillager;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountBabyReindeer;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountCake;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountCart;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountChicken;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountFreedomHorse;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountFrost;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountLoveTrain;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountMule;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountNightmareSteed;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountSlime;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountSpider;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountStPatricksHorse;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountUndead;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountValentinesSheep;
|
||||||
|
import mineplex.core.gadget.gadgets.mount.types.MountZombie;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitBoots;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitChestplate;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitHelmet;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitLeggings;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitBoots;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitChestplate;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitHelmet;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitLeggings;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksBoots;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksChestplate;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksHat;
|
||||||
|
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksLeggings;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleBlood;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleEmerald;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticlePartyTime;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleRain;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsLove;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.freedom.ParticleAuraNiceness;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.freedom.ParticleCanadian;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedomFireworks;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.freedom.ParticleStarSpangled;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
|
||||||
|
import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt;
|
||||||
|
import mineplex.core.gadget.gadgets.taunts.RainbowTaunt;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectSnowTrails;
|
||||||
|
import mineplex.core.pet.PetType;
|
||||||
|
import mineplex.core.reward.RewardType;
|
||||||
|
import mineplex.core.treasure.animation.animations.OmegaChestAnimation;
|
||||||
|
import mineplex.core.treasure.reward.RewardRarity;
|
||||||
|
|
||||||
|
public class OmegaTreasure extends Treasure
|
||||||
|
{
|
||||||
|
|
||||||
|
public OmegaTreasure()
|
||||||
|
{
|
||||||
|
super(TreasureType.OMEGA);
|
||||||
|
|
||||||
|
setAnimation(treasureLocation -> new OmegaChestAnimation(this, treasureLocation));
|
||||||
|
setRewards(RewardType.OMEGA_CHEST);
|
||||||
|
setRewardsPerChest(1);
|
||||||
|
enabledByDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addUncommon(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
addGadgetReward(getGadget(ArrowTrailRedWhite.class), rarity, 2);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailFreedom.class), rarity, 2);
|
||||||
|
|
||||||
|
addMusicReward("Blocks Disc", rarity, 25);
|
||||||
|
addMusicReward("Cat Disc", rarity, 25);
|
||||||
|
addMusicReward("Chirp Disc", rarity, 25);
|
||||||
|
addMusicReward("Far Disc", rarity, 25);
|
||||||
|
addMusicReward("Mall Disc", rarity, 25);
|
||||||
|
addMusicReward("Mellohi Disc", rarity, 25);
|
||||||
|
addMusicReward("Stal Disc", rarity, 25);
|
||||||
|
addMusicReward("Strad Disc", rarity, 25);
|
||||||
|
addMusicReward("Wait Disc", rarity, 25);
|
||||||
|
addMusicReward("Ward Disc", rarity, 25);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(ArrowTrailHalloween.class), rarity, 50);
|
||||||
|
|
||||||
|
addHatReward(HatType.PUMPKIN, rarity, 75);
|
||||||
|
addHatReward(HatType.PRESENT, rarity, 5);
|
||||||
|
addHatReward(HatType.SNOWMAN, rarity, 5);
|
||||||
|
|
||||||
|
addBalloonReward(BalloonType.BABY_COW, rarity, 10, 100);
|
||||||
|
addBalloonReward(BalloonType.BABY_PIG, rarity, 10, 100);
|
||||||
|
addBalloonReward(BalloonType.BABY_SHEEP, rarity, 15, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addRare(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
addTitleReward("shrug", rarity, 10, 500);
|
||||||
|
addTitleReward("tableflip", rarity, 10, 500);
|
||||||
|
addTitleReward("tablerespecter", rarity, 15, 500);
|
||||||
|
addTitleReward("tableflip-disgusted", rarity, 15, 500);
|
||||||
|
addTitleReward("tableflip-enraged", rarity, 15, 500);
|
||||||
|
addTitleReward("tableflip-riot", rarity, 10, 500);
|
||||||
|
addTitleReward("teddy-bear", rarity, 10, 500);
|
||||||
|
addTitleReward("disgust", rarity, 10, 500);
|
||||||
|
addTitleReward("old-man", rarity, 5, 500);
|
||||||
|
addTitleReward("jake", rarity, 5, 500);
|
||||||
|
addTitleReward("finn", rarity, 5, 500);
|
||||||
|
addTitleReward("finn-and-jake", rarity, 5, 500);
|
||||||
|
addTitleReward("boxer", rarity, 5, 500);
|
||||||
|
addTitleReward("zoidberg", rarity, 5, 500);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(DoubleJumpFreedom.class), rarity, 5);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpBlood.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpFirecracker.class), rarity, 33);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpEmerald.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpMusic.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpShadow.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpStorm.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpCandyCane.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpHalloween.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpSpring.class), rarity, 40);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpFreedom.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpMaple.class), rarity, 50);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(DeathFreedom.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(DeathStorm.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(DeathBlood.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(DeathEmerald.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(DeathMusic.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(DeathPinataBurst.class), rarity, 27);
|
||||||
|
addGadgetReward(getGadget(DeathShadow.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(DeathCandyCane.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(DeathSpring.class), rarity, 60);
|
||||||
|
addGadgetReward(getGadget(DeathMapleLeaf.class), rarity, 10);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(ArrowTrailFreedom.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailConfetti.class), rarity, 27);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailBlood.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailEmerald.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailMusic.class), rarity, 27);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailStorm.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailShadow.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailCandyCane.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailSpring.class), rarity, 60);
|
||||||
|
|
||||||
|
addHatReward(HatType.UNCLE_SAM, rarity, 25);
|
||||||
|
addHatReward(HatType.COMPANION_BLOCK, rarity, 15);
|
||||||
|
addHatReward(HatType.LOVESTRUCK, rarity, 20);
|
||||||
|
addHatReward(HatType.SECRET_PACKAGE, rarity, 25);
|
||||||
|
addHatReward(HatType.TEDDY_BEAR, rarity, 25);
|
||||||
|
addHatReward(HatType.SANTA, rarity, 25);
|
||||||
|
addHatReward(HatType.RUDOLPH, rarity, 25);
|
||||||
|
addHatReward(HatType.COAL, rarity, 25);
|
||||||
|
addHatReward(HatType.AMERICA, rarity, 50);
|
||||||
|
addHatReward(HatType.CANADA, rarity, 50);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(MorphChicken.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(MorphCow.class), rarity, 167);
|
||||||
|
addGadgetReward(getGadget(MorphEnderman.class), rarity, 33);
|
||||||
|
addGadgetReward(getGadget(MorphVillager.class), rarity, 83);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(WinEffectFlames.class), rarity, 100);
|
||||||
|
addGadgetReward(getGadget(WinEffectSnowTrails.class), rarity, 100);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(MountFrost.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(MountCart.class), rarity, 100);
|
||||||
|
addGadgetReward(getGadget(MountMule.class), rarity, 200);
|
||||||
|
addGadgetReward(getGadget(MountSlime.class), rarity, 67);
|
||||||
|
addGadgetReward(getGadget(MountLoveTrain.class), rarity, 20);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(OutfitRaveSuitBoots.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(OutfitRaveSuitChestplate.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(OutfitRaveSuitLeggings.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(OutfitRaveSuitHelmet.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(OutfitSpaceSuitBoots.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitSpaceSuitChestplate.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitSpaceSuitLeggings.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitSpaceSuitHelmet.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitStPatricksChestplate.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitStPatricksLeggings.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitStPatricksBoots.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitFreezeSuitChestplate.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitFreezeSuitLeggings.class), rarity, 50);
|
||||||
|
addGadgetReward(getGadget(OutfitFreezeSuitBoots.class), rarity, 50);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(ParticleCandyCane.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(ParticleChristmasTree.class), rarity, 40);
|
||||||
|
|
||||||
|
addBalloonReward(BalloonType.BABY_ZOMBIE, rarity, 25, 500);
|
||||||
|
addBalloonReward(BalloonType.BABY_MUSHROOM, rarity, 50, 500);
|
||||||
|
addBalloonReward(BalloonType.BABY_OCELOT, rarity, 50, 500);
|
||||||
|
addBalloonReward(BalloonType.BABY_WOLF, rarity, 75, 500);
|
||||||
|
addBalloonReward(BalloonType.BABY_VILLAGER, rarity, 25, 500);
|
||||||
|
addBalloonReward(BalloonType.BABY_SLIME, rarity, 25, 500);
|
||||||
|
addBalloonReward(BalloonType.BAT, rarity, 50, 500);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(HaloKitSelector.class), rarity, 100);
|
||||||
|
addGadgetReward(getGadget(RainbowDanceKitSelector.class), rarity, 100);
|
||||||
|
addGadgetReward(getGadget(ShimmeringRingKitSelector.class), rarity, 100);
|
||||||
|
addGadgetReward(getKitSelector(SingleParticleSelectors.FLAMES_OF_FURY), rarity, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addLegendary(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
addTitleReward("ayyye", rarity, 25, 500);
|
||||||
|
addTitleReward("ameno", rarity, 15, 5000);
|
||||||
|
addTitleReward("magician", rarity, 25, 5000);
|
||||||
|
addTitleReward("fireball", rarity, 75, 5000);
|
||||||
|
addTitleReward("magic-missile", rarity, 75, 5000);
|
||||||
|
addTitleReward("pewpewpew", rarity, 75, 5000);
|
||||||
|
addTitleReward("stardust", rarity, 60, 5000);
|
||||||
|
addTitleReward("blow-a-kiss", rarity, 60, 5000);
|
||||||
|
addTitleReward("cool-guy", rarity, 60, 5000);
|
||||||
|
addTitleReward("deal-with-it", rarity, 60, 5000);
|
||||||
|
addTitleReward("party-time", rarity, 55, 5000);
|
||||||
|
addTitleReward("lalala", rarity, 30, 5000);
|
||||||
|
addTitleReward("gotta-go", rarity, 30, 5000);
|
||||||
|
addTitleReward("whaaat", rarity, 30, 5000);
|
||||||
|
|
||||||
|
addPetReward(PetType.VILLAGER, rarity, 1);
|
||||||
|
addPetReward(PetType.ZOMBIE, rarity, 10);
|
||||||
|
addPetReward(PetType.PIG_ZOMBIE, rarity, 1);
|
||||||
|
addPetReward(PetType.BLAZE, rarity, 2);
|
||||||
|
addPetReward(PetType.RABBIT, rarity, 10);
|
||||||
|
addPetReward(PetType.KILLER_BUNNY, rarity, 3);
|
||||||
|
addPetReward(PetType.CUPID_PET, rarity, 40);
|
||||||
|
addPetReward(PetType.LEPRECHAUN, rarity, 8);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(MorphBunny.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphUncleSam.class), rarity, 5);
|
||||||
|
addGadgetReward(getGadget(MorphPumpkinKing.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MorphBat.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(MorphSlime.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(MorphBlock.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(MorphSnowman.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(MorphGrimReaper.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(MorphAwkwardRabbit.class), rarity, 30);
|
||||||
|
addGadgetReward(getGadget(MorphLoveDoctor.class), rarity, 40);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(ParticleFreedom.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(ParticleWingsAngel.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(ParticleBlood.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(ParticleWingsDemons.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(ParticleEnchant.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(ParticleFairy.class), rarity, 4);
|
||||||
|
addGadgetReward(getGadget(ParticleFireRings.class), rarity, 17);
|
||||||
|
addGadgetReward(getGadget(ParticleEmerald.class), rarity, 8);
|
||||||
|
addGadgetReward(getGadget(ParticleHeart.class), rarity, 2);
|
||||||
|
addGadgetReward(getGadget(ParticleWingsInfernal.class), rarity, 4);
|
||||||
|
addGadgetReward(getGadget(ParticleMusic.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(ParticleWingsPixie.class), rarity, 4);
|
||||||
|
addGadgetReward(getGadget(ParticleRain.class), rarity, 13);
|
||||||
|
addGadgetReward(getGadget(ParticleFoot.class), rarity, 33);
|
||||||
|
addGadgetReward(getGadget(ParticleYinYang.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(ParticleCoalFumes.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(ParticleFrostLord.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(ParticlePartyTime.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(ParticleSpringHalo.class), rarity, 8);
|
||||||
|
addGadgetReward(getGadget(ParticleWingsLove.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(ParticleFreedomFireworks.class), rarity, 24);
|
||||||
|
addGadgetReward(getGadget(ParticleAuraNiceness.class), rarity, 4);
|
||||||
|
addGadgetReward(getGadget(ParticleCanadian.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(ParticleStarSpangled.class), rarity, 1);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(MountFreedomHorse.class), rarity, 5);
|
||||||
|
addGadgetReward(getGadget(MountZombie.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MountSpider.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MountUndead.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MountValentinesSheep.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(MountBabyReindeer.class), rarity, 1);
|
||||||
|
addGadgetReward(getGadget(MountNightmareSteed.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(MountChicken.class), rarity, 5);
|
||||||
|
addGadgetReward(getGadget(MountCake.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(MountStPatricksHorse.class), rarity, 3);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(WinEffectBabyChicken.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(WinEffectLavaTrap.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(WinEffectRiseOfTheElderGuardian.class), rarity, 4);
|
||||||
|
addGadgetReward(getGadget(WinEffectLightningStrike.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(WinEffectMrPunchMan.class), rarity, 33);
|
||||||
|
addGadgetReward(getGadget(WinEffectHalloween.class), rarity, 75);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(DeathEnchant.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(DeathCupidsBrokenHeart.class), rarity, 25);
|
||||||
|
addGadgetReward(getGadget(DeathFrostLord.class), rarity, 15);
|
||||||
|
addGadgetReward(getGadget(DeathPresentDanger.class), rarity, 27);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(DoubleJumpEnchant.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpCupidsWings.class), rarity, 5);
|
||||||
|
addGadgetReward(getGadget(DoubleJumpFrostLord.class), rarity, 10);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(ArrowTrailEnchant.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailFrostLord.class), rarity, 20);
|
||||||
|
addGadgetReward(getGadget(ArrowTrailCupid.class), rarity, 15);
|
||||||
|
|
||||||
|
addHatReward(HatType.GRINCH, rarity, 25);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(OutfitStPatricksHat.class), rarity, 5);
|
||||||
|
addGadgetReward(getGadget(OutfitFreezeSuitHelmet.class), rarity, 2);
|
||||||
|
|
||||||
|
addBalloonReward(BalloonType.SQUID, rarity, 10, 5000);
|
||||||
|
addBalloonReward(BalloonType.SILVERFISH, rarity, 30, 5000);
|
||||||
|
addBalloonReward(BalloonType.GUARDIAN, rarity, 30, 5000);
|
||||||
|
addBalloonReward(BalloonType.EMERALD_BLOCK, rarity, 15, 5000);
|
||||||
|
|
||||||
|
addGadgetReward(getGadget(BlowAKissTaunt.class), rarity, 7);
|
||||||
|
addGadgetReward(getGadget(RainbowTaunt.class), rarity, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addMythical(RewardRarity rarity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,7 @@ import mineplex.core.Managers;
|
|||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.gadgets.balloons.BalloonType;
|
import mineplex.core.gadget.gadgets.balloons.BalloonType;
|
||||||
|
import mineplex.core.gadget.gadgets.hat.HatType;
|
||||||
import mineplex.core.gadget.gadgets.kitselector.SingleParticleKitSelector;
|
import mineplex.core.gadget.gadgets.kitselector.SingleParticleKitSelector;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
@ -51,7 +52,7 @@ public class Treasure
|
|||||||
return TREASURE_REWARD_MANAGER;
|
return TREASURE_REWARD_MANAGER;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final GadgetManager GADGET_MANAGER = Managers.require(GadgetManager.class);
|
protected static final GadgetManager GADGET_MANAGER = Managers.require(GadgetManager.class);
|
||||||
private static final TrackManager TRACK_MANAGER = Managers.require(TrackManager.class);
|
private static final TrackManager TRACK_MANAGER = Managers.require(TrackManager.class);
|
||||||
|
|
||||||
private final TreasureType _treasureType;
|
private final TreasureType _treasureType;
|
||||||
@ -288,12 +289,22 @@ public class Treasure
|
|||||||
return reward;
|
return reward;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected GadgetReward addHatReward(HatType type, RewardRarity rarity, int weight)
|
||||||
|
{
|
||||||
|
return addHatReward(type, rarity, weight, getShards(rarity));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GadgetReward addHatReward(HatType type, RewardRarity rarity, int weight, int shards)
|
||||||
|
{
|
||||||
|
return addGadgetReward(GADGET_MANAGER.getHatGadget(type), rarity, weight, shards);
|
||||||
|
}
|
||||||
|
|
||||||
protected SingleParticleKitSelector getKitSelector(SingleParticleKitSelector.SingleParticleSelectors singleParticleSelectors)
|
protected SingleParticleKitSelector getKitSelector(SingleParticleKitSelector.SingleParticleSelectors singleParticleSelectors)
|
||||||
{
|
{
|
||||||
return GADGET_MANAGER.getSingleParticleKitSelector(singleParticleSelectors);
|
return GADGET_MANAGER.getSingleParticleKitSelector(singleParticleSelectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getShards(RewardRarity rarity)
|
protected int getShards(RewardRarity rarity)
|
||||||
{
|
{
|
||||||
return SHARD_WORTH.getOrDefault(rarity, 0);
|
return SHARD_WORTH.getOrDefault(rarity, 0);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package mineplex.core.treasure.types;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.skin.SkinData;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
|
||||||
public enum TreasureType
|
public enum TreasureType
|
||||||
@ -50,6 +51,31 @@ public enum TreasureType
|
|||||||
"in the depths, always bringing a new",
|
"in the depths, always bringing a new",
|
||||||
"treasure from the darkness."
|
"treasure from the darkness."
|
||||||
),
|
),
|
||||||
|
OMEGA(
|
||||||
|
C.cAqua + "Omega Chest",
|
||||||
|
"Omega Chest",
|
||||||
|
"Omega",
|
||||||
|
SkinData.OMEGA_CHEST.getSkull(),
|
||||||
|
"The most powerful of all chests,",
|
||||||
|
"it is able to go back in time to find",
|
||||||
|
"loot that has been lost..."
|
||||||
|
),
|
||||||
|
MINESTRIKE(
|
||||||
|
C.cGold + "MineStrike Treasure",
|
||||||
|
"Minestrike Chest",
|
||||||
|
"MinestrikeChest",
|
||||||
|
new ItemStack(Material.TNT),
|
||||||
|
"The Minestrike Chest is the only place to get",
|
||||||
|
"the unique skins for Minestrike weapons!"
|
||||||
|
),
|
||||||
|
MOBA(
|
||||||
|
C.cAqua + "Heroes of GWEN Treasure",
|
||||||
|
"HOG Chest",
|
||||||
|
"HOGChest",
|
||||||
|
new ItemStack(Material.PRISMARINE),
|
||||||
|
"Heroes of GWEN exclusive cosmetics!",
|
||||||
|
"Each chest contains 4 exclusive items to the game!"
|
||||||
|
),
|
||||||
TRICK_OR_TREAT(
|
TRICK_OR_TREAT(
|
||||||
C.cGold + "Trick or Treat Box",
|
C.cGold + "Trick or Treat Box",
|
||||||
"Trick or Treat Chest",
|
"Trick or Treat Chest",
|
||||||
|
@ -3,6 +3,8 @@ package mineplex.core.treasure.types;
|
|||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
||||||
import mineplex.core.gadget.gadgets.death.DeathHalloween;
|
import mineplex.core.gadget.gadgets.death.DeathHalloween;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
||||||
|
import mineplex.core.gadget.gadgets.kitselector.HalloweenKitSelector;
|
||||||
|
import mineplex.core.gadget.gadgets.kitselector.SingleParticleKitSelector.SingleParticleSelectors;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleHalloween;
|
import mineplex.core.gadget.gadgets.particle.ParticleHalloween;
|
||||||
import mineplex.core.gadget.gadgets.taunts.InfernalTaunt;
|
import mineplex.core.gadget.gadgets.taunts.InfernalTaunt;
|
||||||
import mineplex.core.reward.RewardType;
|
import mineplex.core.reward.RewardType;
|
||||||
@ -30,6 +32,7 @@ public class TrickOrTreatTreasure extends Treasure
|
|||||||
addGadgetReward(getGadget(ArrowTrailHalloween.class), rarity, 10);
|
addGadgetReward(getGadget(ArrowTrailHalloween.class), rarity, 10);
|
||||||
addGadgetReward(getGadget(DeathHalloween.class), rarity, 10);
|
addGadgetReward(getGadget(DeathHalloween.class), rarity, 10);
|
||||||
addGadgetReward(getGadget(DoubleJumpHalloween.class), rarity, 10);
|
addGadgetReward(getGadget(DoubleJumpHalloween.class), rarity, 10);
|
||||||
|
addGadgetReward(getGadget(HalloweenKitSelector.class), rarity, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,10 +63,9 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
lore.add(C.cGray + description);
|
lore.add(C.cGray + description);
|
||||||
}
|
}
|
||||||
|
|
||||||
lore.add("");
|
|
||||||
|
|
||||||
if (treasure.isPurchasable())
|
if (treasure.isPurchasable())
|
||||||
{
|
{
|
||||||
|
lore.add("");
|
||||||
lore.addAll(treasure.getPurchaseMethods());
|
lore.addAll(treasure.getPurchaseMethods());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +127,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Purchase
|
// Purchase
|
||||||
else
|
else if (_treasure.isPurchasable())
|
||||||
{
|
{
|
||||||
getShop().openPageForPlayer(player, new PurchaseTreasurePage(getPlugin(), getShop(), getPlayer(), _treasure, TreasurePage.this));
|
getShop().openPageForPlayer(player, new PurchaseTreasurePage(getPlugin(), getShop(), getPlayer(), _treasure, TreasurePage.this));
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
String boosterGroup = serverConfiguration.getServerGroup().getBoosterGroup();
|
String boosterGroup = serverConfiguration.getServerGroup().getBoosterGroup();
|
||||||
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
||||||
BoosterManager boosterManager = new BoosterManager(this, boosterGroup, clientManager, donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, boosterGroup, clientManager, donationManager, inventoryManager, thankManager);
|
||||||
HubManager hubManager = new HubManager( blockRestore, clientManager, incognito, donationManager, inventoryManager, disguiseManager, portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, hologramManager, npcManager,packetHandler, punish, serverStatusManager, thankManager, boosterManager, castleManager);
|
HubManager hubManager = new HubManager(clientManager, donationManager, inventoryManager, disguiseManager, portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, hologramManager, npcManager, punish, thankManager, boosterManager);
|
||||||
|
|
||||||
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, eloManager, partyManager);
|
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, eloManager, partyManager);
|
||||||
new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, queueManager, boosterManager);
|
new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, queueManager, boosterManager);
|
||||||
|
@ -9,6 +9,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.newnpc.event.NPCInteractEvent;
|
||||||
import mineplex.core.npc.event.NpcInteractEntityEvent;
|
import mineplex.core.npc.event.NpcInteractEntityEvent;
|
||||||
import mineplex.core.portal.Intent;
|
import mineplex.core.portal.Intent;
|
||||||
import mineplex.core.portal.Portal;
|
import mineplex.core.portal.Portal;
|
||||||
@ -70,9 +71,9 @@ public class TemporaryGemHuntersServerSender extends MiniPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUseNPC(NpcInteractEntityEvent event)
|
public void onUseNPC(NPCInteractEvent event)
|
||||||
{
|
{
|
||||||
if (event.getNpc().getName().contains("Gem Hunters"))
|
if (event.getNpc().getMetadata().equals("GAME_Gem Hunters"))
|
||||||
{
|
{
|
||||||
java.util.Optional<ServerInfo> info = _servers.entrySet().stream()
|
java.util.Optional<ServerInfo> info = _servers.entrySet().stream()
|
||||||
// Ignore the type noise here; it's temporary
|
// Ignore the type noise here; it's temporary
|
||||||
|
@ -58,26 +58,26 @@ public class ParkourManager extends MiniPlugin
|
|||||||
_attempts = new HashMap<>();
|
_attempts = new HashMap<>();
|
||||||
_parkours = new HashSet<>();
|
_parkours = new HashSet<>();
|
||||||
|
|
||||||
_parkours.add(new ParkourData(this, "House"));
|
// _parkours.add(new ParkourData(this, "House"));
|
||||||
_parkours.add(new WaterParkourData(this));
|
// _parkours.add(new WaterParkourData(this));
|
||||||
|
//
|
||||||
List<Snake> snakes = new ArrayList<>();
|
// List<Snake> snakes = new ArrayList<>();
|
||||||
List<Location> path = _worldData.getCustomLocation(String.valueOf(Material.QUARTZ_ORE.getId()));
|
// List<Location> path = _worldData.getCustomLocation(String.valueOf(Material.QUARTZ_ORE.getId()));
|
||||||
|
//
|
||||||
for (Location head : _worldData.getDataLocation("LIGHT_BLUE"))
|
// for (Location head : _worldData.getDataLocation("LIGHT_BLUE"))
|
||||||
{
|
// {
|
||||||
snakes.add(new Snake(head, path));
|
// snakes.add(new Snake(head, path));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
_parkours.add(new SnakeParkourData(this, snakes));
|
// _parkours.add(new SnakeParkourData(this, snakes));
|
||||||
|
//
|
||||||
NewNPCManager npcManager = require(NewNPCManager.class);
|
// NewNPCManager npcManager = require(NewNPCManager.class);
|
||||||
|
//
|
||||||
for (ParkourData data : _parkours)
|
// for (ParkourData data : _parkours)
|
||||||
{
|
// {
|
||||||
npcManager.spawnNPCs(data.getKey() + " START", null);
|
// npcManager.spawnNPCs(data.getKey() + " START", null);
|
||||||
npcManager.spawnNPCs(data.getKey() + " END", null);
|
// npcManager.spawnNPCs(data.getKey() + " END", null);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isParkourMode(Player player)
|
public boolean isParkourMode(Player player)
|
||||||
|
@ -51,8 +51,8 @@ public class HubPlugin extends MiniPlugin
|
|||||||
|
|
||||||
protected void addHubGames()
|
protected void addHubGames()
|
||||||
{
|
{
|
||||||
addHubGame(new Tron(_hubGameManager));
|
//addHubGame(new Tron(_hubGameManager));
|
||||||
addHubGame(new Duels(_hubGameManager));
|
//addHubGame(new Duels(_hubGameManager));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void addHubGame(HubGame game)
|
protected final void addHubGame(HubGame game)
|
||||||
|
@ -19,7 +19,6 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||||
import org.bukkit.event.entity.EntityPortalEvent;
|
import org.bukkit.event.entity.EntityPortalEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerPortalEvent;
|
import org.bukkit.event.player.PlayerPortalEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
@ -40,7 +39,8 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.newnpc.NewNPCManager;
|
||||||
|
import mineplex.core.newnpc.event.NPCInteractEvent;
|
||||||
import mineplex.core.party.PartyManager;
|
import mineplex.core.party.PartyManager;
|
||||||
import mineplex.core.party.event.PartySelectServerEvent;
|
import mineplex.core.party.event.PartySelectServerEvent;
|
||||||
import mineplex.core.portal.Intent;
|
import mineplex.core.portal.Intent;
|
||||||
@ -71,10 +71,10 @@ public class ServerManager extends MiniPlugin
|
|||||||
|
|
||||||
private static final Random random = new Random();
|
private static final Random random = new Random();
|
||||||
|
|
||||||
public final int TOP_SERVERS = 3; // The number of top contending servers for auto-joining games
|
public final int TOP_SERVERS = 3; // The number of top contending servers for auto-joining games
|
||||||
public final int MIN_SLOTS_REQUIRED = 12; // The number of slots the max server must have for auto-join
|
public final int MIN_SLOTS_REQUIRED = 12; // The number of slots the max server must have for auto-join
|
||||||
|
|
||||||
public final long QUEUE_COOLDOWN = 2000; // Cooldown (in milliseconds) between queueing again for players
|
public final long QUEUE_COOLDOWN = 2000; // Cooldown (in milliseconds) between queueing again for players
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
private DonationManager _donationManager;
|
private DonationManager _donationManager;
|
||||||
private Portal _portal;
|
private Portal _portal;
|
||||||
@ -91,20 +91,20 @@ public class ServerManager extends MiniPlugin
|
|||||||
private NautHashMap<String, ServerInfo> _serverInfoMap = new NautHashMap<String, ServerInfo>();
|
private NautHashMap<String, ServerInfo> _serverInfoMap = new NautHashMap<String, ServerInfo>();
|
||||||
private NautHashMap<String, Long> _serverUpdate = new NautHashMap<String, Long>();
|
private NautHashMap<String, Long> _serverUpdate = new NautHashMap<String, Long>();
|
||||||
private NautHashMap<Vector, String> _portalToServerKey = new NautHashMap<Vector, String>();
|
private NautHashMap<Vector, String> _portalToServerKey = new NautHashMap<Vector, String>();
|
||||||
|
|
||||||
private ClansServerShop _clansShop;
|
private ClansServerShop _clansShop;
|
||||||
|
|
||||||
private QuickShop _quickShop;
|
private QuickShop _quickShop;
|
||||||
private LobbyShop _lobbyShop;
|
private LobbyShop _lobbyShop;
|
||||||
|
|
||||||
private boolean _alternateUpdateFire = false;
|
private boolean _alternateUpdateFire = false;
|
||||||
private boolean _retrieving = false;
|
private boolean _retrieving = false;
|
||||||
private long _lastRetrieve = 0;
|
private long _lastRetrieve = 0;
|
||||||
|
|
||||||
public ServerManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, Portal portal, PartyManager partyManager, ServerStatusManager statusManager, HubManager hubManager, QueueManager queueManager, BoosterManager boosterManager)
|
public ServerManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, Portal portal, PartyManager partyManager, ServerStatusManager statusManager, HubManager hubManager, QueueManager queueManager, BoosterManager boosterManager)
|
||||||
{
|
{
|
||||||
super("Server Manager", plugin);
|
super("Server Manager", plugin);
|
||||||
|
|
||||||
_clientManager = clientManager;
|
_clientManager = clientManager;
|
||||||
_donationManager = donationManager;
|
_donationManager = donationManager;
|
||||||
_portal = portal;
|
_portal = portal;
|
||||||
@ -112,20 +112,22 @@ public class ServerManager extends MiniPlugin
|
|||||||
_statusManager = statusManager;
|
_statusManager = statusManager;
|
||||||
_hubManager = hubManager;
|
_hubManager = hubManager;
|
||||||
_boosterManager = boosterManager;
|
_boosterManager = boosterManager;
|
||||||
|
|
||||||
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
|
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
|
||||||
|
|
||||||
loadServers();
|
loadServers();
|
||||||
|
|
||||||
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
|
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
|
||||||
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
|
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
|
||||||
|
|
||||||
// TODO: Find more appropriate place to initialize Clans server shop?
|
// TODO: Find more appropriate place to initialize Clans server shop?
|
||||||
_clansShop = new ClansServerShop(this, _clientManager, _donationManager);
|
_clansShop = new ClansServerShop(this, _clientManager, _donationManager);
|
||||||
|
|
||||||
|
require(NewNPCManager.class).spawnNPCs("GAME_", null);
|
||||||
|
|
||||||
generatePermissions();
|
generatePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generatePermissions()
|
private void generatePermissions()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -133,19 +135,41 @@ public class ServerManager extends MiniPlugin
|
|||||||
PermissionGroup.CONTENT.setPermission(Perm.FEATURE_SERVER, true, true);
|
PermissionGroup.CONTENT.setPermission(Perm.FEATURE_SERVER, true, true);
|
||||||
PermissionGroup.BUILDER.setPermission(Perm.FEATURE_SERVER, true, true);
|
PermissionGroup.BUILDER.setPermission(Perm.FEATURE_SERVER, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void npcInteract(NPCInteractEvent event)
|
||||||
|
{
|
||||||
|
String metadata = event.getNpc().getMetadata();
|
||||||
|
String[] split = metadata.split("_");
|
||||||
|
|
||||||
|
if (split.length < 2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String group = split[1];
|
||||||
|
|
||||||
|
_serverNpcShopMap.entrySet().forEach(entry ->
|
||||||
|
{
|
||||||
|
if (group.equals(entry.getKey()))
|
||||||
|
{
|
||||||
|
entry.getValue().attemptShopOpen(event.getPlayer());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void playerPortalEvent(PlayerPortalEvent event)
|
public void playerPortalEvent(PlayerPortalEvent event)
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void entityPortalEvent(EntityPortalEvent event)
|
public void entityPortalEvent(EntityPortalEvent event)
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void playerCheckPortalEvent(EntityPortalEnterEvent event)
|
public void playerCheckPortalEvent(EntityPortalEnterEvent event)
|
||||||
{
|
{
|
||||||
@ -153,22 +177,24 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
if (event.getEntity() instanceof LivingEntity)
|
if (event.getEntity() instanceof LivingEntity)
|
||||||
UtilAction.velocity(event.getEntity(), UtilAlg.getTrajectory(event.getEntity().getLocation(), _hubManager.GetSpawn()), 1, true, 0.8, 0, 1, true);
|
UtilAction.velocity(event.getEntity(), UtilAlg.getTrajectory(event.getEntity().getLocation(), _hubManager.GetSpawn()), 1, true, 0.8, 0, 1, true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player player = (Player)event.getEntity();
|
|
||||||
|
|
||||||
if(!player.getWorld().getName().equalsIgnoreCase("world"))
|
Player player = (Player) event.getEntity();
|
||||||
|
|
||||||
|
if (!player.getWorld().getName().equalsIgnoreCase("world"))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.teleport(_hubManager.GetSpawn());
|
player.teleport(_hubManager.GetSpawn());
|
||||||
runSyncLater(() -> {_quickShop.attemptShopOpen(player);}, 3L);
|
runSyncLater(() -> {
|
||||||
|
_quickShop.attemptShopOpen(player);
|
||||||
|
}, 3L);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void checkQueuePrompts(UpdateEvent event)
|
public void checkQueuePrompts(UpdateEvent event)
|
||||||
{
|
{
|
||||||
@ -193,7 +219,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void playerInteract(PlayerInteractEvent event)
|
public void playerInteract(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
@ -216,23 +242,23 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
_serverKeyInfoMap.put(serverGroup.getPrefix(), new HashSet<ServerInfo>());
|
_serverKeyInfoMap.put(serverGroup.getPrefix(), new HashSet<ServerInfo>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addServerNpc(ServerGroup serverGroup)
|
public void addServerNpc(ServerGroup serverGroup)
|
||||||
{
|
{
|
||||||
_serverNpcShopMap.put(serverGroup.getServerNpcName(), new ServerNpcShop(this, _clientManager, _donationManager, serverGroup));
|
_serverNpcShopMap.put(serverGroup.getServerNpcName(), new ServerNpcShop(this, _clientManager, _donationManager, serverGroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeServerNpc(String serverNpcName)
|
public void removeServerNpc(String serverNpcName)
|
||||||
{
|
{
|
||||||
Set<ServerInfo> mappedServers = _serverKeyInfoMap.remove(serverNpcName);
|
Set<ServerInfo> mappedServers = _serverKeyInfoMap.remove(serverNpcName);
|
||||||
_serverNpcShopMap.remove(serverNpcName);
|
_serverNpcShopMap.remove(serverNpcName);
|
||||||
|
|
||||||
if (mappedServers != null)
|
if (mappedServers != null)
|
||||||
{
|
{
|
||||||
for (ServerInfo mappedServer : mappedServers)
|
for (ServerInfo mappedServer : mappedServers)
|
||||||
{
|
{
|
||||||
boolean isMappedElseWhere = false;
|
boolean isMappedElseWhere = false;
|
||||||
|
|
||||||
for (String key : _serverKeyInfoMap.keySet())
|
for (String key : _serverKeyInfoMap.keySet())
|
||||||
{
|
{
|
||||||
for (ServerInfo value : _serverKeyInfoMap.get(key))
|
for (ServerInfo value : _serverKeyInfoMap.get(key))
|
||||||
@ -243,27 +269,27 @@ public class ServerManager extends MiniPlugin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMappedElseWhere)
|
if (isMappedElseWhere)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMappedElseWhere)
|
if (!isMappedElseWhere)
|
||||||
_serverInfoMap.remove(mappedServer.Name);
|
_serverInfoMap.remove(mappedServer.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<ServerInfo> getServerList(String serverKey)
|
public Collection<ServerInfo> getServerList(String serverKey)
|
||||||
{
|
{
|
||||||
return _serverKeyInfoMap.get(serverKey);
|
return _serverKeyInfoMap.get(serverKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getAllServers()
|
public Set<String> getAllServers()
|
||||||
{
|
{
|
||||||
return _serverInfoMap.keySet();
|
return _serverInfoMap.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerInfo getServerInfo(String serverName)
|
public ServerInfo getServerInfo(String serverName)
|
||||||
{
|
{
|
||||||
return _serverInfoMap.get(serverName);
|
return _serverInfoMap.get(serverName);
|
||||||
@ -280,28 +306,28 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SEC)
|
if (event.getType() != UpdateType.SEC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_quickShop.UpdatePages();
|
_quickShop.UpdatePages();
|
||||||
|
|
||||||
for (ServerNpcShop shop : _serverNpcShopMap.values())
|
for (ServerNpcShop shop : _serverNpcShopMap.values())
|
||||||
{
|
{
|
||||||
shop.UpdatePages();
|
shop.UpdatePages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void updateServers(UpdateEvent event)
|
public void updateServers(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SEC || (_retrieving && System.currentTimeMillis() - _lastRetrieve <= 5000))
|
if (event.getType() != UpdateType.SEC || (_retrieving && System.currentTimeMillis() - _lastRetrieve <= 5000))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_alternateUpdateFire = !_alternateUpdateFire;
|
_alternateUpdateFire = !_alternateUpdateFire;
|
||||||
|
|
||||||
if (!_alternateUpdateFire)
|
if (!_alternateUpdateFire)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_retrieving = true;
|
_retrieving = true;
|
||||||
|
|
||||||
_statusManager.retrieveServerGroups(new Callback<Collection<ServerGroup>>()
|
_statusManager.retrieveServerGroups(new Callback<Collection<ServerGroup>>()
|
||||||
{
|
{
|
||||||
public void run(final Collection<ServerGroup> serverGroups)
|
public void run(final Collection<ServerGroup> serverGroups)
|
||||||
@ -406,7 +432,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
updateCooldowns();
|
updateCooldowns();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,11 +446,11 @@ public class ServerManager extends MiniPlugin
|
|||||||
UtilPlayer.message(caller, F.help("/servernpc listnpcs", "Lists all server npcs.", ChatColor.DARK_RED));
|
UtilPlayer.message(caller, F.help("/servernpc listnpcs", "Lists all server npcs.", ChatColor.DARK_RED));
|
||||||
UtilPlayer.message(caller, F.help("/servernpc listservers <servernpc>", "Lists all servers.", ChatColor.DARK_RED));
|
UtilPlayer.message(caller, F.help("/servernpc listservers <servernpc>", "Lists all servers.", ChatColor.DARK_RED));
|
||||||
UtilPlayer.message(caller, F.help("/servernpc listoffline", "Shows all servers offline.", ChatColor.DARK_RED));
|
UtilPlayer.message(caller, F.help("/servernpc listoffline", "Shows all servers offline.", ChatColor.DARK_RED));
|
||||||
|
|
||||||
if (message != null)
|
if (message != null)
|
||||||
UtilPlayer.message(caller, F.main(_moduleName, ChatColor.RED + message));
|
UtilPlayer.message(caller, F.main(_moduleName, ChatColor.RED + message));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void help(Player caller)
|
public void help(Player caller)
|
||||||
{
|
{
|
||||||
help(caller, null);
|
help(caller, null);
|
||||||
@ -434,7 +460,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _partyManager;
|
return _partyManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectServer(Player player, ServerInfo serverInfo)
|
public void selectServer(Player player, ServerInfo serverInfo)
|
||||||
{
|
{
|
||||||
player.leaveVehicle();
|
player.leaveVehicle();
|
||||||
@ -442,11 +468,12 @@ public class ServerManager extends MiniPlugin
|
|||||||
|
|
||||||
_portal.sendPlayerToServer(player, serverInfo.Name, Intent.PLAYER_REQUEST);
|
_portal.sendPlayerToServer(player, serverInfo.Name, Intent.PLAYER_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select a {@code serverType} for a {@code player} that wishes to automatically join the best server
|
* Select a {@code serverType} for a {@code player} that wishes to automatically join the best server
|
||||||
* available for that server type.
|
* available for that server type.
|
||||||
* @param player - the player hoping to select a server
|
*
|
||||||
|
* @param player - the player hoping to select a server
|
||||||
* @param serverType - the name of the type of server to be joined
|
* @param serverType - the name of the type of server to be joined
|
||||||
*/
|
*/
|
||||||
public void selectServer(Player player, String serverType)
|
public void selectServer(Player player, String serverType)
|
||||||
@ -455,7 +482,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerInfo bestServer = getBestServer(player, serverType);
|
ServerInfo bestServer = getBestServer(player, serverType);
|
||||||
|
|
||||||
if (bestServer != null)
|
if (bestServer != null)
|
||||||
@ -464,37 +491,37 @@ public class ServerManager extends MiniPlugin
|
|||||||
addCooldown(player);
|
addCooldown(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isOnCooldown(Player player)
|
private boolean isOnCooldown(Player player)
|
||||||
{
|
{
|
||||||
if (_queueCooldowns.containsKey(player.getName()))
|
if (_queueCooldowns.containsKey(player.getName()))
|
||||||
{
|
{
|
||||||
long elapsed = System.currentTimeMillis() - _queueCooldowns.get(player.getName());
|
long elapsed = System.currentTimeMillis() - _queueCooldowns.get(player.getName());
|
||||||
|
|
||||||
return elapsed < QUEUE_COOLDOWN;
|
return elapsed < QUEUE_COOLDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCooldown(Player player)
|
private void addCooldown(Player player)
|
||||||
{
|
{
|
||||||
_queueCooldowns.put(player.getName(), System.currentTimeMillis());
|
_queueCooldowns.put(player.getName(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCooldowns()
|
private void updateCooldowns()
|
||||||
{
|
{
|
||||||
for (Iterator<String> playerIterator = _queueCooldowns.keySet().iterator(); playerIterator.hasNext();)
|
for (Iterator<String> playerIterator = _queueCooldowns.keySet().iterator(); playerIterator.hasNext(); )
|
||||||
{
|
{
|
||||||
Player player = Bukkit.getPlayer(playerIterator.next());
|
Player player = Bukkit.getPlayer(playerIterator.next());
|
||||||
|
|
||||||
if (player == null || !isOnCooldown(player))
|
if (player == null || !isOnCooldown(player))
|
||||||
{
|
{
|
||||||
playerIterator.remove();
|
playerIterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param serverKey - the type of server that should be fetched
|
* @param serverKey - the type of server that should be fetched
|
||||||
* @return the best server that a new player should join according to a {@code serverType} constraint.
|
* @return the best server that a new player should join according to a {@code serverType} constraint.
|
||||||
@ -503,17 +530,17 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
Collection<ServerInfo> serverList = getServerList(serverKey);
|
Collection<ServerInfo> serverList = getServerList(serverKey);
|
||||||
if (serverList == null) return null;
|
if (serverList == null) return null;
|
||||||
|
|
||||||
List<ServerInfo> servers = new ArrayList<ServerInfo>(serverList);
|
List<ServerInfo> servers = new ArrayList<ServerInfo>(serverList);
|
||||||
servers = fetchOpenServers(player, servers, servers.size()); // Removes all full servers from list
|
servers = fetchOpenServers(player, servers, servers.size()); // Removes all full servers from list
|
||||||
Collections.sort(servers, new ServerCountSorter());
|
Collections.sort(servers, new ServerCountSorter());
|
||||||
|
|
||||||
int count = Math.min(servers.size(), TOP_SERVERS);
|
int count = Math.min(servers.size(), TOP_SERVERS);
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
ServerInfo largestServer = servers.get(0);
|
ServerInfo largestServer = servers.get(0);
|
||||||
|
|
||||||
if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED || largestServer.MaxPlayers > 40)
|
if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED || largestServer.MaxPlayers > 40)
|
||||||
{
|
{
|
||||||
return largestServer;
|
return largestServer;
|
||||||
@ -523,15 +550,15 @@ public class ServerManager extends MiniPlugin
|
|||||||
return servers.get(random.nextInt(count));
|
return servers.get(random.nextInt(count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ServerInfo> fetchOpenServers(Player player, List<ServerInfo> servers, int count)
|
public List<ServerInfo> fetchOpenServers(Player player, List<ServerInfo> servers, int count)
|
||||||
{
|
{
|
||||||
List<ServerInfo> results = new ArrayList<ServerInfo>();
|
List<ServerInfo> results = new ArrayList<ServerInfo>();
|
||||||
int requiredSlots = (servers.size() > 0) ? getRequiredSlots(player, servers.get(0).ServerType) : 0;
|
int requiredSlots = (servers.size() > 0) ? getRequiredSlots(player, servers.get(0).ServerType) : 0;
|
||||||
|
|
||||||
for (ServerInfo server : servers)
|
for (ServerInfo server : servers)
|
||||||
{
|
{
|
||||||
if (isInProgress(server))
|
if (isInProgress(server))
|
||||||
@ -541,16 +568,16 @@ public class ServerManager extends MiniPlugin
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (results.size() >= count) break;
|
if (results.size() >= count) break;
|
||||||
|
|
||||||
if (server.getAvailableSlots() > requiredSlots)
|
if (server.getAvailableSlots() > requiredSlots)
|
||||||
{
|
{
|
||||||
results.add(server);
|
results.add(server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInProgress(ServerInfo serverInfo)
|
private boolean isInProgress(ServerInfo serverInfo)
|
||||||
{
|
{
|
||||||
return serverInfo.MOTD.contains("Progress") || serverInfo.MOTD.contains("Restarting");
|
return serverInfo.MOTD.contains("Progress") || serverInfo.MOTD.contains("Restarting");
|
||||||
@ -559,41 +586,41 @@ public class ServerManager extends MiniPlugin
|
|||||||
public void listServerNpcs(Player caller)
|
public void listServerNpcs(Player caller)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(getName(), "Listing Server Npcs:"));
|
UtilPlayer.message(caller, F.main(getName(), "Listing Server Npcs:"));
|
||||||
|
|
||||||
for (String serverNpc : _serverKeyInfoMap.keySet())
|
for (String serverNpc : _serverKeyInfoMap.keySet())
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc));
|
UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listServers(Player caller, String serverNpcName)
|
public void listServers(Player caller, String serverNpcName)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(getName(), "Listing Servers for '" + serverNpcName + "':"));
|
UtilPlayer.message(caller, F.main(getName(), "Listing Servers for '" + serverNpcName + "':"));
|
||||||
|
|
||||||
for (ServerInfo serverNpc : _serverKeyInfoMap.get(serverNpcName))
|
for (ServerInfo serverNpc : _serverKeyInfoMap.get(serverNpcName))
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + serverNpc.MOTD + " " + serverNpc.CurrentPlayers + "/" + serverNpc.MaxPlayers));
|
UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + serverNpc.MOTD + " " + serverNpc.CurrentPlayers + "/" + serverNpc.MaxPlayers));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listOfflineServers(Player caller)
|
public void listOfflineServers(Player caller)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(getName(), "Listing Offline Servers:"));
|
UtilPlayer.message(caller, F.main(getName(), "Listing Offline Servers:"));
|
||||||
|
|
||||||
for (ServerInfo serverNpc : _serverInfoMap.values())
|
for (ServerInfo serverNpc : _serverInfoMap.values())
|
||||||
{
|
{
|
||||||
if (serverNpc.MOTD.equalsIgnoreCase(ChatColor.DARK_RED + "OFFLINE"))
|
if (serverNpc.MOTD.equalsIgnoreCase(ChatColor.DARK_RED + "OFFLINE"))
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + F.time(UtilTime.convertString(System.currentTimeMillis() - _serverUpdate.get(serverNpc.Name), 0, TimeUnit.FIT))));
|
UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + F.time(UtilTime.convertString(System.currentTimeMillis() - _serverUpdate.get(serverNpc.Name), 0, TimeUnit.FIT))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadServers()
|
public void loadServers()
|
||||||
{
|
{
|
||||||
_serverInfoMap.clear();
|
_serverInfoMap.clear();
|
||||||
_serverUpdate.clear();
|
_serverUpdate.clear();
|
||||||
|
|
||||||
for (String npcName : _serverKeyInfoMap.keySet())
|
for (String npcName : _serverKeyInfoMap.keySet())
|
||||||
{
|
{
|
||||||
_serverKeyInfoMap.get(npcName).clear();
|
_serverKeyInfoMap.get(npcName).clear();
|
||||||
@ -615,11 +642,11 @@ public class ServerManager extends MiniPlugin
|
|||||||
Vector bottomVector = ParseVector(serverGroup.getPortalBottomCornerLocation());
|
Vector bottomVector = ParseVector(serverGroup.getPortalBottomCornerLocation());
|
||||||
Vector topVector = ParseVector(serverGroup.getPortalTopCornerLocation());
|
Vector topVector = ParseVector(serverGroup.getPortalTopCornerLocation());
|
||||||
int blocks = 0;
|
int blocks = 0;
|
||||||
|
|
||||||
while (blocks < 10 && (bottomVector.getBlockX() != topVector.getBlockX() || bottomVector.getBlockZ() != topVector.getBlockZ()))
|
while (blocks < 10 && (bottomVector.getBlockX() != topVector.getBlockX() || bottomVector.getBlockZ() != topVector.getBlockZ()))
|
||||||
{
|
{
|
||||||
_portalToServerKey.put(new Vector(bottomVector.getBlockX(), bottomVector.getBlockY(), bottomVector.getBlockZ()), serverGroup.getPrefix());
|
_portalToServerKey.put(new Vector(bottomVector.getBlockX(), bottomVector.getBlockY(), bottomVector.getBlockZ()), serverGroup.getPrefix());
|
||||||
|
|
||||||
if (bottomVector.getBlockX() != topVector.getBlockX())
|
if (bottomVector.getBlockX() != topVector.getBlockX())
|
||||||
{
|
{
|
||||||
bottomVector.add(new Vector(-(bottomVector.getBlockX() - topVector.getBlockX()) / Math.abs(bottomVector.getBlockX() - topVector.getBlockX()), 0, 0));
|
bottomVector.add(new Vector(-(bottomVector.getBlockX() - topVector.getBlockX()) / Math.abs(bottomVector.getBlockX() - topVector.getBlockX()), 0, 0));
|
||||||
@ -628,10 +655,10 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
bottomVector.add(new Vector(0, 0, -(bottomVector.getBlockZ() - topVector.getBlockZ()) / Math.abs(bottomVector.getBlockZ() - topVector.getBlockZ())));
|
bottomVector.add(new Vector(0, 0, -(bottomVector.getBlockZ() - topVector.getBlockZ()) / Math.abs(bottomVector.getBlockZ() - topVector.getBlockZ())));
|
||||||
}
|
}
|
||||||
|
|
||||||
blocks++;
|
blocks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
_portalToServerKey.put(bottomVector, serverGroup.getPrefix());
|
_portalToServerKey.put(bottomVector, serverGroup.getPrefix());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -640,7 +667,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
System.out.println("ServerManager - Error parsing servergroups : " + e.getMessage());
|
System.out.println("ServerManager - Error parsing servergroups : " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddServerNpc("Event Servers", "EVENT");
|
// AddServerNpc("Event Servers", "EVENT");
|
||||||
// AddServerNpc("Mineplex Player Servers", "MPS");
|
// AddServerNpc("Mineplex Player Servers", "MPS");
|
||||||
|
|
||||||
@ -659,7 +686,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
|
|
||||||
if (!_clientManager.Get(player).hasPermission(Perm.JOIN_FULL) && !_donationManager.Get(player).ownsUnknownSalesPackage(serverType + " ULTRA"))
|
if (!_clientManager.Get(player).hasPermission(Perm.JOIN_FULL) && !_donationManager.Get(player).ownsUnknownSalesPackage(serverType + " ULTRA"))
|
||||||
slots++;
|
slots++;
|
||||||
|
|
||||||
return slots;
|
return slots;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,12 +694,12 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Mixed Arcade");
|
return _serverNpcShopMap.get("Mixed Arcade");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerNpcShop getServerNPCShopByName(String name)
|
public ServerNpcShop getServerNPCShopByName(String name)
|
||||||
{
|
{
|
||||||
for(String shop : _serverNpcShopMap.keySet())
|
for (String shop : _serverNpcShopMap.keySet())
|
||||||
{
|
{
|
||||||
if(shop.equalsIgnoreCase(name))
|
if (shop.equalsIgnoreCase(name))
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get(shop);
|
return _serverNpcShopMap.get(shop);
|
||||||
}
|
}
|
||||||
@ -690,7 +717,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Dominate");
|
return _serverNpcShopMap.get("Dominate");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerNpcShop getCtfShop()
|
public ServerNpcShop getCtfShop()
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Capture the Flag");
|
return _serverNpcShopMap.get("Capture the Flag");
|
||||||
@ -700,7 +727,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("The Bridges");
|
return _serverNpcShopMap.get("The Bridges");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerNpcShop getSurvivalGamesShop()
|
public ServerNpcShop getSurvivalGamesShop()
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Survival Games");
|
return _serverNpcShopMap.get("Survival Games");
|
||||||
@ -725,7 +752,7 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Skyfall");
|
return _serverNpcShopMap.get("Skyfall");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerNpcShop getUHCShop()
|
public ServerNpcShop getUHCShop()
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Ultra Hardcore");
|
return _serverNpcShopMap.get("Ultra Hardcore");
|
||||||
@ -740,22 +767,22 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Mineplex Player Servers");
|
return _serverNpcShopMap.get("Mineplex Player Servers");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerNpcShop getShop(String name)
|
public ServerNpcShop getShop(String name)
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get(name);
|
return _serverNpcShopMap.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector ParseVector(String vectorString)
|
private Vector ParseVector(String vectorString)
|
||||||
{
|
{
|
||||||
Vector vector = new Vector();
|
Vector vector = new Vector();
|
||||||
|
|
||||||
String [] parts = vectorString.trim().split(" ");
|
String[] parts = vectorString.trim().split(" ");
|
||||||
|
|
||||||
vector.setX(Double.parseDouble(parts[0]));
|
vector.setX(Double.parseDouble(parts[0]));
|
||||||
vector.setY(Double.parseDouble(parts[1]));
|
vector.setY(Double.parseDouble(parts[1]));
|
||||||
vector.setZ(Double.parseDouble(parts[2]));
|
vector.setZ(Double.parseDouble(parts[2]));
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,12 +790,12 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _statusManager;
|
return _statusManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShopBase<ServerManager> getCastleAssaultShop()
|
public ShopBase<ServerManager> getCastleAssaultShop()
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Castle Assault");
|
return _serverNpcShopMap.get("Castle Assault");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShopBase<ServerManager> getCastleAssaultTDMShop()
|
public ShopBase<ServerManager> getCastleAssaultTDMShop()
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Castle Assault TDM");
|
return _serverNpcShopMap.get("Castle Assault TDM");
|
||||||
@ -816,12 +843,12 @@ public class ServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Master Builders");
|
return _serverNpcShopMap.get("Master Builders");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClansServerShop getClansShop()
|
public ClansServerShop getClansShop()
|
||||||
{
|
{
|
||||||
return _clansShop;
|
return _clansShop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShopBase<ServerManager> getTypeWarsShop()
|
public ShopBase<ServerManager> getTypeWarsShop()
|
||||||
{
|
{
|
||||||
return _serverNpcShopMap.get("Type Wars");
|
return _serverNpcShopMap.get("Type Wars");
|
||||||
|
Loading…
Reference in New Issue
Block a user