Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Cheese 2015-12-13 21:15:32 +11:00
commit b095fa9efe
90 changed files with 4129 additions and 821 deletions

View File

@ -8,6 +8,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.ServerData"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpcore-4.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.PlayerCache"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Cache"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -5,8 +5,8 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit;
import mineplex.bungee.playerStats.data.IpInfo;
import mineplex.playerCache.PlayerCache;
import mineplex.playerCache.PlayerInfo;
import mineplex.cache.player.PlayerCache;
import mineplex.cache.player.PlayerInfo;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;

View File

@ -9,7 +9,7 @@ import java.sql.Statement;
import java.util.UUID;
import mineplex.bungee.playerStats.data.IpInfo;
import mineplex.playerCache.PlayerInfo;
import mineplex.cache.player.PlayerInfo;
public class PlayerStatsRepository
{

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -12,6 +12,7 @@ import java.util.Map.Entry;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.common.structs.ItemContainer;
@ -1116,4 +1117,12 @@ public class UtilItem
{
return _materials.containsKey(material);
}
public static ItemStack makeUnbreakable(ItemStack i)
{
ItemMeta im = i.getItemMeta();
im.spigot().setUnbreakable(true);
i.setItemMeta(im);
return i;
}
}

View File

@ -13,7 +13,7 @@
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jooq-3.5.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/craftbukkit.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/NoCheatPlus.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.PlayerCache"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Cache"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,12 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -9,6 +9,9 @@ import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import com.google.gson.Gson;
import mineplex.cache.player.PlayerCache;
import mineplex.cache.player.PlayerInfo;
import mineplex.core.MiniPlugin;
import mineplex.core.account.command.TestRank;
import mineplex.core.account.command.UpdateRank;
@ -24,8 +27,6 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.timing.TimingManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.playerCache.PlayerCache;
import mineplex.playerCache.PlayerInfo;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;

View File

@ -770,6 +770,48 @@ public enum Achievement
new String[]{"Get hit by a monster and", "land on the Safe Pad"},
new int[]{1},
AchievementCategory.MONSTER_MAZE),
GLADIATORS_HARDENED_GLADIATOR("Hardened Gladiator", 1000,
new String[]{"Gladiators.Wins"},
new String[]{"Win 50 games of Gladiators"},
new int[]{50},
AchievementCategory.GLADIATORS),
GLADIATORS_BATTLE_BRED("Battle Bred", 1500,
new String[]{"Gladiators.Wins"},
new String[]{"Win 100 games of Gladiators"},
new int[]{100},
AchievementCategory.GLADIATORS),
GLADIATORS_BRAWLER("Brawler", 1000,
new String[]{"Gladiators.Brawler"},
new String[]{"Kill 3 Gladiators", "with your bare hands"},
new int[]{3},
AchievementCategory.GLADIATORS),
// GLADIATORS_UNTOUCHABLE("Untouchable", 1500,
// new String[]{"Gladiators.Untouchable"},
// new String[]{"Kill 10 Gladiators", "without taking any damage"},
// new int[]{10},
// AchievementCategory.GLADIATORS),
// GLADIATORS_FLAWLESS("Flawless", 1000,
// new String[]{"Gladiators.Flawless"},
// new String[]{"Win a game of gladiators", "without taking any damage"},
// new int[]{1},
// AchievementCategory.GLADIATORS),
GLADIATORS_PRECISION("Precision", 800,
new String[]{"Gladiators.Precision"},
new String[]{"Don't miss a single", "arrow in a game of", "Gladiators (Minimum 3)"},
new int[]{1},
AchievementCategory.GLADIATORS),
GLADIATORS_SWIFT_KILL("Swift Kill", 1000,
new String[]{"Gladiators.SwiftKill"},
new String[]{"Earn 15 first bloods", "in Gladiators"},
new int[]{15},
AchievementCategory.GLADIATORS)
;

View File

@ -105,7 +105,7 @@ public enum AchievementCategory
ONE_IN_THE_QUIVER("One in the Quiver", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.BOW, 0, GameCategory.ARCADE, "Slam Shooter Kit"),
Material.BOW, 0, GameCategory.ARCADE, "Ninja Kit"),
SUPER_PAINTBALL("Super Paintball", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
@ -137,7 +137,7 @@ public enum AchievementCategory
MICRO_BATTLE("Micro Battle", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.LAVA, 0, GameCategory.ARCADE, null),
Material.LAVA_BUCKET, 0, GameCategory.ARCADE, null),
BOMB_LOBBERS("Bomb Lobbers", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
@ -150,6 +150,10 @@ public enum AchievementCategory
MONSTER_MAZE("Monster Maze", null,
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED},
Material.ROTTEN_FLESH, 0, GameCategory.ARCADE, "SoonTM"),
GLADIATORS("Gladiators", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.IRON_SWORD, 0, GameCategory.ARCADE, null)
;

View File

@ -1,5 +1,6 @@
package mineplex.core.cosmetic.ui.page;
import mineplex.cache.player.PlayerCache;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
@ -16,7 +17,6 @@ import mineplex.core.pet.repository.token.PetChangeToken;
import mineplex.core.pet.repository.token.PetToken;
import mineplex.core.shop.page.ConfirmationPage;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.playerCache.PlayerCache;
import net.minecraft.server.v1_8_R3.ItemStack;
import net.minecraft.server.v1_8_R3.Items;
@ -64,7 +64,16 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
{
_tagName = ChatColor.stripColor(_tagName);
_tagName = _tagName.replaceAll("[^A-Za-z0-9]", "");
System.out.println("Pet name: " + _tagName + ".");
if (_tagName.length() == 0)
{
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Supplied pet name contains invalid characters."));
playDenySound(getPlayer());
getShop().openPageForPlayer(getPlayer(), new PetPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Pets", getPlayer()));
return;
}
if (_tagName.length() > 16)
{
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));

View File

@ -10,6 +10,8 @@ import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
import com.google.gson.Gson;
import mineplex.cache.player.PlayerCache;
import mineplex.core.MiniDbClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.account.event.ClientWebResponseEvent;
@ -24,7 +26,6 @@ import mineplex.core.donation.repository.token.DonorTokenWrapper;
import mineplex.core.server.util.TransactionResponse;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.playerCache.PlayerCache;
public class DonationManager extends MiniDbClientPlugin<Donor>
{

View File

@ -21,7 +21,7 @@ public class ParticleLegend extends ParticleGadget
{
super(manager, "Legendary Aura", new String[]
{
C.cWhite + "These mystic particle attach to",
C.cWhite + "This mystic particle attaches to",
C.cWhite + "only the most legendary of players!",
" ",
C.cGreen + "Unlocked with Legend Rank",

View File

@ -72,6 +72,8 @@ public enum GameDisplay
BouncyBalls("Bouncy Balls", Material.SLIME_BALL, (byte)0, GameCategory.ARCADE, 57),
Gladiators("Gladiators", Material.IRON_SWORD, (byte)0, GameCategory.ARCADE, 58),
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);
String _name;

View File

@ -17,7 +17,7 @@ public class Ignore extends CommandBase<IgnoreManager>
@Override
public void Execute(final Player caller, final String[] args)
{
if (args == null)
if (args == null || args.length < 1)
{
Plugin.showIgnores(caller);
}

View File

@ -22,6 +22,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.cache.player.PlayerCache;
import mineplex.core.MiniDbClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.Callback;
@ -31,7 +32,6 @@ import mineplex.core.inventory.data.InventoryRepository;
import mineplex.core.inventory.data.Item;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.playerCache.PlayerCache;
public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
{

View File

@ -2,7 +2,9 @@ package mineplex.core.itemstack;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -12,6 +14,7 @@ import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkEffectMeta;
import org.bukkit.inventory.meta.ItemMeta;
@ -19,6 +22,8 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.potion.Potion;
import mineplex.core.common.util.C;
public class ItemBuilder
{
@ -48,20 +53,17 @@ public class ItemBuilder
private final HashMap<Enchantment, Integer> _enchants = new HashMap<Enchantment, Integer>();
private final List<String> _lore = new ArrayList<String>();
private Material _mat;
// private Potion potion;
private String _title = null;
private boolean _unbreakable;
private String _playerHeadName = null;
private HashSet<ItemFlag> _itemFlags = new HashSet<ItemFlag>();
public ItemBuilder(ItemStack item)
{
this(item.getType(), item.getDurability());
_amount = item.getAmount();
_enchants.putAll(item.getEnchantments());
if (item.getType() == Material.POTION)
{
// setPotion(Potion.fromItemStack(item));
}
if (item.hasItemMeta())
{
ItemMeta meta = item.getItemMeta();
@ -81,6 +83,8 @@ public class ItemBuilder
setColor(((LeatherArmorMeta) meta).getColor());
}
_itemFlags.addAll(meta.getItemFlags());
_unbreakable = meta.spigot().isUnbreakable();
}
}
@ -107,13 +111,60 @@ public class ItemBuilder
this(mat, 1, data);
}
public HashSet<ItemFlag> getItemFlags()
{
return _itemFlags;
}
public ItemBuilder addItemFlags(ItemFlag... flags)
{
getItemFlags().addAll(Arrays.asList(flags));
return this;
}
public ItemBuilder setItemFlags(ItemFlag... flags)
{
getItemFlags().clear();
addItemFlags(flags);
return this;
}
public ItemBuilder setItemFlags(Collection<ItemFlag> flags)
{
getItemFlags().clear();
addItemFlags(flags.toArray(new ItemFlag[0]));
return this;
}
public ItemBuilder setHideInfo(boolean hideInfo)
{
if (hideInfo)
{
for (ItemFlag flag : ItemFlag.values())
{
getItemFlags().add(flag);
}
}
else
{
getItemFlags().clear();
}
return this;
}
public ItemBuilder addEnchantment(Enchantment enchant, int level)
{
if (_enchants.containsKey(enchant))
{
_enchants.remove(enchant);
}
_enchants.put(enchant, level);
return this;
}
@ -121,20 +172,31 @@ public class ItemBuilder
{
for (String lore : lores)
{
_lore.add(ChatColor.GRAY + lore);
_lore.add(C.cGray + lore);
}
return this;
}
public ItemBuilder setLore(String... lores)
{
_lore.clear();
_lore.addAll(Arrays.asList(lores));
return this;
}
public ItemBuilder addLore(String lore, int maxLength)
{
_lore.addAll(split(lore, maxLength));
return this;
}
public ItemBuilder addLores(List<String> lores)
{
_lore.addAll(lores);
return this;
}
@ -144,6 +206,7 @@ public class ItemBuilder
{
addLore(lore, maxLength);
}
return this;
}
@ -155,6 +218,7 @@ public class ItemBuilder
public ItemStack build()
{
Material mat = _mat;
if (mat == null)
{
mat = Material.AIR;
@ -164,8 +228,10 @@ public class ItemBuilder
{
Bukkit.getLogger().warning("Air material!");
}
ItemStack item = new ItemStack(mat, _amount, _data);
ItemMeta meta = item.getItemMeta();
if (meta != null)
{
if (_title != null)
@ -189,14 +255,13 @@ public class ItemBuilder
((FireworkEffectMeta) meta).setEffect(FireworkEffect.builder().withColor(_color).build());
}
meta.addItemFlags(getItemFlags().toArray(new ItemFlag[0]));
meta.spigot().setUnbreakable(isUnbreakable());
item.setItemMeta(meta);
}
item.addUnsafeEnchantments(_enchants);
// if (potion != null) {
// potion.apply(item);
// }
return item;
}
@ -263,52 +328,6 @@ public class ItemBuilder
return _enchants.containsKey(enchant);
}
public boolean isItem(ItemStack item)
{
ItemMeta meta = item.getItemMeta();
if (item.getType() != getType())
{
return false;
}
if (!meta.hasDisplayName() && getTitle() != null)
{
return false;
}
if (!meta.getDisplayName().equals(getTitle()))
{
return false;
}
if (!meta.hasLore() && !getLore().isEmpty())
{
return false;
}
if (meta.hasLore())
{
for (String lore : meta.getLore())
{
if (!getLore().contains(lore))
{
return false;
}
}
}
for (Enchantment enchant : item.getEnchantments().keySet())
{
if (!hasEnchantment(enchant))
{
return false;
}
}
return true;
}
public boolean isUnbreakable()
{
return _unbreakable;
@ -317,17 +336,14 @@ public class ItemBuilder
public ItemBuilder setAmount(int amount)
{
_amount = amount;
return this;
}
public ItemBuilder setColor(Color color)
{
/* (!_mat.name().contains("LEATHER_"))
{
throw new IllegalArgumentException("Can only dye leather armor!");
}*/
_color = color;
return this;
}
@ -338,19 +354,10 @@ public class ItemBuilder
return this;
}
public ItemBuilder setPotion(Potion potion)
{
if (_mat != Material.POTION)
{
_mat = Material.POTION;
}
return this;
}
public ItemBuilder setRawTitle(String title)
{
_title = title;
return this;
}
@ -378,24 +385,28 @@ public class ItemBuilder
}
setTitle(title);
return this;
}
public ItemBuilder setType(Material mat)
{
_mat = mat;
return this;
}
public ItemBuilder setUnbreakable(boolean setUnbreakable)
{
_unbreakable = setUnbreakable;
return this;
}
public ItemBuilder setPlayerHead(String playerName)
{
_playerHeadName = playerName;
return this;
}

View File

@ -128,7 +128,6 @@ public class PreferencesRepository extends RepositoryBase
preferences.ClanTips = resultSet.getBoolean(13);
preferences.HubMusic = resultSet.getBoolean(14);
preferences.DisableAds = resultSet.getBoolean(15);
System.out.println("<< " + resultSet.getBoolean(13));
}
return preferences;

