Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
d9d0fc11da
@ -8,14 +8,16 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public enum Rank
|
||||
{
|
||||
LT("LT", ChatColor.DARK_RED),
|
||||
OWNER("Owner", ChatColor.DARK_RED),
|
||||
DEVELOPER("Dev", ChatColor.RED),
|
||||
ADMIN("Admin", ChatColor.RED),
|
||||
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
|
||||
MODERATOR("Mod", ChatColor.GOLD),
|
||||
HELPER("Helper", ChatColor.DARK_AQUA),
|
||||
MAPDEV("Builder", ChatColor.BLUE),
|
||||
HELPER("Trainee", ChatColor.DARK_AQUA),
|
||||
MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
|
||||
MAPDEV("Builder", ChatColor.BLUE),
|
||||
|
||||
|
||||
EVENT("Event", ChatColor.WHITE),
|
||||
|
||||
|
@ -12,7 +12,11 @@ public class FileUtil
|
||||
public static void DeleteFolder(File folder)
|
||||
{
|
||||
if (!folder.exists())
|
||||
{
|
||||
System.out.println("Delete target does not exist: " + folder);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
File[] files = folder.listFiles();
|
||||
|
||||
|
@ -98,8 +98,8 @@ public class UtilTime
|
||||
if (type == TimeUnit.DAYS) text = (num = UtilMath.trim(trim, time / 86400000d)) + " Day";
|
||||
else if (type == TimeUnit.HOURS) text = (num = UtilMath.trim(trim, time / 3600000d)) + " Hour";
|
||||
else if (type == TimeUnit.MINUTES) text = (num = UtilMath.trim(trim, time / 60000d)) + " Minute";
|
||||
else if (type == TimeUnit.SECONDS) text = (num = UtilMath.trim(trim, time / 1000d)) + " Second";
|
||||
else text = (num = UtilMath.trim(trim, time)) + " Millisecond";
|
||||
else if (type == TimeUnit.SECONDS) text = (int) (num = (int) UtilMath.trim(0, time / 1000d)) + " Second";
|
||||
else text = (int) (num = (int) UtilMath.trim(0, time)) + " Millisecond";
|
||||
}
|
||||
|
||||
if (num != 1)
|
||||
|
@ -16,6 +16,9 @@ import mineplex.core.account.event.ClientWebResponseEvent;
|
||||
import mineplex.core.common.CurrencyType;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.donation.command.CoinCommand;
|
||||
import mineplex.core.donation.command.GemCommand;
|
||||
import mineplex.core.donation.command.GoldCommand;
|
||||
import mineplex.core.donation.repository.DonationRepository;
|
||||
import mineplex.core.donation.repository.token.DonorTokenWrapper;
|
||||
import mineplex.core.server.util.TransactionResponse;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.donation;
|
||||
package mineplex.core.donation.command;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -11,6 +11,7 @@ import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UUIDFetcher;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
|
||||
public class CoinCommand extends CommandBase<DonationManager>
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.donation;
|
||||
package mineplex.core.donation.command;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -10,6 +10,7 @@ import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UUIDFetcher;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
|
||||
public class GemCommand extends CommandBase<DonationManager>
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.donation;
|
||||
package mineplex.core.donation.command;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -11,6 +11,7 @@ import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UUIDFetcher;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
|
||||
public class GoldCommand extends CommandBase<DonationManager>
|
||||
{
|
@ -1,9 +1,11 @@
|
||||
package mineplex.core.give;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -43,13 +45,16 @@ public class Give extends MiniPlugin
|
||||
help(player);
|
||||
|
||||
else if (args.length == 1)
|
||||
give(player, player.getName(), args[0], "1");
|
||||
give(player, player.getName(), args[0], "1", "");
|
||||
|
||||
else if (args.length == 2)
|
||||
give(player, args[0], args[1], "1");
|
||||
give(player, args[0], args[1], "1", "");
|
||||
|
||||
else if (args.length == 3)
|
||||
give(player, args[0], args[1], args[2], "");
|
||||
|
||||
else
|
||||
give(player, args[0], args[1], args[2]);
|
||||
give(player, args[0], args[1], args[2], args[3]);
|
||||
}
|
||||
|
||||
public void help(Player player)
|
||||
@ -57,7 +62,7 @@ public class Give extends MiniPlugin
|
||||
UtilPlayer.message(player, F.main("Give", "Commands List;"));
|
||||
}
|
||||
|
||||
public void give(Player player, String target, String itemNames, String amount)
|
||||
public void give(Player player, String target, String itemNames, String amount, String enchants)
|
||||
{
|
||||
//Item
|
||||
LinkedList<Entry<Material, Byte>> itemList = new LinkedList<Entry<Material, Byte>>();
|
||||
@ -97,7 +102,25 @@ public class Give extends MiniPlugin
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Give", "Invalid Amount [" + amount + "]. Defaulting to [1]."));
|
||||
}
|
||||
|
||||
|
||||
//Enchants
|
||||
HashMap<Enchantment, Integer> enchs = new HashMap<Enchantment, Integer>();
|
||||
if (enchants.length() > 0)
|
||||
{
|
||||
for (String cur : enchants.split(","))
|
||||
{
|
||||
try
|
||||
{
|
||||
String[] tokens = cur.split(":");
|
||||
enchs.put(Enchantment.getByName(tokens[0]), Integer.parseInt(tokens[1]));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Give", "Invalid Enchantment [" + cur + "]."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Create
|
||||
String givenList = "";
|
||||
for (Player cur : giveList)
|
||||
@ -110,7 +133,10 @@ public class Give extends MiniPlugin
|
||||
for (Player cur : giveList)
|
||||
{
|
||||
ItemStack stack = ItemStackFactory.Instance.CreateStack(curItem.getKey(), curItem.getValue(), count);
|
||||
|
||||
|
||||
//Enchants
|
||||
stack.addUnsafeEnchantments(enchs);
|
||||
|
||||
//Give
|
||||
if (UtilInv.insert(cur, stack))
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ public class GiveItemCommand extends CommandBase<InventoryManager>
|
||||
{
|
||||
public GiveItemCommand(InventoryManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "giveitem");
|
||||
super(plugin, Rank.ADMIN, "giveitem");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,10 +75,7 @@ public class TimingManager implements Listener
|
||||
{
|
||||
if (_totalList.containsKey(title))
|
||||
{
|
||||
TimeData data = _totalList.get(title);
|
||||
data.addTime();
|
||||
|
||||
_totalList.put(title, data);
|
||||
_totalList.get(title).addTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
|
||||
|
||||
new Field(plugin, creature, _condition, energy, serverName);
|
||||
|
||||
DamageManager damageManager = new DamageManager(plugin, _combatManager, new NpcManager(plugin, creature), disguiseManager);
|
||||
DamageManager damageManager = new DamageManager(plugin, _combatManager, new NpcManager(plugin, creature), disguiseManager, _condition);
|
||||
|
||||
new Weapon(plugin, energy);
|
||||
new Gameplay(plugin, this, blockRestore, damageManager);
|
||||
|
@ -146,7 +146,7 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
ProjectileManager throwManager = new ProjectileManager(this);
|
||||
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
||||
|
||||
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager);
|
||||
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager, conditionManager);
|
||||
Fire fire = new Fire(this, conditionManager, damage);
|
||||
Teleport teleport = new Teleport(this);
|
||||
Energy energy = new Energy(this);
|
||||
|
@ -413,7 +413,7 @@ public class ServerManager extends MiniPlugin
|
||||
public void run(Collection<MinecraftServer> serverStatusList)
|
||||
{
|
||||
_serverPlayerCounts.clear();
|
||||
|
||||
|
||||
for (MinecraftServer serverStatus : serverStatusList)
|
||||
{
|
||||
if (!_serverInfoMap.containsKey(serverStatus.getName()))
|
||||
@ -454,10 +454,10 @@ public class ServerManager extends MiniPlugin
|
||||
if (_serverKeyTagMap.containsKey(tag))
|
||||
{
|
||||
_serverKeyInfoMap.get(_serverKeyTagMap.get(tag)).add(serverInfo);
|
||||
|
||||
|
||||
if (!_serverPlayerCounts.containsKey(tag))
|
||||
_serverPlayerCounts.put(tag, 0);
|
||||
|
||||
|
||||
_serverPlayerCounts.put(tag, _serverPlayerCounts.get(tag) + serverInfo.CurrentPlayers);
|
||||
}
|
||||
}
|
||||
@ -709,6 +709,16 @@ public class ServerManager extends MiniPlugin
|
||||
{
|
||||
return _serverNpcShopMap.get("Block Hunt");
|
||||
}
|
||||
|
||||
public ServerNpcShop getBetaShop()
|
||||
{
|
||||
return _serverNpcShopMap.get("Beta Games");
|
||||
}
|
||||
|
||||
public ServerNpcShop getPlayerGamesShop()
|
||||
{
|
||||
return _serverNpcShopMap.get("Mineplex Player Servers");
|
||||
}
|
||||
|
||||
private Vector ParseVector(String vectorString)
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.hub.server.ServerManager;
|
||||
import mineplex.hub.server.ui.button.SelectBETAButton;
|
||||
import mineplex.hub.server.ui.button.SelectBHButton;
|
||||
import mineplex.hub.server.ui.button.SelectBLDButton;
|
||||
import mineplex.hub.server.ui.button.SelectBRButton;
|
||||
@ -22,6 +23,7 @@ import mineplex.hub.server.ui.button.SelectDMTButton;
|
||||
import mineplex.hub.server.ui.button.SelectDOMButton;
|
||||
import mineplex.hub.server.ui.button.SelectMINButton;
|
||||
import mineplex.hub.server.ui.button.SelectMSButton;
|
||||
import mineplex.hub.server.ui.button.SelectPLAYERButton;
|
||||
import mineplex.hub.server.ui.button.SelectSGButton;
|
||||
import mineplex.hub.server.ui.button.SelectSSMButton;
|
||||
import mineplex.hub.server.ui.button.SelectTDMButton;
|
||||
@ -65,7 +67,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Search for chests to find loot and ",
|
||||
ChatColor.RESET + "fight others to be the last man standing. ",
|
||||
ChatColor.RESET + "Beware of the deep freeze!",
|
||||
ChatColor.RESET + "Stay away from the borders!",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("HG") + ChatColor.RESET + " other players!",
|
||||
}));
|
||||
@ -82,14 +84,14 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
|
||||
setItem(6, _superSmashCycle.get(_ssmIndex));
|
||||
|
||||
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(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(18, 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[]
|
||||
@ -142,7 +144,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + ChatColor.RESET + " other players!",
|
||||
}));
|
||||
|
||||
setItem(36, ItemStackFactory.Instance.CreateStack(Material.WOOD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Master Builders " + C.cGray + "Creative Build", new String[]
|
||||
setItem(37, 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 ",
|
||||
@ -152,7 +154,25 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!",
|
||||
}));
|
||||
|
||||
setItem(44, _minigameCycle.get(_minigameIndex));
|
||||
setItem(39, _minigameCycle.get(_minigameIndex));
|
||||
|
||||
setItem(41, 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(43, ItemStackFactory.Instance.CreateStack(Material.ANVIL.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Beta Games " + C.cGray + "Play Unreleased Games", new String[]
|
||||
{
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Help test and improve our ",
|
||||
ChatColor.RESET + "unreleased games.",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BETA") + ChatColor.RESET + " other players!",
|
||||
}));
|
||||
|
||||
getButtonMap().put(0, new SelectBRButton(this));
|
||||
getButtonMap().put(2, new SelectSGButton(this));
|
||||
@ -165,8 +185,10 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
getButtonMap().put(22, new SelectDOMButton(this));
|
||||
getButtonMap().put(24, new SelectTDMButton(this));
|
||||
getButtonMap().put(26, new SelectBHButton(this));
|
||||
getButtonMap().put(36, new SelectBLDButton(this));
|
||||
getButtonMap().put(44, new SelectMINButton(this));
|
||||
getButtonMap().put(37, new SelectBLDButton(this));
|
||||
getButtonMap().put(39, new SelectMINButton(this));
|
||||
getButtonMap().put(41, new SelectPLAYERButton(this));
|
||||
getButtonMap().put(43, new SelectBETAButton(this));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@ -493,4 +515,14 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
{
|
||||
getPlugin().getBuildShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
public void openBeta(Player player)
|
||||
{
|
||||
getPlugin().getBetaShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
public void openPlayerGames(Player player)
|
||||
{
|
||||
getPlugin().getPlayerGamesShop().attemptShopOpen(player);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package mineplex.hub.server.ui.button;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.hub.server.ui.ServerGameMenu;
|
||||
|
||||
public class SelectBETAButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectBETAButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.openBeta(player);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package mineplex.hub.server.ui.button;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.hub.server.ui.ServerGameMenu;
|
||||
|
||||
public class SelectPLAYERButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectPLAYERButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.openPlayerGames(player);
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ package mineplex.minecraft.game.core.damage;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.F;
|
||||
@ -16,6 +17,7 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||
import mineplex.minecraft.game.core.damage.compatibility.NpcProtectListener;
|
||||
import net.minecraft.server.v1_7_R4.DamageSource;
|
||||
import net.minecraft.server.v1_7_R4.EntityHuman;
|
||||
@ -28,6 +30,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Fish;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -42,24 +45,28 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.sun.jndi.ldap.ManageReferralControl;
|
||||
|
||||
public class DamageManager extends MiniPlugin
|
||||
{
|
||||
private CombatManager _combatManager;
|
||||
private DisguiseManager _disguiseManager;
|
||||
private ConditionManager _conditionManager;
|
||||
protected Field _lastDamageByPlayerTime;
|
||||
protected Method _k;
|
||||
|
||||
public boolean UseSimpleWeaponDamage = false;
|
||||
public boolean DisableDamageChanges = false;
|
||||
|
||||
|
||||
private boolean _enabled = true;
|
||||
|
||||
public DamageManager(JavaPlugin plugin, CombatManager combatManager, NpcManager npcManager, DisguiseManager disguiseManager)
|
||||
|
||||
public DamageManager(JavaPlugin plugin, CombatManager combatManager, NpcManager npcManager, DisguiseManager disguiseManager, ConditionManager conditionManager)
|
||||
{
|
||||
super("Damage Manager", plugin);
|
||||
|
||||
_combatManager = combatManager;
|
||||
_disguiseManager = disguiseManager;
|
||||
_conditionManager = conditionManager;
|
||||
|
||||
try
|
||||
{
|
||||
@ -100,9 +107,9 @@ public class DamageManager extends MiniPlugin
|
||||
//Pre-Event Modifications
|
||||
if (!DisableDamageChanges)
|
||||
WeaponDamage(event, damager);
|
||||
|
||||
|
||||
double damage = event.getDamage();
|
||||
|
||||
|
||||
//Consistent Arrow Damage
|
||||
if (projectile != null && projectile instanceof Arrow)
|
||||
{
|
||||
@ -113,7 +120,7 @@ public class DamageManager extends MiniPlugin
|
||||
NewDamageEvent(damagee, damager, projectile, event.getCause(), damage, true, false, false, null, null, preCancel);
|
||||
|
||||
//System.out.println(UtilEnt.getName(damagee) + " by " + event.getCause() + " at " + UtilWorld.locToStr(damagee.getLocation()));
|
||||
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@ -123,7 +130,7 @@ public class DamageManager extends MiniPlugin
|
||||
if (event.isCancelled())
|
||||
{
|
||||
Projectile projectile = GetProjectile(event);
|
||||
|
||||
|
||||
if (projectile instanceof Arrow)
|
||||
{
|
||||
projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0));
|
||||
@ -191,7 +198,7 @@ public class DamageManager extends MiniPlugin
|
||||
event.SetCancelled("Damagee in Creative");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (UtilPlayer.isSpectator(damagee))
|
||||
{
|
||||
event.SetCancelled("Damagee in Spectator");
|
||||
@ -230,13 +237,80 @@ public class DamageManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void handleEnchants(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
//Defensive
|
||||
Player damagee = event.GetDamageePlayer();
|
||||
if (damagee != null)
|
||||
{
|
||||
for (ItemStack stack : damagee.getInventory().getArmorContents())
|
||||
{
|
||||
if (stack == null)
|
||||
continue;
|
||||
|
||||
Map<Enchantment, Integer> enchants = stack.getEnchantments();
|
||||
for (Enchantment e : enchants.keySet())
|
||||
{
|
||||
if (e.equals(Enchantment.PROTECTION_ENVIRONMENTAL))
|
||||
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
|
||||
|
||||
else if (e.equals(Enchantment.PROTECTION_FIRE) &&
|
||||
event.GetCause() == DamageCause.FIRE &&
|
||||
event.GetCause() == DamageCause.FIRE_TICK &&
|
||||
event.GetCause() == DamageCause.LAVA)
|
||||
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
|
||||
|
||||
else if (e.equals(Enchantment.PROTECTION_FALL) &&
|
||||
event.GetCause() == DamageCause.FALL)
|
||||
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
|
||||
|
||||
else if (e.equals(Enchantment.PROTECTION_EXPLOSIONS) &&
|
||||
event.GetCause() == DamageCause.ENTITY_EXPLOSION)
|
||||
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
|
||||
|
||||
else if (e.equals(Enchantment.PROTECTION_PROJECTILE) &&
|
||||
event.GetCause() == DamageCause.PROJECTILE)
|
||||
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Offensive
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
if (damager != null)
|
||||
{
|
||||
ItemStack stack = damager.getItemInHand();
|
||||
if (stack == null)
|
||||
return;
|
||||
|
||||
Map<Enchantment, Integer> enchants = stack.getEnchantments();
|
||||
for (Enchantment e : enchants.keySet())
|
||||
{
|
||||
if (e.equals(Enchantment.ARROW_KNOCKBACK) || e.equals(Enchantment.KNOCKBACK))
|
||||
event.AddKnockback("Ench Knockback", 1 + (0.5 * (double)enchants.get(e)));
|
||||
|
||||
else if (e.equals(Enchantment.ARROW_DAMAGE))
|
||||
event.AddMod("Enchant", "Ench Damage", 0.5 * (double)enchants.get(e), true);
|
||||
|
||||
else if (e.equals(Enchantment.ARROW_FIRE) || e.equals(Enchantment.FIRE_ASPECT))
|
||||
if (_conditionManager != null)
|
||||
_conditionManager.Factory().Ignite("Ench Fire", event.GetDamageeEntity(), damager,
|
||||
1 * (double)enchants.get(e), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void EndDamageEvent(CustomDamageEvent event)
|
||||
{
|
||||
if (!event.IsCancelled() && event.GetDamage() > 0)
|
||||
{
|
||||
Damage(event);
|
||||
|
||||
|
||||
//DING ARROW
|
||||
if (event.GetProjectile() != null && event.GetProjectile() instanceof Arrow)
|
||||
{
|
||||
@ -247,7 +321,7 @@ public class DamageManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DisplayDamage(event);
|
||||
}
|
||||
|
||||
@ -255,10 +329,10 @@ public class DamageManager extends MiniPlugin
|
||||
{
|
||||
if (event.GetDamageeEntity() == null)
|
||||
return;
|
||||
|
||||
|
||||
if (event.GetDamageeEntity().getHealth() <= 0)
|
||||
return;
|
||||
|
||||
|
||||
//Player Conditions
|
||||
if (event.GetDamageePlayer() != null)
|
||||
{
|
||||
@ -293,29 +367,34 @@ public class DamageManager extends MiniPlugin
|
||||
//Sticky Arrow
|
||||
if (event.GetCause() == DamageCause.PROJECTILE)
|
||||
((CraftLivingEntity)event.GetDamageeEntity()).getHandle().p(((CraftLivingEntity)event.GetDamageeEntity()).getHandle().aZ() + 1);
|
||||
|
||||
|
||||
//Knockback
|
||||
double knockback = event.GetDamage();
|
||||
if (knockback < 2) knockback = 2;
|
||||
knockback = Math.log10(knockback);
|
||||
|
||||
for (double cur : event.GetKnockback().values())
|
||||
knockback = knockback * cur;
|
||||
if (event.IsKnockback() && event.GetDamagerEntity(true) != null)
|
||||
{
|
||||
//Base
|
||||
double knockback = event.GetDamage();
|
||||
if (knockback < 2) knockback = 2;
|
||||
knockback = Math.log10(knockback);
|
||||
|
||||
if (event.IsKnockback())
|
||||
if (event.GetDamagerEntity(true) != null)
|
||||
{
|
||||
Location origin = event.GetDamagerEntity(true).getLocation();
|
||||
if (event.getKnockbackOrigin() != null)
|
||||
origin = event.getKnockbackOrigin();
|
||||
|
||||
Vector trajectory = UtilAlg.getTrajectory2d(origin, event.GetDamageeEntity().getLocation());
|
||||
trajectory.multiply(0.6 * knockback);
|
||||
trajectory.setY(Math.abs(trajectory.getY()));
|
||||
//Mults
|
||||
for (double cur : event.GetKnockback().values())
|
||||
knockback = knockback * cur;
|
||||
|
||||
//Origin
|
||||
Location origin = event.GetDamagerEntity(true).getLocation();
|
||||
if (event.getKnockbackOrigin() != null)
|
||||
origin = event.getKnockbackOrigin();
|
||||
|
||||
//Vec
|
||||
Vector trajectory = UtilAlg.getTrajectory2d(origin, event.GetDamageeEntity().getLocation());
|
||||
trajectory.multiply(0.6 * knockback);
|
||||
trajectory.setY(Math.abs(trajectory.getY()));
|
||||
|
||||
//Apply
|
||||
UtilAction.velocity(event.GetDamageeEntity(),
|
||||
trajectory, 0.2 + trajectory.length() * 0.8, false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
|
||||
}
|
||||
|
||||
UtilAction.velocity(event.GetDamageeEntity(),
|
||||
trajectory, 0.2 + trajectory.length() * 0.8, false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
|
||||
}
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
@ -365,7 +444,7 @@ public class DamageManager extends MiniPlugin
|
||||
{
|
||||
EntityLiving entityDamagee = ((CraftLivingEntity)damagee).getHandle();
|
||||
EntityLiving entityDamager = null;
|
||||
|
||||
|
||||
if (damager != null)
|
||||
entityDamager= ((CraftLivingEntity)damager).getHandle();
|
||||
|
||||
@ -426,7 +505,7 @@ public class DamageManager extends MiniPlugin
|
||||
LivingEntity damagee = event.GetDamageeEntity();
|
||||
if (damagee == null) return;
|
||||
|
||||
|
||||
|
||||
if (_disguiseManager.isDisguised(damagee))
|
||||
{
|
||||
_disguiseManager.getDisguise(damagee).playHurtSound();
|
||||
@ -576,7 +655,7 @@ public class DamageManager extends MiniPlugin
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void SetEnabled(boolean var)
|
||||
{
|
||||
_enabled = var;
|
||||
@ -586,4 +665,9 @@ public class DamageManager extends MiniPlugin
|
||||
{
|
||||
return _combatManager;
|
||||
}
|
||||
|
||||
public void setConditionManager(ConditionManager cm)
|
||||
{
|
||||
_conditionManager = cm;
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class Arcade extends JavaPlugin
|
||||
|
||||
DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler);
|
||||
|
||||
_damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager);
|
||||
_damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager, null);
|
||||
|
||||
Punish punish = new Punish(this, webServerAddress, _clientManager);
|
||||
AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager);
|
||||
|
@ -214,7 +214,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
// Modules
|
||||
_blockRestore = new BlockRestore(plugin);
|
||||
|
||||
|
||||
_blood = blood;
|
||||
_preferencesManager = preferences;
|
||||
|
||||
@ -222,8 +221,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
_explosionManager.SetDebris(false);
|
||||
|
||||
if (serverConfig.GameList.contains(GameType.ChampionsDominate)
|
||||
|| serverConfig.GameList.contains(GameType.ChampionsTDM)
|
||||
|| serverConfig.GameList.contains(GameType.ChampionsMOBA))
|
||||
|| serverConfig.GameList.contains(GameType.ChampionsTDM)
|
||||
|| serverConfig.GameList.contains(GameType.ChampionsMOBA))
|
||||
{
|
||||
_conditionManager = new SkillConditionManager(plugin);
|
||||
}
|
||||
@ -231,7 +230,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
{
|
||||
_conditionManager = new ConditionManager(plugin);
|
||||
}
|
||||
|
||||
|
||||
_clientManager = clientManager;
|
||||
_serverStatusManager = serverStatusManager;
|
||||
_chat = chat;
|
||||
@ -239,7 +238,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
_damageManager = damageManager;
|
||||
_damageManager.UseSimpleWeaponDamage = true;
|
||||
|
||||
_damageManager.setConditionManager(_conditionManager);
|
||||
|
||||
_disguiseManager = disguiseManager;
|
||||
|
||||
_donationManager = donationManager;
|
||||
@ -815,7 +815,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|| _donationManager.Get(event.getPlayer().getName()).OwnsUnknownPackage(_serverConfig.ServerType + " ULTRA"))
|
||||
{
|
||||
|
||||
if (GetGame() != null && (GetGame().GetType() == GameType.UHC || GetGame().GetType() == GameType.Halloween || GetGame().GetType() == GameType.Christmas || GetGame().GetType() == GameType.ChampionsDominate || GetGame().GetType() == GameType.ChampionsTDM || GetGame().GetType() == GameType.MineStrike))
|
||||
if (GetGame() != null && GetGame().DontAllowOverfill)
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes.");
|
||||
return;
|
||||
|
@ -10,7 +10,7 @@ public class YoutubeCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
public YoutubeCommand(ArcadeManager plugin)
|
||||
{
|
||||
super(plugin, Rank.OWNER, new Rank[] {Rank.YOUTUBE}, "youtube");
|
||||
super(plugin, Rank.OWNER, new Rank[] {Rank.YOUTUBE, Rank.TWITCH}, new String[] {"youtube", "twitch"});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -188,6 +188,7 @@ public abstract class Game implements Listener
|
||||
public boolean WorldFireSpread = false;
|
||||
public boolean WorldLeavesDecay = false;
|
||||
public boolean WorldSoilTrample = false;
|
||||
public boolean WorldBoneMeal = false;
|
||||
|
||||
public int HungerSet = -1;
|
||||
public int HealthSet = -1;
|
||||
@ -217,6 +218,8 @@ public abstract class Game implements Listener
|
||||
public boolean GadgetsDisabled = true;
|
||||
|
||||
public boolean TeleportsDisqualify = true;
|
||||
|
||||
public boolean DontAllowOverfill = false;
|
||||
|
||||
//Addons
|
||||
public boolean CompassEnabled = false;
|
||||
|
@ -2,7 +2,6 @@ package nautilus.game.arcade.game.games.build;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
@ -13,6 +12,8 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Hanging;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -41,10 +42,15 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ItemDespawnEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
@ -165,6 +171,9 @@ public class Build extends SoloGame
|
||||
this.CreatureAllow = true;
|
||||
|
||||
this.WorldFireSpread = true;
|
||||
this.WorldBoneMeal = true;
|
||||
|
||||
this.DontAllowOverfill = true;
|
||||
|
||||
UtilServer.getServer().spigot().getConfig().set("view-distance", 4);
|
||||
|
||||
@ -766,6 +775,67 @@ public class Build extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void onHangingPlace(HangingPlaceEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
if (_buildGameState == 0 && IsLive() && IsAlive(player))
|
||||
{
|
||||
BuildData buildData = _data.get(player);
|
||||
|
||||
if (buildData != null)
|
||||
{
|
||||
// Allow placing paintings and item frames in your own plot
|
||||
if (buildData.inBuildArea(event.getBlock())) return;
|
||||
}
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void onHangingBreak(HangingBreakEvent event)
|
||||
{
|
||||
if (event instanceof HangingBreakByEntityEvent)
|
||||
{
|
||||
HangingBreakByEntityEvent ev = ((HangingBreakByEntityEvent) event);
|
||||
if (ev.getRemover() instanceof Player)
|
||||
if (_buildGameState != 0 || !IsAlive(ev.getRemover()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void onDamageHanging(EntityDamageEvent event)
|
||||
{
|
||||
if (!(event.getEntity() instanceof Hanging)) return;
|
||||
|
||||
if (event instanceof EntityDamageByEntityEvent)
|
||||
{
|
||||
EntityDamageByEntityEvent ev = ((EntityDamageByEntityEvent) event);
|
||||
|
||||
if (ev.getDamager() instanceof Player)
|
||||
{
|
||||
Player player = ((Player) ev.getDamager());
|
||||
|
||||
if (_buildGameState != 0 || !IsAlive(player))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
else super.onDamageHanging(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preventRotateHanging(PlayerInteractEntityEvent event)
|
||||
{
|
||||
EntityType type = event.getRightClicked().getType();
|
||||
if (_buildGameState != 0 && (type == EntityType.PAINTING || type == EntityType.ITEM_FRAME))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void potionThrow(ProjectileLaunchEvent event)
|
||||
{
|
||||
@ -1327,7 +1397,7 @@ public class Build extends SoloGame
|
||||
@EventHandler
|
||||
public void openMobGui(PlayerInteractEntityEvent event)
|
||||
{
|
||||
if (!IsLive() || !IsAlive(event.getPlayer())) return;
|
||||
if (!IsLive() || !IsAlive(event.getPlayer()) || _buildGameState != 0) return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
BuildData buildData = _data.get(player);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.build.gui.page;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
|
||||
import org.bukkit.entity.Ageable;
|
||||
@ -7,14 +8,12 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilSkull;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
@ -38,37 +37,18 @@ public class MobPage extends ShopPageBase<ArcadeManager, MobShop>
|
||||
buildPage();
|
||||
}
|
||||
|
||||
private String format(String s)
|
||||
{
|
||||
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
// byte entityData = UtilSkull.getSkullData(_entity);
|
||||
|
||||
// Add Skull delete button
|
||||
final String entityName = _entity.getType().getName();
|
||||
// ShopItem head = new ShopItem(Material.SKULL_ITEM, entityData, entityName, new String[] {C.cGray + "Right Click to Delete Entity" }, 0, false, false);
|
||||
// if (UtilSkull.isPlayerHead(entityData))
|
||||
// {
|
||||
// SkullMeta meta = ((SkullMeta) head.getItemMeta());
|
||||
// meta.setOwner(UtilSkull.getPlayerHeadName(_entity));
|
||||
// head.setItemMeta(meta);
|
||||
// }
|
||||
int buttonSlot = 0;
|
||||
|
||||
// addButton(4, head, new IButton()
|
||||
// {
|
||||
// @Override
|
||||
// public void onClick(Player player, ClickType clickType)
|
||||
// {
|
||||
// if (clickType == ClickType.RIGHT)
|
||||
// {
|
||||
// _buildData.removeEntity(_entity);
|
||||
// UtilPlayer.message(player, F.main("Game", "Entity Deleted"));
|
||||
// player.closeInventory();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
int buttonSlot = 1;
|
||||
// Set Baby
|
||||
if (_entity instanceof Ageable)
|
||||
{
|
||||
final Ageable ageable = ((Ageable) _entity);
|
||||
@ -84,14 +64,14 @@ public class MobPage extends ShopPageBase<ArcadeManager, MobShop>
|
||||
else
|
||||
ageable.setAdult();
|
||||
|
||||
UtilPlayer.message(player, F.main("Game", entityName + " is now a " + (ageable.isAdult() ? "Adult" : "Baby")));
|
||||
UtilPlayer.message(player, F.main("Game", entityName + " is now an " + (ageable.isAdult() ? "Adult" : "Baby")));
|
||||
buildPage();
|
||||
}
|
||||
});
|
||||
|
||||
buttonSlot+= 2;
|
||||
}
|
||||
|
||||
// Enable/Disable Ghosting
|
||||
if (_entity instanceof LivingEntity)
|
||||
{
|
||||
final LivingEntity livingEntity = ((LivingEntity) _entity);
|
||||
@ -108,17 +88,15 @@ public class MobPage extends ShopPageBase<ArcadeManager, MobShop>
|
||||
buildPage();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
buttonSlot += 2;
|
||||
}
|
||||
|
||||
// Increase and Decrease Slime Size
|
||||
if (_entity instanceof Slime)
|
||||
{
|
||||
final Slime slime = ((Slime) _entity);
|
||||
|
||||
ShopItem decreaseSize = new ShopItem(Material.CLAY_BALL, "Decrease Size", null, 0, false, false);
|
||||
|
||||
ShopItem increaseSize = new ShopItem(Material.CLAY, "Increase Size", null, 0, false, false);
|
||||
|
||||
addButton(buttonSlot, decreaseSize, new IButton()
|
||||
@ -136,7 +114,6 @@ public class MobPage extends ShopPageBase<ArcadeManager, MobShop>
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
buttonSlot += 2;
|
||||
|
||||
addButton(buttonSlot, increaseSize, new IButton()
|
||||
@ -154,20 +131,60 @@ public class MobPage extends ShopPageBase<ArcadeManager, MobShop>
|
||||
}
|
||||
}
|
||||
});
|
||||
buttonSlot += 2;
|
||||
}
|
||||
|
||||
// Change Villager Profession
|
||||
if (_entity instanceof Villager)
|
||||
{
|
||||
final Villager villager = ((Villager) _entity);
|
||||
ShopItem shopItem = new ShopItem(Material.DIAMOND_PICKAXE, "Change Profession", new String[] { " ", ChatColor.GRAY + "Currently " + format(villager.getProfession().name()) }, 0, false);
|
||||
addButton(buttonSlot, shopItem, new IButton()
|
||||
{
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
Villager.Profession next =
|
||||
Villager.Profession.values()[(villager.getProfession().ordinal() + 1) % Villager.Profession.values().length];
|
||||
villager.setProfession(next);
|
||||
UtilPlayer.message(player, F.main("Game", "Villager is now a " + format(next.name())));
|
||||
buildPage();
|
||||
}
|
||||
});
|
||||
buttonSlot += 2;
|
||||
}
|
||||
|
||||
// Entity look at player (Currently Bugged)
|
||||
/*
|
||||
if (_entity instanceof LivingEntity)
|
||||
{
|
||||
ShopItem lookAtMe = new ShopItem(Material.GHAST_TEAR, "Look at Me", null, 0, false);
|
||||
addButton(buttonSlot, lookAtMe, new IButton()
|
||||
{
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
Location entityLocation = _entity.getLocation();
|
||||
entityLocation.setDirection(player.getLocation().getDirection().multiply(-1));
|
||||
_entity.teleport(entityLocation);
|
||||
|
||||
UtilPlayer.message(player, F.main("Game", entityName + " is now looking at you"));
|
||||
}
|
||||
});
|
||||
buttonSlot += 2;
|
||||
}
|
||||
*/
|
||||
|
||||
// Delete Entity
|
||||
ShopItem deleteButton = new ShopItem(Material.TNT, "Delete " + entityName, null, 0, false);
|
||||
addButton(8, deleteButton, new IButton()
|
||||
{
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (clickType == ClickType.RIGHT)
|
||||
{
|
||||
_buildData.removeEntity(_entity);
|
||||
UtilPlayer.message(player, F.main("Game", "Entity Deleted"));
|
||||
player.closeInventory();
|
||||
}
|
||||
_buildData.removeEntity(_entity);
|
||||
UtilPlayer.message(player, F.main("Game", "Entity Deleted"));
|
||||
player.closeInventory();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -66,6 +66,8 @@ public class ChampionsDominate extends Domination
|
||||
EloRanking = false;
|
||||
EloStart = 1000;
|
||||
|
||||
this.DontAllowOverfill = true;
|
||||
|
||||
this.DisableKillCommand = false;
|
||||
|
||||
registerStatTrackers(
|
||||
|
@ -65,6 +65,8 @@ public class ChampionsTDM extends TeamDeathmatch
|
||||
InventoryOpenChest = true;
|
||||
|
||||
this.DisableKillCommand = false;
|
||||
|
||||
this.DontAllowOverfill = true;
|
||||
|
||||
registerStatTrackers(
|
||||
new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"),
|
||||
|
@ -78,7 +78,7 @@ import nautilus.game.arcade.managers.GameHostManager;
|
||||
|
||||
public class EventGame extends SoloGame
|
||||
{
|
||||
private GameHostManager _mps;
|
||||
private GameHostManager _mps;
|
||||
|
||||
private String[] _sideText = new String[] {
|
||||
" "," "," "," "," "," "," "," "," "," "," "," "
|
||||
@ -89,7 +89,7 @@ public class EventGame extends SoloGame
|
||||
private NautHashMap<String, Integer> _forcefield = new NautHashMap<String, Integer>();
|
||||
|
||||
private ItemStack[] _kitItems = new ItemStack[6];
|
||||
|
||||
|
||||
private boolean _allowAllGadgets = false;
|
||||
private HashSet<SalesPackageBase> _gadgetWhitelist = new HashSet<SalesPackageBase>();
|
||||
|
||||
@ -176,38 +176,40 @@ public class EventGame extends SoloGame
|
||||
private void commandHelp(Player player)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Event", "Displaying Commands;"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e settings", "View Settings Help"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e tp <Player>", "Teleport to Target"));
|
||||
UtilPlayer.message(player, F.value("/e tp here <Player>", "Teleport Target to Self"));
|
||||
UtilPlayer.message(player, F.value("/e tp here all", "Teleport Everyone to Self"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e gadget", "Toggle Gadgets"));
|
||||
UtilPlayer.message(player, F.value("/e gadget list", "Lists Gadgets (Shows Whitelist)"));
|
||||
UtilPlayer.message(player, F.value("/e gadget <Gadget>", "Toggles Whitelist for Gadget"));
|
||||
UtilPlayer.message(player, F.value("/e gadget clear", "Clears Gadget Whitelist"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e silence [Time]", "Silence Chat"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e admin [Player]", "Toggle Event Admin"));
|
||||
|
||||
UtilPlayer.message(player, F.value("/e gm [Player]", "Toggle Creative Mode"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e radius [Radius]", "Set Forcefield Radius"));
|
||||
|
||||
UtilPlayer.message(player, F.value("/e give <item> <amount>", "Give Item to Self"));
|
||||
UtilPlayer.message(player, F.value("/e give <player> <item> <amount>", "Give Item to Player"));
|
||||
UtilPlayer.message(player, F.value("/e give <item> <amount>", "Give Item"));
|
||||
UtilPlayer.message(player, F.value("/e give <player> <item> <amount> [e:#,e:#...]", "Give Item"));
|
||||
|
||||
UtilPlayer.message(player, F.value("/e doublejump", "Toggles Double Jump"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e scoreboard <Line #> [Text]", "Sets Scoreboard Text"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e mob <type> [#Amount] n[Name] s[Size] [angry] [baby]", ""));
|
||||
UtilPlayer.message(player, F.value("/e mob kill <type>", "Kill Mobs"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e kit set", "Sets Player Kit to your Hotbar"));
|
||||
UtilPlayer.message(player, F.value("/e kit apply", "Gives Kit to Players"));
|
||||
UtilPlayer.message(player, F.value("/e kit clear", "Gives Kit to Players"));
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.value("/e effect <player> <type> <mult> <seconds>", ""));
|
||||
UtilPlayer.message(player, F.value("/e effect <player> clear", ""));
|
||||
}
|
||||
@ -276,6 +278,10 @@ public class EventGame extends SoloGame
|
||||
{
|
||||
commandSilence(event.getPlayer(), args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("admin"))
|
||||
{
|
||||
commandAdmin(event.getPlayer(), args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("gm"))
|
||||
{
|
||||
commandGamemode(event.getPlayer(), args);
|
||||
@ -590,7 +596,7 @@ public class EventGame extends SoloGame
|
||||
|
||||
commandHelpSettings(player);
|
||||
}
|
||||
|
||||
|
||||
private void commandTime(Player player, String[] args)
|
||||
{
|
||||
try
|
||||
@ -680,32 +686,32 @@ public class EventGame extends SoloGame
|
||||
Announce(F.main("Inventory", F.value("Allow All Gadgets", F.ed(_allowAllGadgets))));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.length >= 2 && args[1].equalsIgnoreCase("clear"))
|
||||
{
|
||||
_gadgetWhitelist.clear();
|
||||
Announce(F.main("Inventory", F.value("Gadget Whitelist", "Cleared.")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.length >= 2 && args[1].equalsIgnoreCase("list"))
|
||||
{
|
||||
ChatColor color = ChatColor.AQUA;
|
||||
|
||||
|
||||
//Gadgets
|
||||
for (GadgetType type : GadgetType.values())
|
||||
{
|
||||
String items = C.Bold + type + " Gadgets> ";
|
||||
|
||||
|
||||
for (Gadget gadget : Manager.getCosmeticManager().getGadgetManager().getGadgets(type))
|
||||
{
|
||||
items += color + gadget.GetName().replaceAll(" ", "") + " ";
|
||||
color = (color == ChatColor.AQUA ? ChatColor.DARK_AQUA : ChatColor.AQUA);
|
||||
}
|
||||
|
||||
|
||||
UtilPlayer.message(player, items);
|
||||
}
|
||||
|
||||
|
||||
//Mounts
|
||||
String mounts = C.Bold + "Mount Gadgets> ";
|
||||
for (Mount<?> mount : Manager.getCosmeticManager().getMountManager().getMounts())
|
||||
@ -714,10 +720,10 @@ public class EventGame extends SoloGame
|
||||
color = (color == ChatColor.AQUA ? ChatColor.DARK_AQUA : ChatColor.AQUA);
|
||||
}
|
||||
UtilPlayer.message(player, mounts);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.length >= 2)
|
||||
{
|
||||
//Gadgets
|
||||
@ -737,12 +743,12 @@ public class EventGame extends SoloGame
|
||||
Announce(F.main("Inventory", F.value(gadget.GetName() + " Gadget", F.ed(true))));
|
||||
_gadgetWhitelist.add(gadget);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Mounts
|
||||
for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts())
|
||||
{
|
||||
@ -758,16 +764,16 @@ public class EventGame extends SoloGame
|
||||
Announce(F.main("Inventory", F.value(mount.GetName() + " Gadget", F.ed(true))));
|
||||
_gadgetWhitelist.add(mount);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UtilPlayer.message(player, F.main("Inventory", args[1] + " is not a valid gadget."));
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
commandHelp(player);
|
||||
}
|
||||
|
||||
@ -804,6 +810,28 @@ public class EventGame extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
//Gamemode (Self and Others)
|
||||
private void commandAdmin(Player player, String[] args)
|
||||
{
|
||||
Player target = player;
|
||||
|
||||
if (args.length >= 2)
|
||||
{
|
||||
Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
|
||||
if (newTarget != null)
|
||||
target = newTarget;
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
if (Manager.GetGameHostManager().isAdmin(target, false))
|
||||
Manager.GetGameHostManager().giveAdmin(target);
|
||||
else
|
||||
Manager.GetGameHostManager().removeAdmin(target.getName());
|
||||
|
||||
UtilPlayer.message(player, F.main("Event Admin", target.getName() + " Admin: " + F.tf(Manager.GetGameHostManager().isAdmin(target, false))));
|
||||
}
|
||||
|
||||
//Gamemode (Self and Others)
|
||||
private void commandGamemode(Player player, String[] args)
|
||||
{
|
||||
@ -856,13 +884,13 @@ public class EventGame extends SoloGame
|
||||
private void commandGive(Player player, String[] args)
|
||||
{
|
||||
String[] newArgs = new String[args.length-1];
|
||||
|
||||
|
||||
for (int i=0 ; i<newArgs.length ; i++)
|
||||
newArgs[i] = args[i+1];
|
||||
|
||||
Give.Instance.parseInput(player, newArgs);
|
||||
}
|
||||
|
||||
Give.Instance.parseInput(player, newArgs);
|
||||
}
|
||||
|
||||
//Double Jump
|
||||
private void commandDoubleJump(Player player, String[] args)
|
||||
{
|
||||
@ -1245,44 +1273,44 @@ public class EventGame extends SoloGame
|
||||
|
||||
UtilPlayer.message(caller, F.main("Creature", "Killed " + target + ". " + count + " Removed."));
|
||||
}
|
||||
|
||||
|
||||
private void commandKit(Player caller, String[] args)
|
||||
{
|
||||
if (args.length >= 2 && args[1].equalsIgnoreCase("apply"))
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
giveItems(player);
|
||||
|
||||
|
||||
Announce(F.main("Event Settings", F.value("Player Kit", "Applied to Players")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.length >= 2 && args[1].equalsIgnoreCase("clear"))
|
||||
{
|
||||
_kitItems = new ItemStack[6];
|
||||
Announce(F.main("Event Settings", F.value("Player Kit", "Cleared Kit")));
|
||||
_kitItems = new ItemStack[6];
|
||||
Announce(F.main("Event Settings", F.value("Player Kit", "Cleared Kit")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.length >= 2 && args[1].equalsIgnoreCase("set"))
|
||||
{
|
||||
_kitItems = new ItemStack[6];
|
||||
|
||||
for (int i=0 ; i<6 ; i++)
|
||||
{
|
||||
if (caller.getInventory().getItem(i) != null)
|
||||
_kitItems[i] = caller.getInventory().getItem(i).clone();
|
||||
else
|
||||
_kitItems[i] = null;
|
||||
}
|
||||
|
||||
Announce(F.main("Event Settings", F.value("Player Kit", "Updated Items")));
|
||||
return;
|
||||
_kitItems = new ItemStack[6];
|
||||
|
||||
for (int i=0 ; i<6 ; i++)
|
||||
{
|
||||
if (caller.getInventory().getItem(i) != null)
|
||||
_kitItems[i] = caller.getInventory().getItem(i).clone();
|
||||
else
|
||||
_kitItems[i] = null;
|
||||
}
|
||||
|
||||
Announce(F.main("Event Settings", F.value("Player Kit", "Updated Items")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
commandHelp(caller);
|
||||
}
|
||||
|
||||
|
||||
private void commandEffect(Player caller, String[] args)
|
||||
{
|
||||
//Clear
|
||||
@ -1302,12 +1330,12 @@ public class EventGame extends SoloGame
|
||||
if (targets.isEmpty())
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (Player player : targets)
|
||||
{
|
||||
//Remove all conditions
|
||||
Manager.GetCondition().EndCondition(player, null, null);
|
||||
|
||||
|
||||
//Remove all effects
|
||||
player.removePotionEffect(PotionEffectType.ABSORPTION);
|
||||
player.removePotionEffect(PotionEffectType.BLINDNESS);
|
||||
@ -1333,10 +1361,10 @@ public class EventGame extends SoloGame
|
||||
player.removePotionEffect(PotionEffectType.WEAKNESS);
|
||||
player.removePotionEffect(PotionEffectType.WITHER);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Apply
|
||||
if (args.length >= 5)
|
||||
{
|
||||
@ -1354,7 +1382,7 @@ public class EventGame extends SoloGame
|
||||
if (targets.isEmpty())
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Get Type
|
||||
PotionEffectType type = PotionEffectType.getByName(args[2]);
|
||||
if (type == null)
|
||||
@ -1363,7 +1391,7 @@ public class EventGame extends SoloGame
|
||||
UtilPlayer.message(caller, F.value("Valid Types", "http://minecraft.gamepedia.com/Status_effect"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Get Multiplier
|
||||
int mult = 0;
|
||||
try
|
||||
@ -1380,7 +1408,7 @@ public class EventGame extends SoloGame
|
||||
UtilPlayer.message(caller, F.main("Effect", "Invalid Effect Level: " + args[3]));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Get Duration
|
||||
int dur = 0;
|
||||
try
|
||||
@ -1395,25 +1423,25 @@ public class EventGame extends SoloGame
|
||||
UtilPlayer.message(caller, F.main("Effect", "Invalid Effect Duration: " + args[4]));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Apply
|
||||
PotionEffect effect = new PotionEffect(type, dur*20, mult);
|
||||
for (Player cur : targets)
|
||||
{
|
||||
cur.addPotionEffect(effect);
|
||||
}
|
||||
|
||||
|
||||
if (args[1].equalsIgnoreCase("all"))
|
||||
Announce(F.main("Effect", F.value("Applied Effect", type.getName() + " " + (mult+1) + " for " + dur + "s")));
|
||||
else
|
||||
UtilPlayer.message(caller, F.main("Effect", "Applied " + type.getName() + " " + (mult+1) + " for " + dur + "s for Targets."));
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
commandHelp(caller);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void doubleJumpTrigger(PlayerToggleFlightEvent event)
|
||||
{
|
||||
@ -1500,7 +1528,7 @@ public class EventGame extends SoloGame
|
||||
|
||||
if (_mps.isAdmin(other, false))
|
||||
continue;
|
||||
|
||||
|
||||
int range = _forcefield.get(player.getName());
|
||||
|
||||
if (UtilMath.offset(other, player) > range)
|
||||
@ -1613,10 +1641,10 @@ public class EventGame extends SoloGame
|
||||
{
|
||||
if (_kitItems[i] == null)
|
||||
continue;
|
||||
|
||||
|
||||
player.getInventory().addItem(_kitItems[i].clone());
|
||||
}
|
||||
|
||||
|
||||
UtilInv.Update(player);
|
||||
}
|
||||
|
||||
@ -1626,13 +1654,13 @@ public class EventGame extends SoloGame
|
||||
if (event.getSpawnReason() != SpawnReason.CUSTOM)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void gadgetDisable(GadgetActivateEvent event)
|
||||
{
|
||||
if (_allowAllGadgets)
|
||||
return;
|
||||
|
||||
|
||||
if (!_gadgetWhitelist.contains(event.getGadget()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
@ -1640,13 +1668,13 @@ public class EventGame extends SoloGame
|
||||
//event.getPlayer().closeInventory();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void mountDisable(MountActivateEvent event)
|
||||
{
|
||||
if (_allowAllGadgets)
|
||||
return;
|
||||
|
||||
|
||||
if (!_gadgetWhitelist.contains(event.getMount()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
@ -1654,7 +1682,7 @@ public class EventGame extends SoloGame
|
||||
//event.getPlayer().closeInventory();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void entityDeathEvent(EntityDeathEvent event)
|
||||
{
|
||||
|
@ -120,6 +120,8 @@ public class Halloween extends SoloGame
|
||||
//this.HungerSet = 20;
|
||||
|
||||
this.WorldBoundaryKill = false;
|
||||
|
||||
this.DontAllowOverfill = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -262,6 +262,8 @@ public class MineStrike extends TeamGame
|
||||
this.JoinInProgress = true;
|
||||
|
||||
this.VersionRequire1_8 = true;
|
||||
|
||||
this.DontAllowOverfill = true;
|
||||
|
||||
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("HP", "dummy");
|
||||
_scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
||||
|
@ -15,11 +15,13 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
@ -46,6 +48,8 @@ public class SnowFight extends TeamGame
|
||||
{
|
||||
"Just like... kill your enemies. with snow."
|
||||
});
|
||||
|
||||
this.HungerSet = 20;
|
||||
}
|
||||
|
||||
|
||||
@ -80,11 +84,12 @@ public class SnowFight extends TeamGame
|
||||
if (!IsSnow(event.getBlock()))
|
||||
return;
|
||||
|
||||
if (player.getInventory().getHeldItemSlot() != 0)
|
||||
|
||||
if (UtilInv.contains(player, Material.SNOW_BALL, (byte)0, 16))
|
||||
return;
|
||||
|
||||
//Item
|
||||
SnowballCount(player, 1);
|
||||
UtilInv.insert(player, new ItemStack(Material.SNOW_BALL));
|
||||
|
||||
//Snow Height
|
||||
SnowDecrease(event.getBlock(), 1);
|
||||
@ -93,83 +98,83 @@ public class SnowFight extends TeamGame
|
||||
event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, 80);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void InteractSnowball(PlayerInteractEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
// @EventHandler
|
||||
// public void InteractSnowball(PlayerInteractEvent event)
|
||||
// {
|
||||
// Player player = event.getPlayer();
|
||||
//
|
||||
// if (!IsLive())
|
||||
// return;
|
||||
//
|
||||
// if (!IsPlaying(player))
|
||||
// return;
|
||||
//
|
||||
// if (!UtilGear.isMat(player.getItemInHand(), Material.SNOW_BALL))
|
||||
// return;
|
||||
//
|
||||
// event.setCancelled(true);
|
||||
//
|
||||
// if (UtilEvent.isAction(event, ActionType.L))
|
||||
// SnowballThrow(player);
|
||||
//
|
||||
// else if (UtilEvent.isAction(event, ActionType.R_BLOCK))
|
||||
// SnowballPlace(player, event.getClickedBlock(), 1);
|
||||
// }
|
||||
//
|
||||
// private void SnowballPlace(Player player, Block block, int above)
|
||||
// {
|
||||
// if (block.getTypeId() == 78 || UtilBlock.airFoliage(block))
|
||||
// {
|
||||
// //Build
|
||||
// if (block.getTypeId() == 78)
|
||||
// {
|
||||
// block.setTypeIdAndData(78, (byte)(block.getData() + 1), true);
|
||||
//
|
||||
// if (block.getData() >= 7)
|
||||
// block.setTypeIdAndData(80, (byte)0, true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// block.setTypeIdAndData(78, (byte)0, true);
|
||||
// }
|
||||
//
|
||||
// //Sound
|
||||
// block.getWorld().playSound(block.getLocation(), Sound.STEP_SNOW, 1f, 0.6f);
|
||||
//
|
||||
// //Use Snow
|
||||
// SnowballCount(player, -1);
|
||||
// }
|
||||
// else if ((IsSnow(block) || UtilBlock.solid(block)) && above > 0)
|
||||
// {
|
||||
// SnowballPlace(player, block.getRelative(BlockFace.UP), above - 1);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void SnowballThrow(Player player)
|
||||
// {
|
||||
// //Throw
|
||||
// player.launchProjectile(Snowball.class);
|
||||
//
|
||||
// //Use Snow
|
||||
// SnowballCount(player, -1);
|
||||
//
|
||||
// //Sound
|
||||
// player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 3f, 1.5f);
|
||||
// }
|
||||
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (!IsPlaying(player))
|
||||
return;
|
||||
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.SNOW_BALL))
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
if (UtilEvent.isAction(event, ActionType.L))
|
||||
SnowballThrow(player);
|
||||
|
||||
else if (UtilEvent.isAction(event, ActionType.R_BLOCK))
|
||||
SnowballPlace(player, event.getClickedBlock(), 1);
|
||||
}
|
||||
|
||||
private void SnowballPlace(Player player, Block block, int above)
|
||||
{
|
||||
if (block.getTypeId() == 78 || UtilBlock.airFoliage(block))
|
||||
{
|
||||
//Build
|
||||
if (block.getTypeId() == 78)
|
||||
{
|
||||
block.setTypeIdAndData(78, (byte)(block.getData() + 1), true);
|
||||
|
||||
if (block.getData() >= 7)
|
||||
block.setTypeIdAndData(80, (byte)0, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
block.setTypeIdAndData(78, (byte)0, true);
|
||||
}
|
||||
|
||||
//Sound
|
||||
block.getWorld().playSound(block.getLocation(), Sound.STEP_SNOW, 1f, 0.6f);
|
||||
|
||||
//Use Snow
|
||||
SnowballCount(player, -1);
|
||||
}
|
||||
else if ((IsSnow(block) || UtilBlock.solid(block)) && above > 0)
|
||||
{
|
||||
SnowballPlace(player, block.getRelative(BlockFace.UP), above - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void SnowballThrow(Player player)
|
||||
{
|
||||
//Throw
|
||||
player.launchProjectile(Snowball.class);
|
||||
|
||||
//Use Snow
|
||||
SnowballCount(player, -1);
|
||||
|
||||
//Sound
|
||||
player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 3f, 1.5f);
|
||||
}
|
||||
|
||||
private void SnowballCount(Player player, int count)
|
||||
{
|
||||
if (player.getInventory().getItem(1) != null)
|
||||
count += player.getInventory().getItem(1).getAmount();
|
||||
|
||||
if (count > 16)
|
||||
count = 16;
|
||||
|
||||
if (count > 0)
|
||||
player.getInventory().setItem(1, ItemStackFactory.Instance.CreateStack(Material.SNOW_BALL, count));
|
||||
else
|
||||
player.getInventory().setItem(1, null);
|
||||
}
|
||||
// private void SnowballCount(Player player, int count)
|
||||
// {
|
||||
// if (player.getInventory().getItem(1) != null)
|
||||
// count += player.getInventory().getItem(1).getAmount();
|
||||
//
|
||||
// if (count > 16)
|
||||
// count = 16;
|
||||
//
|
||||
// if (count > 0)
|
||||
// player.getInventory().setItem(1, ItemStackFactory.Instance.CreateStack(Material.SNOW_BALL, count));
|
||||
// else
|
||||
// player.getInventory().setItem(1, null);
|
||||
// }
|
||||
|
||||
private void SnowDecrease(Block block, int height)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -323,7 +323,7 @@ public enum SpellType // ❤
|
||||
"Rumble", // Spell name
|
||||
new ItemStack(Material.PUMPKIN_SEEDS), // Spell icon
|
||||
SpellRumble.class, // Spell class
|
||||
5, // Spell max level
|
||||
3, // Spell max level
|
||||
30, // Mana cost
|
||||
15, // Spell cooldown
|
||||
0, // Mana cost change per level
|
||||
|
@ -108,12 +108,16 @@ public class PerkFletcher extends Perk
|
||||
|
||||
if (!Kit.HasKit(cur))
|
||||
continue;
|
||||
|
||||
|
||||
if (!Manager.GetGame().IsAlive(cur))
|
||||
continue;
|
||||
|
||||
if (UtilPlayer.isChargingBow(cur))
|
||||
continue;
|
||||
|
||||
// Enabling this causes a bug that will sometimes prevent players from getting new arrows
|
||||
// Believe this bug is related to when a player fires an arrow and gets an arrow in their inventory at the same
|
||||
// time which causes their inventory to not be in sync with the server. Best known fix right now
|
||||
// is to remove this check or keep calling UtilInv.update()
|
||||
// if (UtilPlayer.isChargingBow(cur))
|
||||
// continue;
|
||||
|
||||
if (!Recharge.Instance.use(cur, GetName(), _time * 1000, false, false))
|
||||
continue;
|
||||
|
@ -72,11 +72,7 @@ public class GameCreationManager implements Listener
|
||||
|
||||
//Archive Game
|
||||
if (Manager.GetGame() != null)
|
||||
{
|
||||
//Don't End UHC
|
||||
if (Manager.GetGame().GetType() == GameType.UHC)
|
||||
return;
|
||||
|
||||
{
|
||||
if (Manager.GetGame().GetState() == GameState.Dead)
|
||||
{
|
||||
HandlerList.unregisterAll(Manager.GetGame());
|
||||
|
@ -509,7 +509,7 @@ public class GameHostManager implements Listener
|
||||
|
||||
public int getMaxPlayerCap()
|
||||
{
|
||||
if (hasRank(Rank.SNR_MODERATOR) || _hostRank == Rank.YOUTUBE)
|
||||
if (hasRank(Rank.SNR_MODERATOR) || _hostRank == Rank.YOUTUBE || _hostRank == Rank.TWITCH)
|
||||
return 100;
|
||||
else if (hasRank(Rank.LEGEND))
|
||||
return 40;
|
||||
|
@ -224,16 +224,8 @@ public class GameManager implements Listener
|
||||
|
||||
public void StateCountdown(Game game, int timer, boolean force)
|
||||
{
|
||||
//Always give time to pick team.
|
||||
if (!game.GetCountdownForce() && !force && !UtilTime.elapsed(game.GetStateTime(), game.GetType() == GameType.UHC ? 150000 : 15000))
|
||||
{
|
||||
if (game.GetType() == GameType.UHC)
|
||||
{
|
||||
((UHC)game).informStartSoon();
|
||||
}
|
||||
|
||||
if (game instanceof UHC && !((UHC)game).isMapLoaded())
|
||||
return;
|
||||
}
|
||||
|
||||
//Disabling Cosmetics
|
||||
if (game.GetCountdown() <= 5 && game.GetCountdown() >= 0 && game.GadgetsDisabled)
|
||||
|
@ -50,10 +50,12 @@ public class MiscManager implements Listener
|
||||
Player player = event.getPlayer();
|
||||
|
||||
//BoneMeal
|
||||
if (event.getPlayer().getItemInHand().getType() == Material.INK_SACK && event.getPlayer().getItemInHand().getData().getData() == (byte)15)
|
||||
if (!Manager.GetGame().WorldBoneMeal &&
|
||||
event.getAction() == Action.RIGHT_CLICK_BLOCK &&
|
||||
event.getPlayer().getItemInHand().getType() == Material.INK_SACK &&
|
||||
event.getPlayer().getItemInHand().getData().getData() == (byte)15)
|
||||
{
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && Manager.GetGame().GetType() != GameType.UHC && Manager.GetGame().GetType() != GameType.Build)
|
||||
event.setCancelled(true);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else if (Manager.GetGame().GetState() != GameState.Live)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ public class ExperienceStatTracker extends StatTracker<Game>
|
||||
for (Player player : event.GetGame().GetPlayers(false))
|
||||
{
|
||||
//Tally Gems
|
||||
double gems = 0;
|
||||
double gemExp = 0;
|
||||
for (String reason : event.GetGame().GetGems(player).keySet())
|
||||
{
|
||||
if (reason.toLowerCase().contains("participation"))
|
||||
@ -52,21 +52,20 @@ public class ExperienceStatTracker extends StatTracker<Game>
|
||||
|
||||
GemData gem = event.GetGame().GetGems(player).get(reason);
|
||||
|
||||
gems += (int)gem.Gems;
|
||||
gemExp += (int)gem.Gems;
|
||||
}
|
||||
|
||||
gems = Math.min(gems, 250);
|
||||
gemExp = Math.min(gemExp, 250) * 3;
|
||||
|
||||
//Game Time
|
||||
double time = (System.currentTimeMillis() - _startTime)/60000d;
|
||||
//Game Time = 1 Exp per 3 Seconds
|
||||
double timeExp = (System.currentTimeMillis() - _startTime)/2000d;
|
||||
|
||||
//Mult
|
||||
double mult = 1;
|
||||
if (!winners.contains(player))
|
||||
mult = 0.25;
|
||||
if (winners.contains(player))
|
||||
mult = 1.5;
|
||||
|
||||
//Exp
|
||||
int expGained = (int)(time*gems*mult);
|
||||
//Exp
|
||||
int expGained = (int)((timeExp + gemExp)*mult);
|
||||
|
||||
//Record Global and per Game
|
||||
addStat(player, "ExpEarned", expGained, false, true);
|
||||
|
@ -17,11 +17,13 @@ import mineplex.core.common.util.WorldUtil;
|
||||
import mineplex.core.common.util.ZipUtil;
|
||||
import mineplex.core.timing.TimingManager;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.uhc.UHC;
|
||||
import net.minecraft.server.v1_7_R4.ChunkPreLoadEvent;
|
||||
|
||||
import org.bukkit.Difficulty;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
|
||||
@ -80,7 +82,30 @@ public class WorldData
|
||||
{
|
||||
TimingManager.start("WorldData loading world.");
|
||||
//Start World
|
||||
World = WorldUtil.LoadWorld(new WorldCreator(GetFolder()));
|
||||
|
||||
if (Host instanceof UHC)
|
||||
{
|
||||
//Delete Old World
|
||||
File dir = new File(GetFolder() + "/data");
|
||||
FileUtil.DeleteFolder(dir);
|
||||
|
||||
dir = new File(GetFolder() + "/region");
|
||||
FileUtil.DeleteFolder(dir);
|
||||
|
||||
dir = new File(GetFolder() + "/level.dat");
|
||||
dir.delete();
|
||||
|
||||
//Create Fresh World with Random Seed
|
||||
WorldCreator creator = new WorldCreator(GetFolder());
|
||||
creator.seed(UtilMath.r(999999999));
|
||||
creator.environment(Environment.NORMAL);
|
||||
creator.generateStructures(true);
|
||||
World = creator.createWorld();
|
||||
}
|
||||
else
|
||||
{
|
||||
World = WorldUtil.LoadWorld(new WorldCreator(GetFolder()));
|
||||
}
|
||||
TimingManager.stop("WorldData loading world.");
|
||||
|
||||
World.setDifficulty(Difficulty.HARD);
|
||||
|
Loading…
Reference in New Issue
Block a user