View File

@ -0,0 +1,29 @@
package mineplex.core.profileCache;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.ProfileLookupCallback;
public class ProfileCacheLookupCallback implements ProfileLookupCallback
{
private ProfileCacheManager _profileCacheManager;
private ProfileLookupCallback _profileLookupCallback;
public ProfileCacheLookupCallback(ProfileCacheManager profileCacheManager, ProfileLookupCallback profileLookupCallback)
{
_profileCacheManager = profileCacheManager;
_profileLookupCallback = profileLookupCallback;
}
@Override
public void onProfileLookupFailed(GameProfile gameProfile, Exception exception)
{
_profileLookupCallback.onProfileLookupFailed(gameProfile, exception);
}
@Override
public void onProfileLookupSucceeded(GameProfile gameProfile)
{
_profileCacheManager.cacheProfile(gameProfile);
_profileLookupCallback.onProfileLookupSucceeded(gameProfile);
}
}

View File

@ -1,81 +1,134 @@
//package mineplex.core.profileCache;
//
//import java.util.UUID;
//
//import org.bukkit.plugin.java.JavaPlugin;
//import net.minecraft.util.com.google.gson.Gson;
//import net.minecraft.util.com.google.gson.GsonBuilder;
//import net.minecraft.util.com.mojang.authlib.GameProfile;
//import net.minecraft.util.com.mojang.authlib.properties.PropertyMap;
//import net.minecraft.util.com.mojang.authlib.yggdrasil.ProfileCache;
//import net.minecraft.util.com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository;
//import net.minecraft.util.com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
//import net.minecraft.util.com.mojang.authlib.yggdrasil.response.ProfileSearchResultsResponse;
//import net.minecraft.util.com.mojang.util.UUIDTypeAdapter;
//
//import mineplex.core.MiniPlugin;
//import mineplex.serverdata.Region;
//import mineplex.serverdata.redis.RedisDataRepository;
//import mineplex.serverdata.servers.ServerManager;
//
//public class ProfileCacheManager extends MiniPlugin implements ProfileCache
//{
// private RedisDataRepository<ProfileData> _profileRepository;
// private Gson _gson;
//
// public ProfileCacheManager(JavaPlugin plugin)
// {
// super("Profile Cache", plugin);
//
// _profileRepository = new RedisDataRepository<ProfileData>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
// Region.ALL, ProfileData.class, "profileCacheRepo");
//
// GsonBuilder builder = new GsonBuilder();
// builder.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer());
// builder.registerTypeAdapter(UUID.class, new UUIDTypeAdapter());
// builder.registerTypeAdapter(ProfileSearchResultsResponse.class, new net.minecraft.util.com.mojang.authlib.yggdrasil.response.ProfileSearchResultsResponse.Serializer());
// _gson = builder.create();
//
// try
// {
// YggdrasilMinecraftSessionService.setProfileCache(this);
// YggdrasilGameProfileRepository.setProfileCache(this);
// }
// catch (Exception e)
// {
// System.out.println("================================================");
// System.out.println("Failed to load Profile Cache (Skins)");
// System.out.println("Are you using the correct modified Craftbukkit?");
// System.out.println("================================================");
// }
// }
//
//
// @Override
// public GameProfile attemptToLoadProfile(String playerName)
// {
// ProfileData profile = _profileRepository.getElement(playerName.toLowerCase());
//
// if (profile != null)
// {
// PropertyMap propertyMap = _gson.fromJson(profile.getPropertyMap(), PropertyMap.class);
// GameProfile gameProfile = new GameProfile(profile.getUuid(), profile.getPlayerName());
// gameProfile.getProperties().putAll(propertyMap);
//
//// System.out.println("Loaded profile " + playerName + " from repository!");
// return gameProfile;
// }
//
//// System.out.println("Profile Null");
//
// return null;
// }
//
// @Override
// public void cacheProfile(GameProfile profile)
// {
//// System.out.println("Cached profile: " + profile.getName());
// ProfileData data = new ProfileData(profile.getId(), profile.getName(), _gson.toJson(profile.getProperties()));
// _profileRepository.addElement(data, 60 * 60 * 24); // 1 day
// }
//}
package mineplex.core.profileCache;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mojang.authlib.Agent;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.GameProfileRepository;
import com.mojang.authlib.ProfileLookupCallback;
import com.mojang.authlib.properties.PropertyMap;
import com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository;
import com.mojang.authlib.yggdrasil.response.ProfileSearchResultsResponse;
import com.mojang.util.UUIDTypeAdapter;
import mineplex.core.MiniPlugin;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.serverdata.Region;
import mineplex.serverdata.redis.RedisDataRepository;
import mineplex.serverdata.servers.ServerManager;
public class ProfileCacheManager extends MiniPlugin implements GameProfileRepository
{
private YggdrasilGameProfileRepository _mojangProfileRepository;
private RedisDataRepository<ProfileData> _profileRepository;
private Gson _gson;
public ProfileCacheManager(JavaPlugin plugin)
{
super("Profile Cache", plugin);
_profileRepository = new RedisDataRepository<ProfileData>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
Region.ALL, ProfileData.class, "profileCacheRepo");
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer());
builder.registerTypeAdapter(UUID.class, new UUIDTypeAdapter());
builder.registerTypeAdapter(ProfileSearchResultsResponse.class, new com.mojang.authlib.yggdrasil.response.ProfileSearchResultsResponse.Serializer());
_gson = builder.create();
try
{
Field mojangProfileRepo = net.minecraft.server.v1_8_R3.MinecraftServer.class.getDeclaredField("Y");
mojangProfileRepo.setAccessible(true);
_mojangProfileRepository = (YggdrasilGameProfileRepository) mojangProfileRepo.get(((CraftServer)Bukkit.getServer()).getServer());
mojangProfileRepo.set(((CraftServer)Bukkit.getServer()).getServer(), this);
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("================================================");
System.out.println("Failed to load Profile Cache (Skins)");
System.out.println("Are you using the correct modified Craftbukkit?");
System.out.println("================================================");
}
}
public GameProfile attemptToLoadProfile(String playerName)
{
ProfileData profile = _profileRepository.getElement(playerName.toLowerCase());
if (profile != null)
{
PropertyMap propertyMap = _gson.fromJson(profile.getPropertyMap(), PropertyMap.class);
GameProfile gameProfile = new GameProfile(profile.getUuid(), profile.getPlayerName());
gameProfile.getProperties().putAll(propertyMap);
return gameProfile;
}
return null;
}
public void cacheProfile(final GameProfile profile)
{
if (Bukkit.isPrimaryThread())
{
runAsync(new Runnable()
{
public void run()
{
cacheProfileSafely(profile);
}
});
}
else
cacheProfileSafely(profile);
}
@Override
public void findProfilesByNames(String[] profileNames, Agent agent, ProfileLookupCallback profileLookupCallback)
{
List<String> uncachedProfileNames = new ArrayList<>();
for (String profileName : profileNames)
{
GameProfile profile = attemptToLoadProfile(profileName);
if (profile == null)
uncachedProfileNames.add(profileName);
else
profileLookupCallback.onProfileLookupSucceeded(profile);
}
_mojangProfileRepository.findProfilesByNames(uncachedProfileNames.toArray(new String[uncachedProfileNames.size()]), agent, new ProfileCacheLookupCallback(this, profileLookupCallback));
}
@EventHandler
public void clearRepository(UpdateEvent event)
{
if (event.getType() != UpdateType.MIN_10)
return;
_profileRepository.clean();
}
private void cacheProfileSafely(GameProfile profile)
{
ProfileData data = new ProfileData(profile.getId(), profile.getName(), _gson.toJson(profile.getProperties()));
_profileRepository.addElement(data, 60 * 60 * 24); // 1 day
}
}

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.cache.player.PlayerCache;
import mineplex.core.donation.DonationManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.pet.PetManager;
@ -13,7 +14,6 @@ import mineplex.core.pet.repository.token.PetToken;
import mineplex.core.reward.RewardData;
import mineplex.core.reward.RewardRarity;
import mineplex.core.reward.RewardType;
import mineplex.playerCache.PlayerCache;
/**
* Created by shaun on 14-09-18.

View File

@ -9,6 +9,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.cache.player.PlayerCache;
import mineplex.core.MiniDbClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.NautHashMap;
@ -16,7 +17,6 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.stats.command.GiveStatCommand;
import mineplex.core.stats.command.TimeCommand;
import mineplex.core.stats.event.StatChangeEvent;
import mineplex.playerCache.PlayerCache;
public class StatsManager extends MiniDbClientPlugin<PlayerStats>
{

View File

@ -5,12 +5,12 @@ import java.sql.SQLException;
import java.util.List;
import java.util.UUID;
import mineplex.cache.player.PlayerCache;
import mineplex.core.MiniDbClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.task.repository.TaskRepository;
import mineplex.playerCache.PlayerCache;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Database"/>

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -38,6 +38,7 @@ import mineplex.core.pet.PetManager;
import mineplex.core.poll.PollManager;
import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.profileCache.ProfileCacheManager;
import mineplex.core.projectile.ProjectileManager;
import mineplex.core.punish.Punish;
import mineplex.core.recharge.Recharge;
@ -182,6 +183,8 @@ public class Hub extends JavaPlugin implements IRelation
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Knight", classManager.GetClass("Knight"), true);
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Assassin", classManager.GetClass("Assassin"), true);
new ProfileCacheManager(this);
//Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
}

View File

@ -2,6 +2,7 @@ package mineplex.hub.profile.buttons;
import mineplex.core.common.util.C;
import mineplex.core.gui.GuiItem;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.hub.profile.gui.GUIProfile;
@ -17,7 +18,7 @@ public class ButtonPrefs implements GuiItem
private GUIProfile _profile;
private Player _player;
public ButtonPrefs(GUIProfile profile, Player player)
{
_profile = profile;
@ -33,29 +34,27 @@ public class ButtonPrefs implements GuiItem
@Override
public ItemStack getObject()
{
return ItemStackFactory.Instance.CreateStack(Material.REDSTONE_COMPARATOR.getId(), (byte)0, 1,
ChatColor.RESET + C.cYellow + "Preferences",
new String[]
{
"",
C.cWhite + "Set your preferences to your liking",
C.cWhite + "so you can enjoy the game more!",
"",
C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!"
});
return new ItemBuilder(Material.REDSTONE_COMPARATOR).setTitle(C.Reset + C.cYellow + "Preferences").addLore(new String[]
{
"",
C.cWhite + "Set your preferences to your liking",
C.cWhite + "so you can enjoy the game more!",
"",
C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!"
}).build();
}
@Override
public void setup()
public void setup()
{
}
@Override
public void close()
{
}
}

View File

@ -3,7 +3,6 @@ package mineplex.hub.server.ui;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -11,7 +10,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager;
import mineplex.hub.server.ui.button.SelectBHButton;
@ -34,17 +33,18 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
private List<ItemStack> _superSmashCycle = new ArrayList<ItemStack>();
private List<ItemStack> _minigameCycle = new ArrayList<ItemStack>();
private int _ssmIndex;
private int _minigameIndex;
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager,
DonationManager donationManager, String name, Player player)
{
super(plugin, quickShop, clientManager, donationManager, name, player, 47);
createSuperSmashCycle();
createMinigameCycle();
buildPage();
}
@ -52,148 +52,165 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
@Override
protected void buildPage()
{
setItem(0, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "4 Teams get 10 minutes to prepare.",
ChatColor.RESET + "Then the bridges drop, and all hell",
ChatColor.RESET + "breaks loose as you battle to the",
ChatColor.RESET + "death with the other teams.",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
}));
setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Search for chests to find loot and ",
ChatColor.RESET + "fight others to be the last man standing. ",
ChatColor.RESET + "Stay away from the borders!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + ChatColor.RESET + " other players!",
}));
setItem(0, new ItemBuilder(Material.IRON_PICKAXE)
.setTitle(C.Reset + C.Bold + C.cYellow + "The Bridges " + C.cGray + "4 Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "4 Teams get 10 minutes to prepare.",
C.Reset + "Then the bridges drop, and all hell",
C.Reset + "breaks loose as you battle to the",
C.Reset + "death with the other teams.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BR") + C.Reset + " other players!"
}).setHideInfo(true).build());
setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo/Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "16 contenders fight for the right to rule the skies!",
ChatColor.RESET + "Spawn on a sky island and build your path!",
ChatColor.RESET + "Find weapons to take your enemies down!",
ChatColor.RESET + "Way up there, death ever looming if you fall..",
ChatColor.RESET + "Can you fight? Can you live? Can you win Skywars?",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + ChatColor.RESET + " other players!",
}));
setItem(2, new ItemBuilder(Material.DIAMOND_SWORD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Survival Games " + C.cGray + "Solo/Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "Search for chests to find loot and ",
C.Reset + "fight others to be the last man standing. ",
C.Reset + "Stay away from the borders!",
C.Reset + "",
C.Reset + "Join " + C.cGreen
+ (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + C.Reset
+ " other players!"
}).setHideInfo(true).build());
setItem(6, ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "UHC " + C.cGray + "Ultra Hardcore Mode", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Extremely hard team-based survival ",
ChatColor.RESET + "Gather materials and fight your way",
ChatColor.RESET + "to become the last team standing!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("UHC") + ChatColor.RESET + " other players!",
}));
setItem(4, new ItemBuilder(Material.FEATHER)
.setTitle(C.Reset + C.Bold + C.cYellow + "Skywars " + C.cGray + "Solo/Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "16 contenders fight to rule the skies!",
C.Reset + "Spawn on a sky island and build your path!",
C.Reset + "Find weapons to take your enemies down!",
C.Reset + "Up in the skies, death looming if you fall..",
C.Reset + "Win! Fight! Send enemies flying in Skywars!",
C.Reset + "",
C.Reset + "Join " + C.cGreen
+ (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + C.Reset
+ " other players!",
}).setHideInfo(true).build());
setItem(8, ItemStackFactory.Instance.CreateStack(Material.BLAZE_ROD.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Wizards " + C.cGray + "Last Man Standing", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Wield powerful spells to fight",
ChatColor.RESET + "against other players in this",
ChatColor.RESET + "exciting free-for-all brawl!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("WIZ") + ChatColor.RESET + " other players!",
}));
setItem(6, new ItemBuilder(Material.GOLDEN_APPLE)
.setTitle(C.Reset + C.Bold + C.cYellow + "UHC " + C.cGray + "Ultra Hardcore Mode").addLore(new String[]
{
C.Reset + "",
C.Reset + "Extremely hard team-based survival ",
C.Reset + "Gather materials and fight your way",
C.Reset + "to become the last team standing!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("UHC") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(18, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Castle Siege " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Defenders must protect King Sparklez",
ChatColor.RESET + "from the endless waves of Undead",
ChatColor.RESET + "until the sun rises!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("CS") + ChatColor.RESET + " other players!",
}));
setItem(8, new ItemBuilder(Material.BLAZE_ROD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Wizards " + C.cGray + "Last Man Standing").addLore(new String[]
{
C.Reset + "",
C.Reset + "Wield powerful spells to fight",
C.Reset + "against other players in this",
C.Reset + "exciting free-for-all brawl!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("WIZ") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(20, ItemStackFactory.Instance.CreateStack(Material.GRASS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Hide as blocks/animals, upgrade your ",
ChatColor.RESET + "weapon and fight to survive against",
ChatColor.RESET + "the Hunters!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + ChatColor.RESET + " other players!",
}));
setItem(18, new ItemBuilder(Material.DIAMOND_CHESTPLATE)
.setTitle(C.Reset + C.Bold + C.cYellow + "Castle Siege " + C.cGray + "Team Game").addLore(new String[]
{
C.Reset + "",
C.Reset + "Defenders must protect King Sparklez",
C.Reset + "from the endless waves of Undead",
C.Reset + "until the sun rises!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("CS") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(20, new ItemBuilder(Material.GRASS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Block Hunt " + C.cGray + "Cat and Mouse").addLore(new String[]
{
C.Reset + "",
C.Reset + "Hide as blocks/animals, upgrade your ",
C.Reset + "weapon and fight to survive against",
C.Reset + "the Hunters!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BH") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(22, _superSmashCycle.get(_ssmIndex));
setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike " + C.cGray + "Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "One team must defend two bomb sites from",
ChatColor.RESET + "the other team, who are trying to plant a bomb",
ChatColor.RESET + "and blow them up!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("MS") + ChatColor.RESET + " other players!",
}));
setItem(26, ItemStackFactory.Instance.CreateStack(Material.BOOK_AND_QUILL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Draw My Thing " + C.cGray + "Pictionary!", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Players take turns at drawing a random",
ChatColor.RESET + "word. Whoever guesses it within the time",
ChatColor.RESET + "limit gets some points!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DMT") + ChatColor.RESET + " other players!",
}));
setItem(36, ItemStackFactory.Instance.CreateStack(Material.BEACON.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Dominate " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Customize one of five exciting champions",
ChatColor.RESET + "and battle with the opposing team for the",
ChatColor.RESET + "control points on the map.",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DOM") + ChatColor.RESET + " other players!",
}));
setItem(38, ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Team Deathmatch " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Customize one of five exciting champions",
ChatColor.RESET + "and battle with the opposing team to the",
ChatColor.RESET + "last man standing.",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("TDM") + ChatColor.RESET + " other players!",
}));
setItem(40, ItemStackFactory.Instance.CreateStack(Material.WOOD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Master Builders " + C.cGray + "Creative Build", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Players are given a Build Theme and ",
ChatColor.RESET + "must use blocks, monsters and more",
ChatColor.RESET + "to create a masterpiece!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!",
}));
setItem(24, new ItemBuilder(Material.TNT)
.setTitle(C.Reset + C.Bold + C.cYellow + "Mine-Strike " + C.cGray + "Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "One team must defend two bomb sites from",
C.Reset + "the other team, who are trying to plant a bomb",
C.Reset + "and blow them up!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("MS") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(26, new ItemBuilder(Material.BOOK_AND_QUILL)
.setTitle(C.Reset + C.Bold + C.cYellow + "Draw My Thing " + C.cGray + "Pictionary!").addLore(new String[]
{
C.Reset + "",
C.Reset + "Players take turns at drawing a random",
C.Reset + "word. Whoever guesses it within the time",
C.Reset + "limit gets some points!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(36, new ItemBuilder(Material.BEACON).setTitle(C.Reset + C.Bold + C.cYellow + "Dominate " + C.cGray + "Team Game")
.addLore(new String[]
{
C.Reset + "",
C.Reset + "Customize one of five exciting champions",
C.Reset + "and battle with the opposing team for the",
C.Reset + "control points on the map.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DOM") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(38, new ItemBuilder(Material.GOLD_SWORD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Team Deathmatch " + C.cGray + "Team Game").addLore(new String[]
{
C.Reset + "",
C.Reset + "Customize one of five exciting champions",
C.Reset + "and battle with the opposing team to the",
C.Reset + "last man standing.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("TDM") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(40, new ItemBuilder(Material.WOOD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Master Builders " + C.cGray + "Creative Build").addLore(new String[]
{
C.Reset + "",
C.Reset + "Players are given a Build Theme and ",
C.Reset + "must use blocks, monsters and more",
C.Reset + "to create a masterpiece!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BLD") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(42, _minigameCycle.get(_minigameIndex));
setItem(44, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Player Servers " + C.cGray + "Player Hosted Games", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Join your friends in their own ",
ChatColor.RESET + "Mineplex Player Server. You can play",
ChatColor.RESET + "the games you want, when you want.",
ChatColor.RESET + "",
}));
setItem(44, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3)
.addLore(C.Reset + C.Bold + C.cYellow + "Player Servers " + C.cGray + "Player Hosted Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Join your friends in their own ",
C.Reset + "Mineplex Player Server. You can play",
C.Reset + "the games you want, when you want.",
C.Reset + "",
}).setHideInfo(true).build());
getButtonMap().put(0, new SelectBRButton(this));
getButtonMap().put(2, new SelectSGButton(this));
getButtonMap().put(4, new SelectSKYButton(this));
getButtonMap().put(6, new SelectUHCButton(this));
getButtonMap().put(8, new SelectWIZButton(this));
getButtonMap().put(18, new SelectCSButton(this));
getButtonMap().put(20, new SelectBHButton(this));
getButtonMap().put(22, new SelectSSMButton(this));
@ -204,271 +221,280 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
getButtonMap().put(40, new SelectBLDButton(this));
getButtonMap().put(42, new SelectMINButton(this));
getButtonMap().put(44, new SelectPLAYERButton(this));
// getButtonMap().put(44, new SelectBETAButton(this));
// getButtonMap().put(44, new SelectBETAButton(this));
}
@SuppressWarnings("deprecation")
private void createMinigameCycle()
{
int playerCount = getPlugin().getGroupTagPlayerCount("MIN") +
getPlugin().getGroupTagPlayerCount("DR") +
getPlugin().getGroupTagPlayerCount("DE") +
getPlugin().getGroupTagPlayerCount("PB") +
getPlugin().getGroupTagPlayerCount("TF") +
getPlugin().getGroupTagPlayerCount("RUN") +
getPlugin().getGroupTagPlayerCount("SN") +
getPlugin().getGroupTagPlayerCount("DT") +
getPlugin().getGroupTagPlayerCount("SQ") +
getPlugin().getGroupTagPlayerCount("SA") +
getPlugin().getGroupTagPlayerCount("SS") +
getPlugin().getGroupTagPlayerCount("OITQ");
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(98, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(122, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.LEATHER_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BARDING.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(159, (byte)14, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(309, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(319, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
int playerCount = getPlugin().getGroupTagPlayerCount("MIN") + getPlugin().getGroupTagPlayerCount("DR")
+ getPlugin().getGroupTagPlayerCount("DE") + getPlugin().getGroupTagPlayerCount("PB")
+ getPlugin().getGroupTagPlayerCount("TF") + getPlugin().getGroupTagPlayerCount("RUN")
+ getPlugin().getGroupTagPlayerCount("SN") + getPlugin().getGroupTagPlayerCount("DT")
+ getPlugin().getGroupTagPlayerCount("SQ") + getPlugin().getGroupTagPlayerCount("SA")
+ getPlugin().getGroupTagPlayerCount("SS") + getPlugin().getGroupTagPlayerCount("OITQ");
_minigameCycle.add(new ItemBuilder(Material.SMOOTH_BRICK)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + C.Bold + C.cGreen + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.GOLD_BOOTS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + C.Bold + C.cGreen + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.DRAGON_EGG)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + C.Bold + C.cGreen + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.BOW)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + C.Bold + C.cGreen + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.LEATHER_BOOTS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + C.Bold + C.cGreen + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + C.Bold + C.cGreen + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + C.Bold + C.cGreen + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.DIAMOND_BARDING)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + C.Bold + C.cGreen + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.STAINED_CLAY, 1, (byte) 14)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + C.Bold + C.cGreen + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.IRON_BOOTS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + C.Bold + C.cGreen + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.PORK)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + C.Bold + C.cGreen + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
}
private void createSuperSmashCycle()
{
String[] desc = new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Pick from a selection of monsters,",
ChatColor.RESET + "then battle other players to the ",
ChatColor.RESET + "death with your monsters skills!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + ChatColor.RESET + " other players!",
};
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch", desc));
String[] desc = new String[]
{
C.Reset + "",
C.Reset + "Pick from a selection of monsters,",
C.Reset + "then battle other players to the ",
C.Reset + "death with your monsters skills!",
C.Reset + "",
C.Reset + "Join " + C.cGreen
+ (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + C.Reset
+ " other players!",
};
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4)
.setTitle(C.Reset + C.Bold + C.cYellow + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc)
.setHideInfo(true).build());
}
public void Update()
{
_ssmIndex++;
_minigameIndex++;
if (_ssmIndex >= _superSmashCycle.size())
_ssmIndex = 0;
if (_minigameIndex >= _minigameCycle.size())
_minigameIndex = 0;
buildPage();
}
@ -491,12 +517,12 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
getPlugin().getCastleSiegeShop().attemptShopOpen(player);
}
public void OpenBR(Player player)
{
getPlugin().getBridgesShop().attemptShopOpen(player);
}
public void OpenBH(Player player)
{
getPlugin().getBlockHuntShop().attemptShopOpen(player);

View File

@ -15,7 +15,9 @@ import org.bukkit.inventory.meta.SkullMeta;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.donation.DonationManager;
import mineplex.core.game.GameDisplay;
@ -78,17 +80,8 @@ public class ServerNpcPage extends ShopPageInventory<ServerManager, ServerNpcSho
exception.printStackTrace();
}
if (_onMainPage)
{
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() {
@Override
public void onClick(Player player, ClickType clickType) {
getPlugin().selectServer(player, _serverGroupName);
}
});
buildAvailableServerPage(serverList, slotsNeeded);
}
else
@ -108,7 +101,7 @@ public class ServerNpcPage extends ShopPageInventory<ServerManager, ServerNpcSho
ChatColor.RESET + timeLeft + " Remaining...",
ChatColor.RESET + "",
ChatColor.RESET + C.cGreen + "Do you love playing on Mineplex?",
ChatColor.RESET + "If you do, please consider purchasing Ultra or Hero",
ChatColor.RESET + "If you do, please consider purchasing a premium rank",
ChatColor.RESET + "from the store! Money goes towards running servers",
ChatColor.RESET + "and creating exciting new games for everyone!",
ChatColor.RESET + "",
@ -297,15 +290,25 @@ public class ServerNpcPage extends ShopPageInventory<ServerManager, ServerNpcSho
}
}
addButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 64 : yellowCount, false), new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
if(showGreen) {
addButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 64 : yellowCount, false), new IButton()
{
_onMainPage = false;
}
});
@Override
public void onClick(Player player, ClickType clickType)
{
_onMainPage = false;
}
});
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() {
@Override
public void onClick(Player player, ClickType clickType) {
getPlugin().selectServer(player, _serverGroupName);
}
});
}
// Clear empty slots
if (showGreen)
{

View File

@ -18,6 +18,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTime;
import mineplex.core.donation.DonationManager;
import mineplex.core.game.GameDisplay;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
@ -35,11 +36,11 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
private ServerGroup _serverGroup;
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager,
Player player, ServerGroup serverGroup)
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager,
DonationManager donationManager, Player player, ServerGroup serverGroup)
{
super(plugin, shop, clientManager, donationManager, serverGroup.getServerNpcName(), player, 27);
_serverGroup = serverGroup;
buildPage();
@ -49,23 +50,25 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
protected void buildPage()
{
String friendlyName = _serverGroup.getServerNpcName();
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "Teaming in Solo Mode is bannable!",
ChatColor.RESET + "",
ChatColor.RESET + C.cGreen + "Click to Play",
}));
setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 2, ChatColor.RESET + C.cYellow + "Team " + friendlyName, new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + C.cGray + "2 Player Teams",
ChatColor.RESET + "",
ChatColor.RESET + C.cGreen + "Click to Play"
}));
setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Solo " + friendlyName)
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cRed + C.Bold + "WARNING: " + C.Reset + "Teaming in Solo Mode is bannable!",
C.Reset + "",
C.Reset + C.cGreen + "Click to Play",
}).build());
setItem(14, new ItemBuilder(Material.SKULL_ITEM, 2, (byte) 3).setTitle(C.Reset + C.cYellow + "Team " + friendlyName)
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGray + "2 Player Teams",
C.Reset + "",
C.Reset + C.cGreen + "Click to Play"
}).build());
getButtonMap().put(12, new SelectTypeButton(this, false));
getButtonMap().put(14, new SelectTypeButton(this, true));
}
@ -77,14 +80,16 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
}
public void selectServer(Player player, boolean team)
{
{
if (team)
{
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
}
else
{
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
}
}
}

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -134,9 +134,30 @@ public class Flash extends SkillActive
while (curRange <= maxRange)
{
Location newTarget = player.getLocation().add(new Vector(0,0.2,0)).add(player.getLocation().getDirection().multiply(curRange));
if (!UtilBlock.airFoliage(newTarget.getBlock()) ||
!UtilBlock.airFoliage(newTarget.getBlock().getRelative(BlockFace.UP)))
Location aboveTarget = newTarget.getBlock().getRelative(BlockFace.UP).getLocation();
// half-slab
boolean newTargetIsSlab = newTarget.getBlock().getType() == Material.STEP || newTarget.getBlock().getType() == Material.WOOD_STEP;
boolean aboveTargetIsSlab = aboveTarget.getBlock().getType() == Material.STEP || aboveTarget.getBlock().getType() == Material.WOOD_STEP;
boolean newTargetSlabIsBottom = false;
boolean aboveTargetSlabIsBottom = false;
if(newTargetIsSlab && curRange < 0.5)
{
int newTargetData = (int) newTarget.getBlock().getData();
if(newTargetData <= 7) newTargetSlabIsBottom = true;
}
if(aboveTargetIsSlab && curRange < 0.25)
{
int aboveTargetData = (int) aboveTarget.getBlock().getData();
if(aboveTargetData <= 7) aboveTargetSlabIsBottom = true;
}
if ((!newTargetSlabIsBottom && UtilBlock.fullSolid(newTarget.getBlock())) || (!aboveTargetSlabIsBottom && UtilBlock.fullSolid(aboveTarget.getBlock())))
break;
//Progress Forwards

View File

@ -84,6 +84,9 @@ public class ShieldSmash extends SkillActive
if (cur.equals(player))
continue;
if (UtilPlayer.isSpectator(cur))
continue;
if (UtilMath.offset(loc, cur.getLocation()) > 2.5)
continue;

View File

@ -94,13 +94,16 @@ public class FissureData
_loc.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
//Slow
for (Player cur : block.getWorld().getPlayers())
for (Player cur : block.getWorld().getPlayers()) {
if(UtilPlayer.isSpectator(cur)) continue;
if (!cur.equals(_player))
if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5)
{
//Condition
Host.Factory.Condition().Factory().Slow("Fissure", cur, _player, 1 + _level, 1, false, true, true, true);
}
}
}
}
@ -146,7 +149,10 @@ public class FissureData
up.getWorld().playEffect(up.getLocation(), Effect.STEP_SOUND, block.getTypeId());
//Damage
for (Player cur : up.getWorld().getPlayers())
for (Player cur : up.getWorld().getPlayers()) {
if (UtilPlayer.isSpectator(cur))
continue;
if (!cur.equals(_player))
{
//Teleport
@ -172,7 +178,7 @@ public class FissureData
UtilPlayer.message(cur, F.main(Host.GetClassType().name(), F.name(_player.getName()) +" hit you with " + F.skill(Host.GetName(_level)) + "."));
}
}
}
//Next Column
if (_height >= Math.min(3, _handled/2 + 1))
{

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Mineplex.PlayerCache</name>
<name>Mineplex.Cache</name>
<comment></comment>
<projects>
</projects>

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,4 +1,4 @@
package mineplex.playerCache;
package mineplex.cache.player;
import java.util.UUID;

View File

@ -1,4 +1,4 @@
package mineplex.playerCache;
package mineplex.cache.player;
import java.util.UUID;

View File

@ -15,6 +15,7 @@ import mineplex.core.monitor.LagMeter;
import mineplex.core.npc.NpcManager;
import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.profileCache.ProfileCacheManager;
import mineplex.core.punish.Punish;
import mineplex.core.recharge.Recharge;
import mineplex.core.stats.StatsManager;
@ -88,6 +89,8 @@ public class StaffServer extends JavaPlugin
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("377bdea3-badc-448d-81c1-65db43b17ea4"), "Strutt20"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo"));
new ProfileCacheManager(this);
}
}

View File

@ -1,15 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert

View File

@ -45,6 +45,7 @@ import mineplex.core.pet.PetManager;
import mineplex.core.poll.PollManager;
import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.profileCache.ProfileCacheManager;
import mineplex.core.projectile.ProjectileManager;
import mineplex.core.punish.Punish;
import mineplex.core.recharge.Recharge;
@ -160,6 +161,8 @@ public class Arcade extends JavaPlugin
new PacketsInteractionFix(this, packetHandler);
new FoodDupeFix(this);
new ProfileCacheManager(this);
//Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);

View File

@ -26,6 +26,7 @@ import nautilus.game.arcade.game.games.dragons.DragonsTeams;
import nautilus.game.arcade.game.games.draw.Draw;
import nautilus.game.arcade.game.games.event.EventGame;
import nautilus.game.arcade.game.games.evolution.Evolution;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.game.games.gravity.Gravity;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.hideseek.HideSeek;
@ -128,6 +129,7 @@ public enum GameType
SkywarsTeams(TeamSkywars.class, GameDisplay.SkywarsTeams, new GameType[]{GameType.Skywars}, false),
MonsterMaze(MonsterMaze.class, GameDisplay.MonsterMaze),
MonsterLeague(MonsterLeague.class, GameDisplay.MonsterLeague),
Gladiators(Gladiators.class, GameDisplay.Gladiators),
BouncyBalls(BouncyBalls.class, GameDisplay.BouncyBalls),

View File

@ -0,0 +1,39 @@
package nautilus.game.arcade.events;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Created by William (WilliamTiger).
* 10/12/15
*/
public class FirstBloodEvent extends Event
{
private Player player;
public FirstBloodEvent(Player player)
{
this.player = player;
}
public Player getPlayer()
{
return player;
}
private static HandlerList _handlers = new HandlerList();
public static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
}

View File

@ -36,7 +36,6 @@ import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
@ -73,6 +72,7 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.gametutorial.GameTutorial;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
@ -303,6 +303,8 @@ public abstract class Game implements Listener
public boolean DeadBodiesDeath = true;
public int DeadBodiesExpire = -1;
public boolean EnableTutorials = false;
public boolean FixSpawnFacing = true;
private IPacketHandler _useEntityPacketHandler;
@ -1724,21 +1726,6 @@ public abstract class Game implements Listener
}
}
}
@EventHandler
public void debug(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().equals("/debugteams"))
{
for (GameTeam team : GetTeamList())
{
event.getPlayer().sendMessage(team.GetFormattedName());
for (Player player : team.GetPlayers(false))
{
event.getPlayer().sendMessage(player.getName() + ": " + team.IsAlive(player));
}
}
}
}
public void addTutorials(){}
}

View File

@ -14,6 +14,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.visibility.VisibilityManager;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.gametutorial.GameTutorial;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
@ -58,6 +59,8 @@ public class GameTeam
private String _name;
private String _displayName;
private ChatColor _color;
private GameTutorial _tutorial;
private HashMap<Player, PlayerState> _players = new HashMap<Player, PlayerState>();
@ -447,4 +450,15 @@ public class GameTeam
return _places;
}
public GameTutorial getTutorial()
{
return _tutorial;
}
public void setTutorial(GameTutorial tutorial)
{
_tutorial = tutorial;
}
}

View File

@ -0,0 +1,424 @@
package nautilus.game.arcade.game.games.gladiators;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.gladiators.events.PlayerChangeArenaEvent;
/**
* Created by William (WilliamTiger).
* 07/12/15
*/
public class Arena
{
private Gladiators _host;
private ArenaType _colour;
private Location _mid;
private ArrayList<Location> _spawns;
private Arena _parent;
private Arena[] _childs = new Arena[2];
private boolean _isUsed;
private ArrayList<Location> _doorBlocks;
private boolean _isOpenDoor;
private boolean _doBye;
private ArrayList<Player> _pastPlayers;
private ArenaState _state;
private long _stateTime;
private boolean _alertedAlready;
private boolean _alertedAlready2;
private HashMap<Player, ArrayList<ParticleData>> _particles;
public Arena(Gladiators host, Location mid, ArenaType colour)
{
_host = host;
_mid = mid;
_colour = colour;
_spawns = new ArrayList<>();
_parent = null;
_isUsed = false;
_doorBlocks = new ArrayList<>();
_isOpenDoor = false;
_pastPlayers = new ArrayList<>();
_state = ArenaState.EMPTY;
_stateTime = System.currentTimeMillis();
_particles = new HashMap<>();
_doBye = false;
_alertedAlready = false;
_alertedAlready2 = false;
setupSpawns();
}
public boolean isDoBye()
{
return _doBye;
}
public void setDoBye(boolean doBye)
{
_doBye = doBye;
}
public Arena getParent()
{
return _parent;
}
public long getStateTime()
{
return _stateTime;
}
public void setStateTime(long stateTime)
{
_stateTime = stateTime;
}
public void setParent(Arena parent)
{
_parent = parent;
}
public Arena getChildAt(int index)
{
return _childs[index];
}
public Arena[] getChilds()
{
return _childs;
}
public int getCapacity()
{
int cap = _childs.length;
for(Arena child : _childs)
{
if(child != null)
if(child.isUsed()) cap--;
}
return cap;
}
public ArenaState getState()
{
return _state;
}
public void setState(ArenaState state)
{
_state = state;
}
public ArrayList<Location> getDoorBlocks()
{
return _doorBlocks;
}
public void setChild(int index, Arena child)
{
_childs[index] = child;
child.setParent(this);
}
public void getUsageMap(HashMap<Arena, Integer> used)
{
if(isUsed()) used.put(this, getCapacity());
for(Arena child : _childs)
{
if(child != null) child.getUsageMap(used);
}
}
public boolean areChildrenUsed()
{
for(Arena child : _childs)
{
if(child != null)
if(!child.isUsed()) return false;
}
return true;
}
public Arena getUnusedChild()
{
for(Arena child : _childs)
{
if(child != null)
if(!child.isUsed()) return child;
}
return null;
}
public boolean isAlertedAlready()
{
return _alertedAlready;
}
public void setAlertedAlready(boolean alertedAlready)
{
_alertedAlready = alertedAlready;
}
private void setupSpawns()
{
ArrayList<Location> possible = (ArrayList<Location>) _host.WorldData.GetDataLocs("BLACK").clone();
_mid.setY(UtilAlg.findClosest(_mid, possible).getY());
_spawns.add(correctFace(UtilAlg.findClosest(_mid, possible)));
possible.remove(_spawns.get(0));
_spawns.add(correctFace(UtilAlg.findClosest(_mid, possible)));
}
private Location correctFace(Location l)
{
l.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(l, _mid)));
l.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(l, _mid)));
return l;
}
public Gladiators getHost()
{
return _host;
}
public ArenaType getColour()
{
return _colour;
}
public Location getMid()
{
return _mid;
}
public ArrayList<Location> getSpawns()
{
return _spawns;
}
public ArrayList<Location> capacitySpawns()
{
ArrayList<Location> ret = new ArrayList<>();
if (getCapacity() == 0) return ret;
if (getCapacity() == 1)
{
ret.add(_spawns.get(0));
return ret;
}
if (getCapacity() == 2)
{
ret.add(_spawns.get(0));
ret.add(_spawns.get(1));
return ret;
}
return ret;
}
public ArrayList<Player> getPastPlayers()
{
return _pastPlayers;
}
public boolean isUsed()
{
return _isUsed;
}
public void setIsUsed(boolean isUsed)
{
_isUsed = isUsed;
}
public void closeDoor()
{
_host.Manager.getScheduler().scheduleSyncDelayedTask(_host.Manager.getPlugin(), new Runnable()
{
@Override
public void run()
{
for (Location loc : _doorBlocks)
loc.getBlock().setType(Material.OBSIDIAN);
// Lag exploit check
for (Player p : getPastPlayers())
{
Arena closest = _host.getArenaByMid(UtilAlg.findClosest(p.getLocation(), _host.getAllArenaMids()));
if (closest != _host.getPlayerArenas().get(p))
p.teleport(UtilAlg.findClosest(p.getLocation(), getSpawns()));
}
}
}, 5L);
}
public boolean isOpenDoor()
{
return _isOpenDoor;
}
public void openDoor()
{
_isOpenDoor = true;
_host.Manager.getScheduler().scheduleSyncDelayedTask(_host.Manager.getPlugin(), () -> {
for (Location loc : _doorBlocks)
{
loc.getBlock().setType(Material.AIR);
}
}, 5L);
}
public void update()
{
if (getPastPlayers().size() <= 0)
{
setState(ArenaState.EMPTY);
return; // Empty check.
}
if (_state.equals(ArenaState.WAITING))
{
if (_host.getRoundState() != RoundState.FIGHTING)
return;
if (_alertedAlready)
return;
for (Player p : getPastPlayers())
{
UtilTextMiddle.display(C.cAqua + "Please Wait", "The next round will start shortly", 0, 20 * 100, 0, p);
}
_alertedAlready = true;
}
else if (_state.equals(ArenaState.FIGHTING))
{
if (getPastPlayers().size() == 1)
{
openDoor();
setState(ArenaState.RUNNING);
setStateTime(System.currentTimeMillis());
return;
}
if (!UtilTime.elapsed(_stateTime, 60000))
return; // No poison yet.
for (Player p : getPastPlayers())
{
UtilTextBottom.display(C.cRed + C.Bold + "YOU ARE POISONED! KEEP FIGHTING!", p);
_host.Manager.GetDamage().NewDamageEvent(p, null, null, EntityDamageEvent.DamageCause.CUSTOM, 1D, false, true, true, "Health Loss", "Health Loss");
}
}
else if (_state.equals(ArenaState.RUNNING))
{
for (Player p : getPastPlayers())
{
if (_alertedAlready2)
continue;
UtilTextMiddle.display(C.cGreen + "Next Battle", "Follow the particles", 0, 20 * 100, 0, p);
}
_alertedAlready2 = true;
if (UtilTime.elapsed(_stateTime, 15000))
handleSlowMovers();
}
}
public void updateTick()
{
if (_state.equals(ArenaState.RUNNING))
{
for (Player p : getPastPlayers())
showParticles(p);
}
}
private void showParticles(Player p)
{
if (!getPastPlayers().contains(p) || !_state.equals(ArenaState.RUNNING))
{
_particles.remove(p);
return;
}
//New Trails
if (Recharge.Instance.use(p, "Particle Trail", 3000, false, false))
{
if (!_particles.containsKey(p))
_particles.put(p, new ArrayList<ParticleData>());
Location end = UtilAlg.findClosest(_mid, _host.WorldData.GetDataLocs("PINK"));
_particles.get(p).add(new ParticleData(p, end));
}
//Old Trails
if (_particles.containsKey(p) && !_particles.get(p).isEmpty())
{
Iterator<ParticleData> trailIter = _particles.get(p).iterator();
while (trailIter.hasNext())
{
ParticleData data = trailIter.next();
//Returns true if its hit the endpoint
if (data.update())
trailIter.remove();
}
}
}
private void handleSlowMovers()
{
setState(ArenaState.ENDED);
Arena next = _host.getArenaByMid(UtilAlg.findClosest(_mid, _host.getAllArenaMidsOfType(_host.getNextColour(_colour))));
for (Player p : new ArrayList<Player>(_pastPlayers))
{
// TP after 15 seconds of waiting.
p.teleport(UtilAlg.getLocationAwayFromPlayers(next.getSpawns(), _host.GetPlayers(true)).clone());
//p.sendMessage("HANDLE SLOW MOVERS METHOD!");
_host.Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(p, next, this));
closeDoor();
_host.setPlayerArena(p, next);
UtilTextBottom.display("§c§lTELEPORTED! YOU TOOK TOO LONG!", p);
next.setDoBye(true);
}
_pastPlayers.clear(); // Clear out the un-used players.
}
}

View File

@ -0,0 +1,14 @@
package nautilus.game.arcade.game.games.gladiators;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public enum ArenaState
{
EMPTY,
WAITING,
FIGHTING,
RUNNING,
ENDED;
}

View File

@ -0,0 +1,243 @@
package nautilus.game.arcade.game.games.gladiators;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
/**
* Created by William (WilliamTiger).
* 07/12/15
*/
public enum ArenaType
{
RED(1, new Loadout()
{
@Override
public ItemStack getSword()
{
return new ItemStack(Material.DIAMOND_SWORD, 1);
}
@Override
public ItemStack getRod()
{
return new ItemStack(Material.FISHING_ROD, 1);
}
@Override
public ItemStack getBow()
{
return new ItemStack(Material.BOW, 1);
}
@Override
public ItemStack getArrows()
{
return new ItemStack(Material.ARROW, 10);
}
@Override
public ItemStack getHelmet()
{
return new ItemStack(Material.IRON_HELMET, 1);
}
@Override
public ItemStack getChestplate()
{
return new ItemStack(Material.IRON_CHESTPLATE, 1);
}
@Override
public ItemStack getLeggings()
{
return new ItemStack(Material.IRON_LEGGINGS, 1);
}
@Override
public ItemStack getBoots()
{
return new ItemStack(Material.IRON_BOOTS, 1);
}
}),
ORANGE(2, new Loadout()
{
@Override
public ItemStack getSword()
{
return new ItemStack(Material.IRON_SWORD, 1);
}
@Override
public ItemStack getRod()
{
return new ItemStack(Material.FISHING_ROD, 1);
}
@Override
public ItemStack getBow()
{
return new ItemStack(Material.BOW, 1);
}
@Override
public ItemStack getArrows()
{
return new ItemStack(Material.ARROW, 7);
}
@Override
public ItemStack getHelmet()
{
return new ItemStack(Material.CHAINMAIL_HELMET);
}
@Override
public ItemStack getChestplate()
{
return new ItemStack(Material.CHAINMAIL_CHESTPLATE, 1);
}
@Override
public ItemStack getLeggings()
{
return new ItemStack(Material.CHAINMAIL_LEGGINGS, 1);
}
@Override
public ItemStack getBoots()
{
return new ItemStack(Material.CHAINMAIL_BOOTS, 1);
}
}),
YELLOW(4, new Loadout()
{
@Override
public ItemStack getSword()
{
return new ItemStack(Material.STONE_SWORD, 1);
}
@Override
public ItemStack getRod()
{
return new ItemStack(Material.FISHING_ROD, 1);
}
@Override
public ItemStack getBow()
{
return new ItemStack(Material.BOW, 1);
}
@Override
public ItemStack getArrows()
{
return new ItemStack(Material.ARROW, 5);
}
@Override
public ItemStack getHelmet()
{
return new ItemStack(Material.GOLD_HELMET, 1);
}
@Override
public ItemStack getChestplate()
{
return new ItemStack(Material.GOLD_CHESTPLATE, 1);
}
@Override
public ItemStack getLeggings()
{
return new ItemStack(Material.GOLD_LEGGINGS, 1);
}
@Override
public ItemStack getBoots()
{
return new ItemStack(Material.GOLD_BOOTS, 1);
}
}),
GREEN(8, new Loadout()
{
@Override
public ItemStack getSword()
{
return new ItemStack(Material.WOOD_SWORD, 1);
}
@Override
public ItemStack getRod()
{
return new ItemStack(Material.FISHING_ROD, 1);
}
@Override
public ItemStack getBow()
{
return new ItemStack(Material.BOW, 1);
}
@Override
public ItemStack getArrows()
{
return new ItemStack(Material.ARROW, 3);
}
@Override
public ItemStack getHelmet()
{
return new ItemStack(Material.LEATHER_HELMET, 1);
}
@Override
public ItemStack getChestplate()
{
return new ItemStack(Material.LEATHER_CHESTPLATE, 1);
}
@Override
public ItemStack getLeggings()
{
return new ItemStack(Material.LEATHER_LEGGINGS, 1);
}
@Override
public ItemStack getBoots()
{
return new ItemStack(Material.LEATHER_BOOTS, 1);
}
});
private int _endsAt;
private Loadout _loadout;
ArenaType(int endsAt, Loadout loadout)
{
_endsAt = endsAt;
_loadout = loadout;
}
public Loadout getLoadout()
{
return _loadout;
}
public int getEndsAt()
{
return _endsAt;
}
public String getName()
{
return toString().toLowerCase();
}
public boolean furtherOut(ArenaType other)
{
return !(compareTo(other) <= 0);
}
}

View File

@ -0,0 +1,22 @@
package nautilus.game.arcade.game.games.gladiators;
import org.bukkit.inventory.ItemStack;
/**
* Created by William (WilliamTiger).
* 07/12/15
*/
public interface Loadout
{
public ItemStack getSword();
public ItemStack getRod();
public ItemStack getBow();
public ItemStack getArrows();
public ItemStack getHelmet();
public ItemStack getChestplate();
public ItemStack getLeggings();
public ItemStack getBoots();
}

View File

@ -0,0 +1,56 @@
package nautilus.game.arcade.game.games.gladiators;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public class ParticleData
{
public Player Player;
public Location CurrentLocation;
public Vector Velocity;
public Location Target;
public ParticleData(Player player, Location target)
{
Player = player;
Velocity = player.getLocation().getDirection();
if (Velocity.getY() < 0)
Velocity.setY(0);
Velocity.normalize();
CurrentLocation = player.getLocation().add(0, 1, 0);
Target = target;
}
public boolean update()
{
//Turn
Velocity.add(UtilAlg.getTrajectory(CurrentLocation, Target).multiply(0.15));
//Normalize Speed
UtilAlg.Normalize(Velocity);
//Move
CurrentLocation.add(Velocity.clone().multiply(0.5));
//Particle
UtilParticle.PlayParticle(UtilParticle.ParticleType.HAPPY_VILLAGER, CurrentLocation, 0.03f, 0.03f, 0.03f, 0, 3,
UtilParticle.ViewDist.LONG, Player);
//Sound
CurrentLocation.getWorld().playSound(CurrentLocation, Sound.FIZZ, 0.2f, 3f);
return UtilMath.offset(CurrentLocation, Target) < 4;
}
}

View File

@ -0,0 +1,29 @@
package nautilus.game.arcade.game.games.gladiators;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public enum RoundState
{
WAITING("Waiting"),
STARTING_5("Starting in 5s"),
STARTING_4("Starting in 4s"),
STARTING_3("Starting in 3s"),
STARTING_2("Starting in 2s"),
STARTING_1("Starting in 1s"),
STARTED("FIGHT!"),
FIGHTING("Fighting");
private String scoreboardText;
RoundState(String scoreboardText)
{
this.scoreboardText = scoreboardText;
}
public String getScoreboardText()
{
return scoreboardText;
}
}

View File

@ -0,0 +1,53 @@
package nautilus.game.arcade.game.games.gladiators.events;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import nautilus.game.arcade.game.games.gladiators.Arena;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public class PlayerChangeArenaEvent extends Event
{
private static final HandlerList _handlers = new HandlerList();
private Player player;
private Arena to;
private Arena from;
public PlayerChangeArenaEvent(Player player, Arena to, Arena from)
{
this.player = player;
this.to = to;
this.from = from;
}
public Player getPlayer()
{
return player;
}
public Arena getTo()
{
return to;
}
public Arena getFrom()
{
return from;
}
public static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
}

View File

@ -0,0 +1,24 @@
package nautilus.game.arcade.game.games.gladiators.events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Created by William (WilliamTiger).
* 10/12/15
*/
public class RoundStartEvent extends Event
{
private static final HandlerList _handlers = new HandlerList();
public static HandlerList getHandlerList()
{
return _handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
}

View File

@ -0,0 +1,38 @@
package nautilus.game.arcade.game.games.gladiators.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
/**
* Created by William (WilliamTiger).
* 07/12/15
*/
public class KitGladiator extends Kit
{
public KitGladiator(ArcadeManager manager)
{
super(manager, "Gladiator", KitAvailability.Free,
new String[]
{
"At my signal, unleash hell."
},
new Perk[]
{
},
EntityType.ZOMBIE, new ItemStack(Material.IRON_SWORD));
}
@Override
public void GiveItems(Player player)
{
//todo: items based on loadout
}
}

View File

@ -0,0 +1,39 @@
package nautilus.game.arcade.game.games.gladiators.trackers;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.stats.StatTracker;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public class BrawlerTracker extends StatTracker<Gladiators>
{
public BrawlerTracker(Gladiators game)
{
super(game);
}
@EventHandler
public void death(CombatDeathEvent e)
{
if (e.GetLog().GetKiller() == null)
return;
if (Bukkit.getPlayerExact(e.GetLog().GetKiller().GetName()) != null)
{
Player p = Bukkit.getPlayerExact(e.GetLog().GetKiller().GetName());
if (p.getItemInHand() == null)
return;
if (p.getItemInHand().getType().equals(Material.AIR))
addStat(p, "Brawler", 1, false, false);
}
}
}

View File

@ -0,0 +1,63 @@
package nautilus.game.arcade.game.games.gladiators.trackers;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.stats.StatTracker;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public class FlawlessTracker extends StatTracker<Gladiators>
{
private List<String> _noWin;
public FlawlessTracker(Gladiators game)
{
super(game);
_noWin = new ArrayList<>();
}
@EventHandler
public void onDmg(EntityDamageEvent e)
{
if (e.isCancelled())
return;
System.out.println(e.getEventName() + " took damage by " + e.getCause().toString());
if (e.getEntity() instanceof Player)
{
_noWin.add(((Player)e.getEntity()).getName());
}
}
@EventHandler
public void end(GameStateChangeEvent e)
{
if (e.GetState() != Game.GameState.End)
return;
if (getGame().getWinners() == null)
return;
for (Player p : getGame().getWinners())
{
if (_noWin.contains(p.getName()))
continue;
addStat(p, "Flawless", 1, true, false);
}
}
}

View File

@ -0,0 +1,79 @@
package nautilus.game.arcade.game.games.gladiators.trackers;
import java.util.HashMap;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.stats.StatTracker;
/**
* Created by William (WilliamTiger).
* 08/12/15
*/
public class PrecisionTracker extends StatTracker<Gladiators>
{
private HashMap<String, Integer> _shot;
private HashMap<String, Integer> _hit;
public PrecisionTracker(Gladiators game)
{
super(game);
_shot = new HashMap<>();
_hit = new HashMap<>();
}
@EventHandler
public void end(GameStateChangeEvent e)
{
if (e.GetState() != Game.GameState.End)
return;
for (Player p : getGame().getWinners())
{
if (_shot.containsKey(p.getName()) && _hit.containsKey(p.getName()))
{
if (_shot.get(p.getName()) == _hit.get(p.getName()))
{
if (_shot.get(p.getName()) >= 3)
addStat(p, "Precision", 1, true, false);
}
}
}
}
@EventHandler
public void shoot(EntityShootBowEvent e)
{
if (!(e.getEntity() instanceof Player))
return;
Player p = (Player) e.getEntity();
if (_shot.containsKey(p.getName()))
_shot.put(p.getName(), _shot.get(p.getName()) + 1);
else
_shot.put(p.getName(), 1);
}
@EventHandler
public void hit(ProjectileHitEvent e)
{
if (e.getEntity().getShooter() instanceof Player)
{
Player p = (Player) e.getEntity().getShooter();
if (_hit.containsKey(p.getName()))
_hit.put(p.getName(), _hit.get(p.getName()) + 1);
else
_hit.put(p.getName(), 1);
}
}
}

View File

@ -0,0 +1,26 @@
package nautilus.game.arcade.game.games.gladiators.trackers;
import org.bukkit.event.EventHandler;
import nautilus.game.arcade.events.FirstBloodEvent;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.stats.StatTracker;
/**
* Created by William (WilliamTiger).
* 10/12/15
*/
public class SwiftKillTracker extends StatTracker<Gladiators>
{
public SwiftKillTracker(Gladiators game)
{
super(game);
}
@EventHandler
public void blood(FirstBloodEvent e)
{
addStat(e.getPlayer(), "SwiftKill", 1, false, false);
}
}

View File

@ -0,0 +1,55 @@
package nautilus.game.arcade.game.games.gladiators.trackers;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.game.games.gladiators.events.RoundStartEvent;
import nautilus.game.arcade.stats.StatTracker;
/**
* Created by William (WilliamTiger).
* 10/12/15
*/
public class UntouchableTracker extends StatTracker<Gladiators>
{
private List<String> _noWin;
public UntouchableTracker(Gladiators game)
{
super(game);
_noWin = new ArrayList<>();
}
@EventHandler
public void onDmg(EntityDamageEvent e)
{
if (e.isCancelled())
return;
if (e.getEntity() instanceof Player)
{
_noWin.add(((Player)e.getEntity()).getName());
}
}
@EventHandler
public void onEnd(RoundStartEvent e)
{
for (Player p : getGame().GetPlayers(true))
{
if (_noWin.contains(p.getName()))
continue;
addStat(p, "Untouchable", 1, false, false);
}
_noWin.clear();
}
}

View File

@ -0,0 +1,140 @@
package nautilus.game.arcade.game.games.gladiators.tutorial;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.gladiators.Arena;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.gametutorial.GameTutorial;
import nautilus.game.arcade.gametutorial.TutorialPhase;
/**
* Created by William (WilliamTiger).
* 10/12/15
*/
public class TutorialGladiators extends GameTutorial
{
private Gladiators _host;
private Location _pink, _orange;
private Zombie _zombie1, _zombie2;
private boolean hasHit1, hasHit2;
public TutorialGladiators(ArcadeManager manager)
{
super(manager, new TutorialPhase[]{
new TutorialPhaseGladiators()
});
TeleportOnEnd = false;
hasHit1 = false;
hasHit2 = false;
_host = (Gladiators) manager.GetGame();
}
public Location getPink()
{
return _pink;
}
public void setPink(Location pink)
{
_pink = pink;
}
public Location getOrange()
{
return _orange;
}
public void setOrange(Location orange)
{
_orange = orange;
}
public Zombie getZombie1()
{
return _zombie1;
}
public void setZombie1(Zombie zombie1)
{
_zombie1 = zombie1;
}
public Zombie getZombie2()
{
return _zombie2;
}
public void setZombie2(Zombie zombie2)
{
_zombie2 = zombie2;
}
public boolean isHasHit1()
{
return hasHit1;
}
public void setHasHit1(boolean hasHit1)
{
this.hasHit1 = hasHit1;
}
public boolean isHasHit2()
{
return hasHit2;
}
public void setHasHit2(boolean hasHit2)
{
this.hasHit2 = hasHit2;
}
@Override
public void onEnd()
{
Gladiators game = (Gladiators) Manager.GetGame();
for (Player p : game.GetPlayers(true))
{
p.teleport(game.GetTeam(p).GetSpawn().clone());
}
if (_zombie1 != null)
_zombie1.remove();
if (_zombie2 != null)
_zombie2.remove();
Arena gateArena = _host.getArenaByMid(getOrange());
for (Location loc : gateArena.getDoorBlocks())
loc.getBlock().setType(Material.FENCE); // Manual door close.
// Spawns
_host.GetTeamList().get(0).GetSpawns().clear();
for (Arena a : _host.getGameArenaSet())
{
if (a.getCapacity() <= 0)
continue;
for (Location l : a.capacitySpawns())
_host.GetTeamList().get(0).GetSpawns().add(l);
}
for (Player p : _host.GetPlayers(true))
{
_host.GetTeam(p).SpawnTeleport(p);
}
}
}

View File

@ -0,0 +1,26 @@
package nautilus.game.arcade.game.games.gladiators.tutorial;
import nautilus.game.arcade.gametutorial.TutorialPhase;
import nautilus.game.arcade.gametutorial.TutorialText;
/**
* Created by William (WilliamTiger).
* 10/12/15
*/
public class TutorialPhaseGladiators extends TutorialPhase
{
public TutorialPhaseGladiators()
{
super(new TutorialText[]{
new TutorialText("Defeat your opponent!", 20 * 4, 1),
new TutorialText("", 20 * 2, 2),
});
}
@Override
public int ID()
{
return 1;
}
}

View File

@ -358,27 +358,6 @@ public class MonsterMaze extends SoloGame
}
}
private boolean _announced = false;
@EventHandler
public void sendF5Message(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTEST)
return;
if (GetState() != GameState.Prepare)
return;
if (_announced)
return;
if (!UtilTime.elapsed(GetStateTime(), 4000))
return;
_announced = true;
UtilTextMiddle.display(C.cYellow + C.Bold + "Press F5", C.cAqua + C.Bold + "Monster Maze is best in 3rd person!");
Announce(C.cYellow + C.Scramble + "@@" + C.cAqua + C.Bold + " Monster Maze is best played in 3rd Person! (Push F5) " + C.cYellow + C.Scramble + "@@");
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)

View File

@ -61,7 +61,7 @@ public class KitCreeper extends SmashKit
}));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Explosive Leap",
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Explode",
new String[]
{
ChatColor.RESET + "You freeze in location and charge up",

View File

@ -13,10 +13,10 @@ import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -37,10 +37,13 @@ public class PerkEndermanTeleport extends SmashPerk
@EventHandler
public void update(UpdateEvent event)
{
{
if (event.getType() != UpdateType.TICK)
return;
if(!Manager.GetGame().IsLive())
return;
for (Player player : UtilServer.getPlayers())
{
if (!Kit.HasKit(player))
@ -88,7 +91,7 @@ public class PerkEndermanTeleport extends SmashPerk
}
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
player.teleport(block.getLocation().add(0.5, 1, 0.5));
player.teleport(block.getLocation().add(0.5, 1, 0.5).setDirection(player.getLocation().getDirection()));
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0.1f, 100, ViewDist.LONG, UtilServer.getPlayers());

View File

@ -941,7 +941,7 @@ public abstract class SurvivalGames extends Game
for (Player alive : GetPlayers(true))
{
if (alive != player)
if (alive != player && getArcadeManager().canHurt(player, alive))
{
double distance = alive.getLocation().distance(
player.getLocation());
@ -1838,6 +1838,9 @@ public abstract class SurvivalGames extends Game
if (!UtilInv.IsItem(player.getItemInHand(), Material.TNT, (byte) 0))
return;
if(!IsAlive(player))
return;
event.setCancelled(true);

View File

@ -0,0 +1,252 @@
package nautilus.game.arcade.gametutorial;
import java.util.HashMap;
import mineplex.core.common.util.UtilServer;
import mineplex.core.visibility.VisibilityManager;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.gametutorial.events.GameTutorialEndEvent;
import nautilus.game.arcade.gametutorial.events.GameTutorialPhaseEvent;
import nautilus.game.arcade.gametutorial.events.GameTutorialStartEvent;
import org.bukkit.Location;
import org.bukkit.entity.Player;
public abstract class GameTutorial
{
public ArcadeManager Manager;
private TutorialPhase[] _phases;
private GameTeam _team;
private HashMap<Player, Location> _players;
private TutorialPhase _currentPhase;
private boolean _hasEnded;
private boolean _hasStarted;
private int _tick;
private long _started;
public boolean SetTutorialPositions = true;
public boolean TeleportOnEnd = true;
public boolean RunTasksSync = true;
public boolean PlayTutorialSounds = false;
public boolean ShowPrepareTimer = false;
public long TimeBetweenPhase = 0;
public long StartAfterTutorial = 5000;
public GameTutorial(ArcadeManager manager, TutorialPhase[] phases)
{
Manager = manager;
_phases = phases;
_players = new HashMap<>();
}
final public void start()
{
_hasStarted = true;
_tick = 0;
for(TutorialPhase phase : _phases)
phase.setTutorial(this);
//Manager.GetGame().PrepareTime = 60000;
Manager.GetChat().Silence(60000, false);
_started = System.currentTimeMillis();
Manager.getPluginManager().callEvent(new GameTutorialStartEvent(this));
onStart();
preparePlayers();
_currentPhase = getNextPhase();
Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{
nextPhase(true);
}
}, 40);
_currentPhase.teleport();
}
protected void nextPhase(boolean phaseOne)
{
TutorialPhase from = _currentPhase;
if(!phaseOne)
_currentPhase = getNextPhase();
if(_currentPhase == null)
{
onEnd();
_hasEnded = true;
endTutorial();
final GameTutorial tutorial = this;
Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{
Manager.getPluginManager().callEvent(new GameTutorialEndEvent(tutorial));
}
}, 5);
}
else
{
Manager.GetChat().Silence(70000, false);
onPhaseChange(_currentPhase);
Manager.getPluginManager().callEvent(new GameTutorialPhaseEvent(this, from, _currentPhase));
_currentPhase.start(phaseOne);
}
}
public void setTeam(GameTeam team)
{
_team = team;
}
private void endTutorial()
{
for(final Player player : _players.keySet())
{
//VisibilityManager.Instance.setVisibility(player, true, UtilServer.getPlayers());
Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{
for(Player player : Manager.GetGame().GetPlayers(true))
{
for(Player other : Manager.GetGame().GetPlayers(true))
{
player.showPlayer(other);
}
}
player.setAllowFlight(false);
player.setFlying(false);
}
}, 5);
if(TeleportOnEnd)
{
Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{
_team.SpawnTeleport();
}
}, 5);
}
}
Manager.GetChat().Silence(StartAfterTutorial, false);
Manager.GetGame().PrepareTime = (System.currentTimeMillis() - Manager.GetGame().GetStateTime()) + StartAfterTutorial;
}
protected TutorialPhase getNextPhase()
{
for(TutorialPhase phase : _phases)
{
if(_currentPhase == null && phase.ID() == 1)
{
return phase;
}
else if(_currentPhase != null && _currentPhase.ID() + 1 == phase.ID())
{
return phase;
}
}
return null;
}
private void preparePlayers()
{
for(Player player : UtilServer.getPlayers())
{
int i = 0;
if(Manager.GetGame().GetTeam(player) == _team)
{
_players.put(player, Manager.GetGame().GetTeam(player).GetSpawns().get(i));
player.setAllowFlight(true);
player.setFlying(true);
// VisibilityManager.Instance.setVisibility(player, false, UtilServer.getPlayers());
i++;
}
}
}
public TutorialPhase getPhase(int index)
{
for(TutorialPhase phase : _phases)
{
if(phase.ID() == index)
return phase;
}
return null;
}
public boolean hasEnded()
{
return _hasEnded;
}
public boolean hasStarted()
{
return _hasStarted;
}
public HashMap<Player, Location> getPlayers()
{
return _players;
}
public GameTeam getTeam()
{
return _team;
}
public void onTick(int tick){}
public void onStart(){}
public void onPhaseChange(TutorialPhase phase){}
public void onEnd(){}
public int tick()
{
if(!_hasEnded && hasStarted())
{
for(Player player : UtilServer.getPlayers())
{
for(Player other : _players.keySet())
{
player.hidePlayer(other);
}
}
}
_tick++;
return _tick;
}
public TutorialPhase[] getPhases()
{
return _phases;
}
public long getTutorialStart()
{
return _started;
}
public long getRunning()
{
return System.currentTimeMillis() - _started;
}
public long getPhaseTime()
{
return _currentPhase.getPhaseTime();
}
}

View File

@ -0,0 +1,237 @@
package nautilus.game.arcade.gametutorial;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilTextMiddle;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public abstract class TutorialPhase
{
public abstract int ID();
private GameTutorial _tutorial;
private TutorialText[] _text;
private Location _location;
private Location _target;
private boolean _hasEnded;
private long _started;
private TutorialText _currentText;
public TutorialPhase(TutorialText[] text)
{
_text = text;
}
final public void start(boolean phaseOne)
{
_hasEnded = false;
_started = System.currentTimeMillis();
onStart();
if(!phaseOne)
{
teleport();
}
displayText();
}
final public void teleport()
{
if(!getTutorial().SetTutorialPositions)
return;
if(_location != null && _target != null)
{
prepareLocations();
updatePlayers();
}
}
private void prepareLocations()
{
Vector vector = new Vector(_target.getBlockX() - _location.getBlockX(), _target.getBlockY() - _location.getBlockY(), _target.getBlockZ() - _location.getBlockZ());
float pitch = UtilAlg.GetPitch(vector);
float yaw = UtilAlg.GetYaw(vector);
_location.setPitch(pitch);
_location.setYaw(yaw);
}
private void updatePlayers()
{
new Thread(new Runnable()
{
@Override
public void run()
{
while(!_hasEnded && !getTutorial().hasEnded())
{
_tutorial.Manager.runSync(new Runnable()
{
@Override
public void run()
{
if(!_hasEnded && !getTutorial().hasEnded())
{
for(Player player : _tutorial.getPlayers().keySet())
{
player.setAllowFlight(true);
player.setFlying(true);
player.teleport(_location);
}
}
}
});
try
{
Thread.sleep(50);
} catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
}).start();
}
public void displayText()
{
new Thread(new Runnable()
{
@Override
public void run()
{
while(true)
{
TutorialText text = getNextMessage();
if(text == null)
{
_tutorial.Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{
_hasEnded = true;
onEnd();
_tutorial.nextPhase(false);
}
}, getTutorial().TimeBetweenPhase);
break;
}
else
{
Player[] players = new Player[_tutorial.getPlayers().keySet().size()];
int i = 0;
for(Player player : _tutorial.getPlayers().keySet())
{
if(_tutorial.PlayTutorialSounds)
{
if(text.getSound() != null)
player.playSound(player.getLocation(), text.getSound(), 2f, 2f);
}
players[i] = player;
i++;
}
displayMessage(text);
UtilTextMiddle.display("", text.getText(), 0, text.getStayTime(), 0, players);
try
{
Thread.sleep(text.getStayTime() * 50);
} catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
}
}).start();
}
private void displayMessage(final TutorialText text)
{
if(_tutorial.RunTasksSync)
{
_tutorial.Manager.runSync(new Runnable()
{
@Override
public void run()
{
onMessageDisplay(text);
}
});
}
else
{
onMessageDisplay(text);
}
}
protected TutorialText getNextMessage()
{
for(TutorialText text : _text)
{
if(_currentText == null && text.ID() == 1)
{
_currentText = text;
return text;
}
else if(_currentText != null && _currentText.ID() + 1 == text.ID())
{
_currentText = text;
return text;
}
}
return null;
}
public TutorialText[] getText()
{
return _text;
}
public Location getLocation()
{
return _location;
}
public void setTutorial(GameTutorial tutorial)
{
_tutorial = tutorial;
}
public void setLocation(Location location)
{
_location = location;
}
public void setTarget(Location target)
{
_target = target;
}
public GameTutorial getTutorial()
{
return _tutorial;
}
public Location getTarget()
{
return _target;
}
public long getPhaseTime()
{
return _started;
}
public void onStart(){}
public void onMessageDisplay(TutorialText text){}
public void onEnd(){}
}

View File

@ -0,0 +1,62 @@
package nautilus.game.arcade.gametutorial;
import org.bukkit.Sound;
public class TutorialText
{
private String _text;
private int _stayTime;
private int _id;
private Sound _sound;
public TutorialText(String text, int stayTime, int id, Sound sound)
{
_text = text;
_id = id;
_stayTime = stayTime;
_sound = sound;
}
public TutorialText(String text, int id)
{
this(text, (int) (Math.round(1.5 * text.length()) + 25), id, Sound.NOTE_PLING);
}
public TutorialText(String text, int id, Sound sound)
{
this(text, (int) (Math.round(1.5 * text.length()) + 25), id, sound);
}
public TutorialText(String text, int stayTime, int id)
{
this(text, stayTime, id, Sound.NOTE_PLING);
}
public String getText()
{
return _text;
}
public int ID()
{
return _id;
}
public Sound getSound()
{
return _sound;
}
public int getStayTime()
{
return _stayTime;
}
public void setText(String text)
{
_text = text;
}
}

View File

@ -0,0 +1,32 @@
package nautilus.game.arcade.gametutorial.events;
import nautilus.game.arcade.gametutorial.GameTutorial;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class GameTutorialEndEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private GameTutorial _tutorial;
public GameTutorialEndEvent(GameTutorial tutorial)
{
_tutorial = tutorial;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public GameTutorial getTutorial()
{
return _tutorial;
}
}

View File

@ -0,0 +1,49 @@
package nautilus.game.arcade.gametutorial.events;
import nautilus.game.arcade.gametutorial.GameTutorial;
import nautilus.game.arcade.gametutorial.TutorialPhase;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class GameTutorialPhaseEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private GameTutorial _tutorial;
private TutorialPhase _from;
private TutorialPhase _to;
public GameTutorialPhaseEvent(GameTutorial tutorial, TutorialPhase from, TutorialPhase to)
{
_tutorial = tutorial;
_from = from;
_to = to;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public GameTutorial getTutorial()
{
return _tutorial;
}
public TutorialPhase getFrom()
{
return _from;
}
public TutorialPhase getTo()
{
return _to;
}
}

View File

@ -0,0 +1,32 @@
package nautilus.game.arcade.gametutorial.events;
import nautilus.game.arcade.gametutorial.GameTutorial;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class GameTutorialStartEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private GameTutorial _tutorial;
public GameTutorialStartEvent(GameTutorial tutorial)
{
_tutorial = tutorial;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public GameTutorial getTutorial()
{
return _tutorial;
}
}

View File

@ -11,7 +11,7 @@ public class GiveAdminPage extends PlayerPage
{
public GiveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
{
super(plugin, shop, "Give Admin", player);
super(plugin, shop, "Give Co-Host", player);
buildPage();
}
@ -26,12 +26,12 @@ public class GiveAdminPage extends PlayerPage
{
removeButton(slot);
_manager.giveAdmin(player);
UtilPlayer.message(getPlayer(), F.main("Server", "You gave " + F.name(player.getName()) + " admin power."));
UtilPlayer.message(getPlayer(), F.main("Server", "You gave " + F.name(player.getName()) + " Co-Host power."));
}
@Override
public String getDisplayString(Player player)
{
return "Click to Make Admin";
return "Click to Make Co-Host";
}
}

View File

@ -19,7 +19,7 @@ public class RemoveAdminPage extends BasePage
{
public RemoveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
{
super(plugin, shop, "Remove Admin", player);
super(plugin, shop, "Remove Co-Host", player);
buildPage();
}
@ -36,7 +36,7 @@ public class RemoveAdminPage extends BasePage
while (iterator.hasNext())
{
String name = iterator.next();
ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Remove Admin"});
ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Remove Co-Host"});
addButton(slot, head, getRemoveAdminButton(slot, name));
slot++;
@ -52,7 +52,7 @@ public class RemoveAdminPage extends BasePage
{
_manager.removeAdmin(playerName);
removeButton(slot);
UtilPlayer.message(getPlayer(), F.main("Server", "You removed admin power from " + F.name(playerName) + "."));
UtilPlayer.message(getPlayer(), F.main("Server", "You removed Co-Host power from " + F.name(playerName) + "."));
}
};
}

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.kit.perks;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
@ -109,7 +110,9 @@ public class PerkBaconBlast extends Perk implements IThrown
public void Explode(ProjectileUser data)
{
data.GetThrown().getWorld().createExplosion(data.GetThrown().getLocation(), 0.5f);
// for whatever reason, you can't put a location in createExplosion if you don't want it to break blocks >.>
Location loc = data.GetThrown().getLocation();
data.GetThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false);
data.GetThrown().remove();
}
}

View File

@ -53,6 +53,10 @@ public class PerkBladeVortex extends Perk
if (!UtilGear.isWeapon(event.getPlayer().getItemInHand()))
return;
//Dont allow usage in early game
if (!UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000))
return;
final Player player = event.getPlayer();

View File

@ -125,7 +125,7 @@ public class PerkDoubleJump extends Perk
if (!Recharge.Instance.usable(player, "Double Jump"))
continue;
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
if (player.isOnGround() || (UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)) && UtilBlock.solid(player.getLocation().getBlock())))
player.setAllowFlight(true);
}
}

View File

@ -93,7 +93,8 @@ public class PerkFlameDash extends Perk
_data.add(new FireflyData(player));
Manager.GetCondition().Factory().Invisible(GetName(), player, player, 2.5, 0, false, false, true);
Manager.GetCondition().Factory().Cloak(GetName(), player, player, 2.5, false, false);
//Manager.GetCondition().Factory().Invisible(GetName(), player, player, 2.5, 0, false, false, true);
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
}

View File

@ -109,6 +109,8 @@ public class PerkWitchPotion extends SmashPerk
Manager.GetDamage().NewDamageEvent(player, thrower, null,
DamageCause.CUSTOM, 5, true, true, false,
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
Manager.GetCondition().Factory().Slow("Witch Potion", player, null, 3, 1, true, false, false, false);
}
//Super Effect
else
@ -121,6 +123,7 @@ public class PerkWitchPotion extends SmashPerk
DamageCause.CUSTOM, 5 + bonus, true, true, false,
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
Manager.GetCondition().Factory().Slow("Witch Potion", player, null, 7, 2, true, false, false, false);
//Manager.GetCondition().Factory().Confuse(reason, ent, source, duration, mult, extend, showIndicator, ambient)
}
}

View File

@ -16,6 +16,7 @@ import mineplex.serverdata.Utility;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.FirstBloodEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.Game;
@ -77,6 +78,8 @@ public class GameGemManager implements Listener
{
game.AddGems(killer, 10, "First Blood", false, false);
Manager.getPluginManager().callEvent(new FirstBloodEvent(killer));
game.FirstKill = false;
game.Announce(F.main("Game", Manager.GetColor(killer) + killer.getName() + " drew first blood!"));

View File

@ -396,7 +396,7 @@ public class GameHostManager implements Listener
if (!isAdmin(event.getPlayer(), true))
{
event.getPlayer().sendMessage(F.main("Broadcast", "Only MPS admins can use this command."));
event.getPlayer().sendMessage(F.main("Broadcast", "Only Co-Hosts can use this command."));
event.setCancelled(true);
return;
}

View File

@ -34,6 +34,9 @@ import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.uhc.UHC;
import nautilus.game.arcade.gametutorial.GameTutorial;
import nautilus.game.arcade.gametutorial.TutorialPhase;
import nautilus.game.arcade.gametutorial.TutorialText;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -183,6 +186,75 @@ public class GameManager implements Listener
}
}
public boolean isInTutorial(boolean checkForTimer)
{
if (Manager.GetGame() == null || Manager.GetGame().GetState() != GameState.Prepare)
return false;
Game game = Manager.GetGame();
boolean tutorialSet = false;
for(GameTeam team : game.GetTeamList())
{
if(team.getTutorial() != null)
tutorialSet = true;
}
if(!tutorialSet)
{
game.addTutorials();
}
boolean finished = true;
if(game.EnableTutorials)
{
for(Player player : UtilServer.getPlayers())
{
if(player.getWorld() == Manager.GetLobby().GetSpawn().getWorld())
return true;
}
long prepTime = 0;
for(GameTeam team : game.GetTeamList())
{
long timeUsage = 0;
if(team.getTutorial() != null)
{
if(!team.getTutorial().hasStarted())
{
team.getTutorial().setTeam(team);
team.getTutorial().start();
timeUsage = team.getTutorial().StartAfterTutorial;
timeUsage = timeUsage + (team.getTutorial().TimeBetweenPhase * team.getTutorial().getPhases().length);
for(TutorialPhase phase : team.getTutorial().getPhases())
{
for(TutorialText text : phase.getText())
{
timeUsage = timeUsage + (text.getStayTime() * 50);
}
}
}
if(!team.getTutorial().hasEnded())
{
finished = false;
if(checkForTimer)
{
if(team.getTutorial().ShowPrepareTimer)
finished = false;
else
finished = true;
}
}
}
if(prepTime <= timeUsage)
prepTime = timeUsage;
}
if(prepTime > 0)
Manager.GetGame().PrepareTime = prepTime;
if(!finished)
return true;
}
return false;
}
@EventHandler
public void DisplayPrepareTime(UpdateEvent event)
{
@ -193,6 +265,9 @@ public class GameManager implements Listener
return;
Game game = Manager.GetGame();
if(isInTutorial(true))
return;
double percentage = (double) (System.currentTimeMillis() - game.GetStateTime()) / game.PrepareTime;
@ -200,6 +275,35 @@ public class GameManager implements Listener
UtilTextBottom.displayProgress("Game Start", percentage,
UtilTime.MakeStr(Math.max(0, game.PrepareTime - (System.currentTimeMillis() - game.GetStateTime()))), player);
}
@EventHandler
public void updateGameTutorials(UpdateEvent event)
{
if(event.getType() != UpdateType.TICK)
return;
Game game = Manager.GetGame();
if(game == null)
return;
if(game.GetState() != GameState.Prepare)
return;
if(game.EnableTutorials)
{
for(GameTeam team : game.GetTeamList())
{
if(team.getTutorial() != null)
{
if(!team.getTutorial().hasEnded() && team.getTutorial().hasStarted())
{
team.getTutorial().onTick(team.getTutorial().tick());
}
}
}
}
}
@EventHandler
public void StateUpdate(UpdateEvent event)
@ -247,6 +351,9 @@ public class GameManager implements Listener
}
else if (game.GetState() == GameState.Prepare)
{
if(isInTutorial(false))
return;
if (game.CanStartPrepareCountdown())
{
if (UtilTime.elapsed(game.GetStateTime(), game.PrepareTime))

View File

@ -46,6 +46,11 @@ public class DeathBomberStatTracker extends StatTracker<Game>
if (!event.GetLog().GetPlayer().IsPlayer())
return;
Player killed = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
if(killer.equals(killed))
return;
if (event.GetLog().GetKiller() != null && event.GetLog().GetKiller().GetReason().contains("Throwing TNT"))
{