Merge branches 'develop' and 'feature/party-v2' of https://github.com/Mineplex-LLC/Minecraft-PC into feature/party-v2
This commit is contained in:
commit
67a185acc9
@ -0,0 +1,59 @@
|
||||
package mineplex.core.common.util;
|
||||
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
||||
public class UtilParser
|
||||
{
|
||||
public static String parseDamageCause(EntityDamageEvent.DamageCause cause)
|
||||
{
|
||||
switch (cause)
|
||||
{
|
||||
case CONTACT:
|
||||
return "Cactus";
|
||||
case ENTITY_ATTACK:
|
||||
return "Attack";
|
||||
case PROJECTILE:
|
||||
return "Ranged Weapon";
|
||||
case SUFFOCATION:
|
||||
return "Suffocation";
|
||||
case FALL:
|
||||
return "Fall";
|
||||
case FIRE:
|
||||
return "Fire";
|
||||
case FIRE_TICK:
|
||||
return "Burning";
|
||||
case MELTING:
|
||||
return "Melting";
|
||||
case LAVA:
|
||||
return "Lava";
|
||||
case DROWNING:
|
||||
return "Drowning";
|
||||
case BLOCK_EXPLOSION:
|
||||
return "Explosion";
|
||||
case ENTITY_EXPLOSION:
|
||||
return "Explosion";
|
||||
case VOID:
|
||||
return "Void";
|
||||
case LIGHTNING:
|
||||
return "Lightning";
|
||||
case SUICIDE:
|
||||
return "Suicide";
|
||||
case STARVATION:
|
||||
return "Hunger";
|
||||
case POISON:
|
||||
return "Poison";
|
||||
case MAGIC:
|
||||
return "Thrown Potion";
|
||||
case WITHER:
|
||||
return "Wither Effect";
|
||||
case FALLING_BLOCK:
|
||||
return "Falling Block";
|
||||
case THORNS:
|
||||
return "Thorns Enchantment";
|
||||
case CUSTOM:
|
||||
return "Custom";
|
||||
default:
|
||||
return "The Mighty defek7";
|
||||
}
|
||||
}
|
||||
}
|
@ -22,9 +22,9 @@ public class TestRank extends CommandBase<CoreClientManager>
|
||||
@Override
|
||||
public void Execute(final Player caller, String[] args)
|
||||
{
|
||||
if (!Plugin.Get(caller).GetRank(true).has(Rank.JNR_DEV))
|
||||
if (!Plugin.Get(caller).GetRank(true).has(Rank.SNR_MODERATOR))
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Permissions", "This requires Permission Rank [" + Rank.JNR_DEV.getTag(false, true) + C.cGray + "]."));
|
||||
UtilPlayer.message(caller, F.main("Permissions", "This requires Permission Rank [" + Rank.SNR_MODERATOR.getTag(false, true) + C.cGray + "]."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -65,6 +65,14 @@ public class TestRank extends CommandBase<CoreClientManager>
|
||||
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Invalid rank!"));
|
||||
return;
|
||||
}
|
||||
if (Plugin.Get(caller).GetRank(true) == Rank.SNR_MODERATOR)
|
||||
{
|
||||
if (tempRank.has(Rank.TWITCH))
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Command", "You can only test Player ranks!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Plugin.Get(caller).SetRank(tempRank, true);
|
||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "Your rank has been set to " + tempRank.getTag(false, false) + C.cGray + "!"));
|
||||
|
@ -714,6 +714,67 @@ public enum Achievement
|
||||
new int[]{1},
|
||||
AchievementCategory.MINE_STRIKE),
|
||||
|
||||
//Bawk Bawk Battles
|
||||
BAWK_BAWK_BATTLES_VETERAN("Veteran", 1000,
|
||||
new String[]{"Bawk Bawk Battles.Veteran"},
|
||||
new String[]{"Win 50 games of Bawk Bawk Battles"},
|
||||
new int[] {50},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_PINATA_MASTER("Pinata Master", 1000,
|
||||
new String[]{"Bawk Bawk Battles.PinataMaster"},
|
||||
new String[]{C.cGray + "Chicken Shooting Challenge", "Shoot 500 chickens"},
|
||||
new int[] {500},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_SURF_UP("Surf Up", 1000,
|
||||
new String[]{"Bawk Bawk Battles.SurfUp"},
|
||||
new String[]{C.cGray + "Wave Crush Challenge", "Avoid 500 waves"},
|
||||
new int[] {500},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_MILK_MAN("Milk Man", 600,
|
||||
new String[]{"Bawk Bawk Battles.MilkMan"},
|
||||
new String[]{C.cGray + "Milk A Cow Challenge", "Deliver 300 buckets of milk to the farmer"},
|
||||
new int[] {300},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_DRAGON_KING("Dragon King", 600,
|
||||
new String[]{"Bawk Bawk Battles.DragonKing"},
|
||||
new String[]{C.cGray + "Egg Smash Challenge", "Smash 300 dragon eggs"},
|
||||
new int[] {300},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_PIXEL_NINJA("Pixel Ninja", 200,
|
||||
new String[]{"Bawk Bawk Battles.PixelNinja"},
|
||||
new String[]{C.cGray + "Falling Blocks Challenge", "Dodge 100 waves of falling blocks"},
|
||||
new int[] {100},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_ELITE_ARCHER("Elite Archer", 200,
|
||||
new String[]{"Bawk Bawk Battles.EliteArcher"},
|
||||
new String[]{C.cGray + "Mini OITQ Challenge", "Kill 100 players"},
|
||||
new int[] {100},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_TAG_MASTER("Tag Master", 500,
|
||||
new String[]{"Bawk Bawk Battles.TagMaster"},
|
||||
new String[]{C.cGray + "Reverse Tag Challenge", "Win 5 entire rounds", "without being untagged"},
|
||||
new int[] {5},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_SPEEDY_BUILDERS("Speedy Builders", 500,
|
||||
new String[]{"Bawk Bawk Battles.SpeedyBuilders"},
|
||||
new String[]{C.cGray + "Build Race Challenge", "Place all blocks in your", "inventory within 15 seconds"},
|
||||
new int[] {3},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
BAWK_BAWK_BATTLES_BOUNCING_SHADOW("Bouncing Shadow", 500,
|
||||
new String[]{"Bawk Bawk Battles.BouncingShadow"},
|
||||
new String[]{C.cGray + "Bouncing Block Challenge", "Win 3 entire rounds", "without stepping on red wool"},
|
||||
new int[] {3},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
//Bomb Lobbers
|
||||
BOMB_LOBBERS_WINS("Master Bomber", 1200,
|
||||
new String[]{"Bomb Lobbers.Wins"},
|
||||
|
@ -2,6 +2,10 @@ package mineplex.core.achievement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
@ -10,10 +14,6 @@ import mineplex.core.game.GameDisplay;
|
||||
import mineplex.core.stats.PlayerStats;
|
||||
import mineplex.core.stats.StatsManager;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public enum AchievementCategory
|
||||
{
|
||||
GLOBAL("Global", null,
|
||||
@ -62,6 +62,10 @@ public enum AchievementCategory
|
||||
new StatDisplay("Kills as Undead"), new StatDisplay("Deaths as Undead"), StatDisplay.GEMS_EARNED },
|
||||
Material.DIAMOND_CHESTPLATE, 0, GameCategory.CLASSICS, null, false, GameDisplay.CastleSiege.getGameId()),
|
||||
|
||||
BAWK_BAWK_BATTLES("Bawk Bawk Battles", null,
|
||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.GEMS_EARNED },
|
||||
Material.EGG, 0, GameCategory.CLASSICS, null, false, GameDisplay.BawkBawkBattles.getGameId()),
|
||||
|
||||
BLOCK_HUNT("Block Hunt", null,
|
||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||
Material.GRASS, 0, GameCategory.CLASSICS, "Infestor Kit", false, GameDisplay.HideSeek.getGameId()),
|
||||
|
@ -46,7 +46,7 @@ public class AchievementMainPage extends ShopPageBase<AchievementManager, Achiev
|
||||
protected void buildPage()
|
||||
{
|
||||
ArrayList<Integer> pageLayout = new ItemLayout(
|
||||
"XXXXOXXXO",
|
||||
"XXXXOXOXO",
|
||||
"OXOXOXOXO",
|
||||
"OXOXOXOXO",
|
||||
"OXOXOXOXO").getItemSlots();
|
||||
|
@ -277,7 +277,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
// return _voteStreak;
|
||||
// }
|
||||
|
||||
public void handleVote(final Player player, final int gemsReceived)
|
||||
public void handleVote(final Player player, final int shardsReceived)
|
||||
{
|
||||
final int accountId = _clientManager.getAccountId(player);
|
||||
|
||||
@ -303,7 +303,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
_statsManager.incrementStat(player, "Global.DailyVote", 1);
|
||||
addPendingExplosion(player, player.getName());
|
||||
UtilPlayer.message(player, F.main("Carl", "Thanks for voting for Mineplex!"));
|
||||
UtilPlayer.message(player, F.main("Carl", "You received " + F.elem(gemsReceived + " Gems") + " and " + F.elem("1 Carl Spinner Ticket") + "!"));
|
||||
UtilPlayer.message(player, F.main("Carl", "You received " + F.elem("1 Carl Spinner Ticket") + "!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -618,16 +618,16 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
BonusClientData client = Get(player);
|
||||
int streak = client.getDailyStreak();
|
||||
|
||||
int multiplyer = Math.min(200, 5 * streak);
|
||||
if (streak >= 40) multiplyer += (1 * (streak - 40));
|
||||
return multiplyer;
|
||||
int multiplier = Math.min(200, 5 * streak);
|
||||
if (streak >= 40) multiplier += (1 * (streak - 40));
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
public int getVoteMultiplyer(int streak)
|
||||
public int getVoteMultiplier(int streak)
|
||||
{
|
||||
int multiplyer = Math.min(100, 5 * streak);
|
||||
if (streak >= 20) multiplyer += (1 * (streak - 40));
|
||||
return multiplyer;
|
||||
int multiplier = Math.min(100, 5 * streak);
|
||||
if (streak >= 20) multiplier += (1 * (streak - 40));
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
public BonusAmount getDailyBonusAmount(Player player)
|
||||
@ -656,12 +656,10 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
|
||||
public BonusAmount getVoteBonusAmount(int voteStreak)
|
||||
{
|
||||
double mult = getVoteMultiplyer(voteStreak) / 100.0;
|
||||
double mult = getVoteMultiplier(voteStreak) / 100.0;
|
||||
|
||||
BonusAmount amount = new BonusAmount();
|
||||
amount.setTickets(1);
|
||||
amount.setGems(400);
|
||||
amount.setBonusGems((int) (mult * 400));
|
||||
|
||||
return amount;
|
||||
}
|
||||
@ -1200,4 +1198,4 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
{
|
||||
return _boosterManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class VoteButton implements GuiItem, Listener {
|
||||
lore.add(" ");
|
||||
|
||||
lore.add(C.cYellow + "Current Streak: " + C.cWhite + client.getVoteStreak());
|
||||
lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + "+" + _bonusManager.getVoteMultiplyer(client.getVoteStreak()) + "%");
|
||||
lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + "+" + _bonusManager.getVoteMultiplier(client.getVoteStreak()) + "%");
|
||||
if (client.getVoteTime() != null)
|
||||
{
|
||||
long lastBonus = _bonusManager.getLocalTime(client.getVoteTime().getTime());
|
||||
|
@ -71,7 +71,7 @@ public class YoutubeButton implements GuiItem
|
||||
message = "Click here to visit our YouTube page!";
|
||||
}
|
||||
|
||||
new JsonMessage(C.cAquaB + message).click(ClickEvent.OPEN_URL, "https://www.youtube.com/embed/RW3sOmkiEG-A?list=UU1MtBclG_aHPd0nLmUupCKg&controls=0&showinfo=0").sendToPlayer(_player);
|
||||
new JsonMessage(C.cAquaB + message).click(ClickEvent.OPEN_URL, "http://youtube.com/mineplexgamesofficial?sub_confirmation=1").sendToPlayer(_player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,7 +25,7 @@ public class VoteHandler implements CommandCallback
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
_bonusManager.handleVote(player, v.getGemsReceived());
|
||||
_bonusManager.handleVote(player, v.getShardsReceived());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,14 +5,14 @@ import mineplex.serverdata.commands.ServerCommand;
|
||||
public class VotifierCommand extends ServerCommand
|
||||
{
|
||||
private String _playerName;
|
||||
private int _gemsReceived;
|
||||
private int _shardsReceived;
|
||||
|
||||
public VotifierCommand(String playerName, int gemsReceived, String... targetServer)
|
||||
public VotifierCommand(String playerName, int shardsReceived, String... targetServer)
|
||||
{
|
||||
super(targetServer);
|
||||
|
||||
_playerName = playerName;
|
||||
_gemsReceived = gemsReceived;
|
||||
_shardsReceived = shardsReceived;
|
||||
}
|
||||
|
||||
public String getPlayerName()
|
||||
@ -20,9 +20,9 @@ public class VotifierCommand extends ServerCommand
|
||||
return _playerName;
|
||||
}
|
||||
|
||||
public int getGemsReceived()
|
||||
public int getShardsReceived()
|
||||
{
|
||||
return _gemsReceived;
|
||||
return _shardsReceived;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class BoosterPage extends ShopPageBase<BoosterManager, BoosterShop>
|
||||
{
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Game Amplifiers allow you to");
|
||||
lore.add(C.cGray + "increase the gems and shards");
|
||||
lore.add(C.cGray + "increase the shards");
|
||||
lore.add(C.cGray + "earned in that game for 1 hour.");
|
||||
lore.add(C.cGray + "You will also earn bonus rewards");
|
||||
lore.add(C.cGray + "from players thanking you while");
|
||||
|
@ -592,7 +592,7 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
if (armor.getSlot() == slot)
|
||||
{
|
||||
armor.removeArmor(player);
|
||||
armor.removeArmor(player, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -671,7 +671,7 @@ public class GadgetManager extends MiniPlugin
|
||||
}
|
||||
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
{
|
||||
gadget.disable(player);
|
||||
gadget.disable(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class BabyCowBalloon extends BalloonGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_entityStand.remove();
|
||||
_balloonEntity.remove();
|
||||
|
@ -47,9 +47,9 @@ public class ItemBatGun extends ItemGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
super.disableCustom(player);
|
||||
super.disableCustom(player, message);
|
||||
|
||||
Clear(player);
|
||||
}
|
||||
|
@ -42,9 +42,9 @@ public class ItemEtherealPearl extends ItemGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
super.disableCustom(player);
|
||||
super.disableCustom(player, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,13 +89,13 @@ public class ItemPaintbrush extends ItemGadget
|
||||
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_brushColor.remove(player.getName());
|
||||
_brushPrevious.remove(player.getName());
|
||||
_playerLocation.remove(player.getName());
|
||||
|
||||
RemoveItem(player);
|
||||
RemoveItem(player, message);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -65,7 +65,7 @@ public class MorphBat extends MorphGadget implements IThrown
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -48,7 +48,7 @@ public class MorphBlaze extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -54,7 +54,7 @@ public class MorphBlock extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class MorphBunny extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_jumpCharge.remove(player);
|
||||
this.RemoveArmor(player);
|
||||
|
@ -54,7 +54,7 @@ public class MorphChicken extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -42,7 +42,7 @@ public class MorphCow extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -56,7 +56,7 @@ public class MorphCreeper extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -53,7 +53,7 @@ public class MorphEnderman extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -55,7 +55,7 @@ public class MorphPig extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||
@ -47,7 +46,7 @@ public class MorphPumpkinKing extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -65,7 +65,7 @@ public class MorphSlime extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -66,7 +66,7 @@ public class MorphSnowman extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -70,7 +70,7 @@ public class MorphTitan extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -46,7 +46,7 @@ public class MorphUncleSam extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class MorphVillager extends MorphGadget implements IThrown
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -73,7 +73,7 @@ public class MorphWither extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
@ -200,7 +200,7 @@ public class MorphWither extends MorphGadget
|
||||
|
||||
if (disguise == null || !(disguise instanceof DisguiseWither))
|
||||
{
|
||||
disableCustom(player);
|
||||
disableCustom(player, true);
|
||||
activeIterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class OutfitTeam extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
@ -96,9 +96,9 @@ public class OutfitTeam extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOWEST)
|
||||
|
@ -43,9 +43,9 @@ public class OutfitRaveSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
_colorPhase.remove(player.getName());
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,9 @@ public class OutfitSpaceSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -41,9 +41,9 @@ public class OutfitWindUpSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
_colorPhase.remove(player);
|
||||
_percentage.remove(player);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class ParticleFairy extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class ParticleKronos extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
|
@ -46,7 +46,7 @@ public class ParticleHeart extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
@ -123,13 +123,18 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
||||
}
|
||||
|
||||
public void disable(Player player)
|
||||
{
|
||||
disable(player, true);
|
||||
}
|
||||
|
||||
public void disable(Player player, boolean message)
|
||||
{
|
||||
if (isActive(player))
|
||||
{
|
||||
Manager.removeActive(player, this);
|
||||
GadgetDisableEvent event = new GadgetDisableEvent(player, this);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
disableCustom(player);
|
||||
disableCustom(player, message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,12 +146,12 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
||||
UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
if (_active.remove(player) && message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sold(Player player, CurrencyType currencyType)
|
||||
{
|
||||
|
@ -59,12 +59,13 @@ public abstract class HatGadget extends OutfitGadget
|
||||
player.getInventory().setHelmet(getHelmetItem());
|
||||
}
|
||||
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
player.getInventory().setHelmet(null);
|
||||
}
|
||||
@ -96,9 +97,9 @@ public abstract class HatGadget extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
public HatType getHatType()
|
||||
|
@ -56,9 +56,9 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
RemoveItem(player);
|
||||
RemoveItem(player, message);
|
||||
}
|
||||
|
||||
public HashSet<Player> getActive()
|
||||
@ -113,13 +113,14 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveItem(Player player)
|
||||
public void RemoveItem(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
{
|
||||
player.getInventory().setItem(Manager.getActiveItemSlot(), null);
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unequipped " + F.elem(getName()) + "."));
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unequipped " + F.elem(getName()) + "."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,12 +68,13 @@ public abstract class OutfitGadget extends Gadget
|
||||
ItemStackFactory.Instance.CreateStack(getDisplayMaterial().getId(), getDisplayData(), 1, getName()));
|
||||
}
|
||||
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
if (_slot == ArmorSlot.Helmet) player.getInventory().setHelmet(null);
|
||||
else if (_slot == ArmorSlot.Chest) player.getInventory().setChestplate(null);
|
||||
|
@ -41,7 +41,7 @@ public abstract class ParticleGadget extends Gadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ public abstract class WinEffectGadget extends Gadget
|
||||
public Schematic pasteScematic(String schematicName) {
|
||||
try
|
||||
{
|
||||
Schematic schematic = UtilSchematic.loadSchematic(new File("schematic" + File.separator + schematicName + ".schematic"));
|
||||
Schematic schematic = UtilSchematic.loadSchematic(new File("../../update/schematic/" + schematicName + ".schematic"));
|
||||
if (schematic != null)
|
||||
schematic.paste(getBaseLocation(), false, true);
|
||||
return schematic;
|
||||
|
@ -32,7 +32,7 @@ public enum GameDisplay
|
||||
Micro("Micro Battle", Material.LAVA_BUCKET, (byte)0, GameCategory.ARCADE, 24),
|
||||
MilkCow("Milk the Cow", Material.MILK_BUCKET, (byte)0, GameCategory.ARCADE, 27),
|
||||
MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CHAMPIONS, 25),// Temp set to CHAMPIONS to fix UI bug
|
||||
MineWare("MineWare", Material.PAPER, (byte)0, GameCategory.EXTRA, 26),
|
||||
BawkBawkBattles("Bawk Bawk Battles", Material.EGG, (byte)0, GameCategory.CLASSICS, 26),
|
||||
OldMineWare("Old MineWare", Material.PAPER, (byte)0, GameCategory.EXTRA, 26),
|
||||
Paintball("Super Paintball", Material.ENDER_PEARL, (byte)0, GameCategory.ARCADE, 28),
|
||||
Quiver("One in the Quiver", Material.ARROW, (byte)0, GameCategory.ARCADE, 29),
|
||||
|
@ -16,7 +16,6 @@ import mineplex.core.globalpacket.command.GlobalPacketCommand;
|
||||
import mineplex.core.globalpacket.listeners.GlobalGiveCoins;
|
||||
import mineplex.core.globalpacket.listeners.GlobalGiveGems;
|
||||
import mineplex.core.globalpacket.listeners.GlobalGiveItem;
|
||||
import mineplex.core.globalpacket.listeners.GlobalRawr;
|
||||
import mineplex.core.globalpacket.redis.GlobalPacketHandler;
|
||||
import mineplex.core.globalpacket.redis.GlobalPacketMessage;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
@ -49,7 +48,6 @@ public class GlobalPacketManager extends MiniPlugin
|
||||
getPluginManager().registerEvents(new GlobalGiveItem(inventoryManager, _rewardManager), getPlugin());
|
||||
getPluginManager().registerEvents(new GlobalGiveGems(donationManager), getPlugin());
|
||||
getPluginManager().registerEvents(new GlobalGiveCoins(donationManager, clientManager), getPlugin());
|
||||
getPluginManager().registerEvents(new GlobalRawr(), getPlugin());
|
||||
}
|
||||
|
||||
public void callGlobalCommand(Player caller, String[] args)
|
||||
|
@ -1,50 +0,0 @@
|
||||
package mineplex.core.globalpacket.listeners;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.globalpacket.event.GlobalPacketEvent;
|
||||
|
||||
/**
|
||||
* Created by William (WilliamTiger).
|
||||
* 18/11/15
|
||||
*/
|
||||
public class GlobalRawr implements Listener
|
||||
{
|
||||
|
||||
@EventHandler
|
||||
public void globalRawr(GlobalPacketEvent e)
|
||||
{
|
||||
if (e.getParts() == null || e.getParts().length < 1)
|
||||
return;
|
||||
|
||||
if (!e.getParts()[0].equalsIgnoreCase("rawr"))
|
||||
return;
|
||||
|
||||
if (e.getParts().length < 2)
|
||||
{
|
||||
if (e.getCaller() != null)
|
||||
UtilPlayer.message(e.getCaller(), F.main("Global", "/global rawr <msg>"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
String msg = "";
|
||||
for (int i = 1; i < e.getParts().length; i++)
|
||||
{
|
||||
msg += e.getParts()[i] + " ";
|
||||
}
|
||||
msg = msg.trim();
|
||||
|
||||
for (Player p : UtilServer.getPlayers())
|
||||
{
|
||||
UtilTextMiddle.display("§6§lRAWR!", "§e" + msg, p);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -227,7 +227,8 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
||||
event.getInventory().setItem(1, new ItemStack(Material.INK_SACK, level, (byte) 4));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
// fixme broken cast
|
||||
// @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onBlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (event.getBlock().getType() != Material.ENCHANTMENT_TABLE)
|
||||
|
@ -159,7 +159,7 @@ public class PersonalServerManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
||||
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, "", true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
||||
true, false, false, games, "", "", "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
||||
|
||||
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
|
||||
|
@ -5,62 +5,44 @@ import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom;
|
||||
import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom;
|
||||
import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom;
|
||||
import mineplex.core.gadget.gadgets.hat.*;
|
||||
import mineplex.core.gadget.gadgets.morph.*;
|
||||
import mineplex.core.gadget.gadgets.particle.*;
|
||||
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
||||
import mineplex.core.gadget.gadgets.particle.cupidslove.ParticleHeart;
|
||||
import mineplex.core.gadget.gadgets.particle.emerald.ParticleEmerald;
|
||||
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
|
||||
import mineplex.core.gadget.gadgets.particle.frostlord.ParticleFrostLord;
|
||||
import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain;
|
||||
import mineplex.core.gadget.gadgets.particle.music.ParticleMusic;
|
||||
import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime;
|
||||
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
|
||||
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
||||
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
||||
import mineplex.core.mount.types.*;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.frostlord.ArrowTrailFrostLord;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm;
|
||||
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
||||
import mineplex.core.gadget.gadgets.death.candycane.DeathCandyCane;
|
||||
import mineplex.core.gadget.gadgets.death.cupidslove.DeathCupidsBrokenHeart;
|
||||
import mineplex.core.gadget.gadgets.death.emerald.DeathEmerald;
|
||||
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
||||
import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom;
|
||||
import mineplex.core.gadget.gadgets.death.frostlord.DeathFrostLord;
|
||||
import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
|
||||
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
|
||||
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
|
||||
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
|
||||
import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
|
||||
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
||||
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
||||
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
||||
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
|
||||
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
|
||||
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
||||
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
||||
import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom;
|
||||
import mineplex.core.gadget.gadgets.doublejump.frostlord.DoubleJumpFrostLord;
|
||||
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
||||
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
||||
import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm;
|
||||
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
||||
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
||||
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
||||
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
||||
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
|
||||
import mineplex.core.gadget.gadgets.hat.HatType;
|
||||
import mineplex.core.gadget.gadgets.item.ItemBatGun;
|
||||
import mineplex.core.gadget.gadgets.item.ItemBow;
|
||||
import mineplex.core.gadget.gadgets.item.ItemCoal;
|
||||
@ -74,6 +56,15 @@ import mineplex.core.gadget.gadgets.item.ItemPaintballGun;
|
||||
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
||||
import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
||||
import mineplex.core.gadget.gadgets.item.ItemTNT;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphChicken;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphCow;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphUncleSam;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphVillager;
|
||||
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitBoots;
|
||||
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitChestplate;
|
||||
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitHelmet;
|
||||
@ -82,6 +73,24 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots;
|
||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
|
||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
|
||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
||||
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
||||
import mineplex.core.gadget.gadgets.particle.cupidslove.ParticleHeart;
|
||||
import mineplex.core.gadget.gadgets.particle.emerald.ParticleEmerald;
|
||||
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
|
||||
import mineplex.core.gadget.gadgets.particle.frostlord.ParticleFrostLord;
|
||||
import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain;
|
||||
import mineplex.core.gadget.gadgets.particle.music.ParticleMusic;
|
||||
import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime;
|
||||
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
|
||||
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
||||
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
||||
@ -93,6 +102,13 @@ import mineplex.core.gadget.types.HatGadget;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.mount.Mount;
|
||||
import mineplex.core.mount.types.MountBabyReindeer;
|
||||
import mineplex.core.mount.types.MountCart;
|
||||
import mineplex.core.mount.types.MountFreedomHorse;
|
||||
import mineplex.core.mount.types.MountFrost;
|
||||
import mineplex.core.mount.types.MountMule;
|
||||
import mineplex.core.mount.types.MountSlime;
|
||||
import mineplex.core.mount.types.MountUndead;
|
||||
import mineplex.core.pet.Pet;
|
||||
import mineplex.core.pet.PetManager;
|
||||
import mineplex.core.reward.RewardPool.Type;
|
||||
@ -105,6 +121,10 @@ import mineplex.core.reward.rewards.TreasureShardReward;
|
||||
import mineplex.core.reward.rewards.UnknownPackageReward;
|
||||
import mineplex.core.stats.StatsManager;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class RewardManager
|
||||
{
|
||||
private EnumMap<RewardPool.Type, RewardPool> _rewardPools;
|
||||
@ -553,8 +573,7 @@ public class RewardManager
|
||||
{
|
||||
RewardRarity rarity = RewardRarity.COMMON;
|
||||
|
||||
addReward(Type.CARL_SPINNER, new GemReward(_donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 25, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new ExperienceReward(_statsManager, getAmmoMin(rarity)*5, getAmmoMax(rarity)*5, 25, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new TreasureShardReward(_clientManager, _donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 25, rarity));
|
||||
|
||||
//Normal Gadgets
|
||||
addInventoryReward(Type.NORMAL, getGadget(ItemBatGun.class), rarity, 10, getShards(rarity), 4, 10);
|
||||
@ -580,8 +599,7 @@ public class RewardManager
|
||||
{
|
||||
RewardRarity rarity = RewardRarity.UNCOMMON;
|
||||
|
||||
addReward(Type.CARL_SPINNER, new GemReward(_donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 1200, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new ExperienceReward(_statsManager, getAmmoMin(rarity)*5, getAmmoMax(rarity)*5, 1200, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new TreasureShardReward(_clientManager, _donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 1200, rarity));
|
||||
|
||||
//Gadgets
|
||||
addInventoryReward(Type.NORMAL, getGadget(ItemBatGun.class), rarity, 250, 0, 20, 40);
|
||||
@ -631,8 +649,7 @@ public class RewardManager
|
||||
{
|
||||
RewardRarity rarity = RewardRarity.RARE;
|
||||
|
||||
addReward(Type.CARL_SPINNER, new GemReward(_donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 150, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new ExperienceReward(_statsManager, getAmmoMin(rarity)*5, getAmmoMax(rarity)*5, 150, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new TreasureShardReward(_clientManager, _donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 150, rarity));
|
||||
|
||||
//Morphs
|
||||
addGadget(Type.NORMAL, getGadget(MorphVillager.class), rarity, 83);
|
||||
@ -726,8 +743,7 @@ public class RewardManager
|
||||
{
|
||||
RewardRarity rarity = RewardRarity.LEGENDARY;
|
||||
|
||||
addReward(Type.CARL_SPINNER, new GemReward(_donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 10, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new ExperienceReward(_statsManager, getAmmoMin(rarity)*5, getAmmoMax(rarity)*5, 10, 0, rarity));
|
||||
addReward(Type.CARL_SPINNER, new TreasureShardReward(_clientManager, _donationManager, getAmmoMin(rarity), getAmmoMax(rarity), 10, rarity));
|
||||
|
||||
//REGULAR
|
||||
|
||||
|
@ -4,10 +4,11 @@ import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.reward.rewards.GemReward;
|
||||
import mineplex.core.reward.rewards.InventoryReward;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Used to separate different "Reward Pools". This allows us to have treasure chests with different loot.
|
||||
*
|
||||
@ -75,6 +76,13 @@ public class RewardPool
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this == Type.CARL_SPINNER)
|
||||
{
|
||||
if (reward instanceof GemReward)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -915,6 +915,11 @@ public class ServerManager extends MiniDbClientPlugin<SimpleClanToken> implement
|
||||
return _serverNpcShopMap.get("Weekend Brawl");
|
||||
}
|
||||
|
||||
public ShopBase<ServerManager> getBawkShop()
|
||||
{
|
||||
return _serverNpcShopMap.get("Bawk Bawk Battles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuery(int accountId, String uuid, String name)
|
||||
{
|
||||
|
@ -41,25 +41,32 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
add(2, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
|
||||
add(1, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Follow Bawk Bawk's instructions",
|
||||
C.Reset + "Complete different tasks",
|
||||
C.Reset + "If you lose, chickens will devour you!"
|
||||
}, "BBB", "Bawk_Bawk_Battles", new SelectBawkButton(this));
|
||||
|
||||
add(3, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
|
||||
{
|
||||
C.Reset + "",
|
||||
C.Reset + "Memorize Gwen the Guardian's builds",
|
||||
C.Reset + "Then recreate them in a short amount of time.",
|
||||
C.Reset + "The least correct builder is eliminated.",
|
||||
}, "SB", "Speed_Builders", new SelectSBButton(this));
|
||||
|
||||
add(4, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
add(5, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATE",
|
||||
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!",
|
||||
}, "DMT", "Draw_My_Thing", new SelectDMTButton(this));
|
||||
|
||||
add(6, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
add(7, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME",
|
||||
C.Reset + "",
|
||||
@ -192,7 +199,6 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
|
||||
add(41, Material.BREWING_STAND_ITEM, C.cYellowB + "Monster Maze " + C.cGray + "Snow Sprint", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "BETA GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Run along a maze avoiding",
|
||||
C.Reset + "evil monsters. Get to the",
|
||||
@ -220,7 +226,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
{
|
||||
// append to start of lore
|
||||
builder.getLore().add(0, C.cWhite + "Amplified by " + C.cGreen + booster.getPlayerName() + C.cWhite + " - " + C.cGreen + booster.getTimeRemainingString());
|
||||
builder.getLore().add(1, C.cWhite + "All players earn " + C.cGreen + "2x Gems" + C.cWhite + " and " + C.cAqua + "2x Shards");
|
||||
builder.getLore().add(1, C.cWhite + "All players earn "+ C.cAqua + "2x Shards");
|
||||
builder.setGlow(true);
|
||||
}
|
||||
}
|
||||
@ -570,6 +576,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
{
|
||||
getPlugin().getValentinesShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
public void openBawk(Player player)
|
||||
{
|
||||
getPlugin().getBawkShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
/*
|
||||
ADDITIONAL LORES;
|
||||
|
@ -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 SelectBawkButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectBawkButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.openBawk(player);
|
||||
}
|
||||
}
|
@ -38,6 +38,7 @@ public enum GameType
|
||||
Micro("Micro Battle"),
|
||||
MineStrike("MineStrike"),
|
||||
MineWare("MineWare"),
|
||||
MinecraftLeague("MCL"),
|
||||
MilkCow("Milk the Cow"),
|
||||
MonsterLeague("MonsterLeague"),
|
||||
MonsterMaze("Monster Maze"),
|
||||
@ -53,6 +54,7 @@ public enum GameType
|
||||
SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs"),
|
||||
Snake("Snake"),
|
||||
SneakyAssassins("Sneaky Assassins"),
|
||||
SpeedBuilders("SpeedBuilders"),
|
||||
SnowFight("Snow Fight"),
|
||||
Spleef("Super Spleef"),
|
||||
SpleefTeams("Super Spleef Teams"),
|
||||
|
@ -0,0 +1,60 @@
|
||||
package mineplex.mapparser;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class GameTypeInfo
|
||||
{
|
||||
|
||||
private final String LINE = C.cAqua + C.Bold + C.Strike + "========================================";
|
||||
|
||||
private GameType _gameType;
|
||||
private List<String> _info;
|
||||
|
||||
public GameTypeInfo(GameType gameType, List<String> info)
|
||||
{
|
||||
_gameType = gameType;
|
||||
_info = info;
|
||||
}
|
||||
|
||||
public void addInfo(String info)
|
||||
{
|
||||
_info.add(info);
|
||||
}
|
||||
|
||||
public void remove(int index)
|
||||
{
|
||||
_info.remove(index);
|
||||
}
|
||||
|
||||
public List<String> getInfo()
|
||||
{
|
||||
return _info;
|
||||
}
|
||||
|
||||
public void sendInfo(Player player)
|
||||
{
|
||||
player.sendMessage(LINE);
|
||||
player.sendMessage(" ");
|
||||
player.sendMessage(F.elem(_gameType.GetName()));
|
||||
player.sendMessage(" ");
|
||||
for(String s : _info)
|
||||
{
|
||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', s));
|
||||
}
|
||||
player.sendMessage(" ");
|
||||
player.sendMessage(LINE);
|
||||
}
|
||||
|
||||
public GameType getGameType()
|
||||
{
|
||||
return _gameType;
|
||||
}
|
||||
}
|
@ -1,5 +1,11 @@
|
||||
package mineplex.mapparser;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.DataInputStream;
|
||||
@ -7,30 +13,39 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashSet;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class MapData
|
||||
public class MapData
|
||||
{
|
||||
public String MapFolder;
|
||||
public boolean _currentlyLive;
|
||||
public boolean _locked;
|
||||
public Map<String, Location> _warps;
|
||||
|
||||
public GameType MapGameType = null;
|
||||
public String MapName = "null";
|
||||
public String MapCreator = "null";
|
||||
|
||||
public HashSet<String> AdminList;
|
||||
|
||||
public Set<String> AdminList;
|
||||
|
||||
public MapData(String mapFolder)
|
||||
{
|
||||
MapFolder = mapFolder;
|
||||
|
||||
AdminList = new HashSet<String>();
|
||||
|
||||
AdminList = Sets.newHashSet();
|
||||
_warps = Maps.newHashMap();
|
||||
_currentlyLive = false;
|
||||
|
||||
if ((new File(MapFolder + File.separator + "Map.dat")).exists())
|
||||
{
|
||||
Read();
|
||||
else
|
||||
} else
|
||||
{
|
||||
Write();
|
||||
}
|
||||
}
|
||||
|
||||
public void Read()
|
||||
@ -43,46 +58,74 @@ public class MapData
|
||||
DataInputStream in = new DataInputStream(fstream);
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
||||
|
||||
while ((line = br.readLine()) != null)
|
||||
while ((line = br.readLine()) != null)
|
||||
{
|
||||
String[] tokens = line.split(":");
|
||||
|
||||
if (tokens.length < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tokens[0].length() == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(tokens[0].equalsIgnoreCase("locked"))
|
||||
{
|
||||
_locked = tokens[1].equalsIgnoreCase("true");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tokens[0].equalsIgnoreCase("currentlyLive"))
|
||||
{
|
||||
_currentlyLive = tokens[1].equalsIgnoreCase("true");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tokens[0].equalsIgnoreCase("warps"))
|
||||
{
|
||||
for (String s : tokens[1].split(";"))
|
||||
{
|
||||
String[] str = s.split("@");
|
||||
_warps.put(str[0], UtilWorld.strToLoc(str[1]));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//Name & Author
|
||||
if (tokens[0].equalsIgnoreCase("MAP_NAME"))
|
||||
{
|
||||
MapName = tokens[1];
|
||||
continue;
|
||||
}
|
||||
else if (tokens[0].equalsIgnoreCase("MAP_AUTHOR"))
|
||||
|
||||
if (tokens[0].equalsIgnoreCase("MAP_AUTHOR"))
|
||||
{
|
||||
MapCreator = tokens[1];
|
||||
continue;
|
||||
}
|
||||
else if (tokens[0].equalsIgnoreCase("GAME_TYPE"))
|
||||
|
||||
if (tokens[0].equalsIgnoreCase("GAME_TYPE"))
|
||||
{
|
||||
try
|
||||
{
|
||||
MapGameType = GameType.valueOf(tokens[1] == null ? "Unknown" : tokens[1]);
|
||||
}
|
||||
catch (Exception e)
|
||||
} catch (Exception e)
|
||||
{
|
||||
MapGameType = GameType.Unknown;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (tokens[0].equalsIgnoreCase("ADMIN_LIST") || tokens[0].equalsIgnoreCase("BUILD_LIST"))
|
||||
if (tokens[0].equalsIgnoreCase("ADMIN_LIST") || tokens[0].equalsIgnoreCase("BUILD_LIST"))
|
||||
{
|
||||
for (String cur : tokens[1].split(","))
|
||||
AdminList.add(cur);
|
||||
Collections.addAll(AdminList, tokens[1].split(","));
|
||||
}
|
||||
}
|
||||
|
||||
in.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
} catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
System.err.println("Line: " + line);
|
||||
@ -97,39 +140,60 @@ public class MapData
|
||||
FileWriter fstream = new FileWriter(MapFolder + File.separator + "Map.dat");
|
||||
BufferedWriter out = new BufferedWriter(fstream);
|
||||
|
||||
out.write("MAP_NAME:"+MapName);
|
||||
out.write("MAP_NAME:" + MapName);
|
||||
out.write("\n");
|
||||
out.write("MAP_AUTHOR:"+MapCreator);
|
||||
out.write("MAP_AUTHOR:" + MapCreator);
|
||||
out.write("\n");
|
||||
out.write("GAME_TYPE:"+MapGameType);
|
||||
|
||||
out.write("GAME_TYPE:" + MapGameType);
|
||||
|
||||
String adminList = "";
|
||||
|
||||
for (String cur : AdminList)
|
||||
{
|
||||
adminList += cur + ",";
|
||||
|
||||
}
|
||||
|
||||
out.write("\n");
|
||||
out.write("ADMIN_LIST:"+adminList);
|
||||
out.write("ADMIN_LIST:" + adminList);
|
||||
out.write("\n");
|
||||
out.write("currentlyLive:" + _currentlyLive);
|
||||
out.write("\n");
|
||||
out.write("warps:" + warpsToString());
|
||||
|
||||
out.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
} catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean HasAccess(Player player)
|
||||
public String warpsToString()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int i = 0;
|
||||
for (Entry<String, Location> entry : _warps.entrySet())
|
||||
{
|
||||
builder.append(entry.getKey()).append("@").append(UtilWorld.locToStr(entry.getValue()));
|
||||
if (++i != _warps.size())
|
||||
{
|
||||
builder.append(",");
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public boolean HasAccess(Player player)
|
||||
{
|
||||
return AdminList.contains(player.getName()) || player.isOp();
|
||||
}
|
||||
|
||||
public boolean CanJoin(Player player)
|
||||
|
||||
public boolean CanJoin(Player player)
|
||||
{
|
||||
return true;
|
||||
return !_locked || (player.isOp() || AdminList.contains(player.getName()));
|
||||
}
|
||||
|
||||
public boolean CanRename(Player player)
|
||||
{
|
||||
return true;
|
||||
return !_locked || (player.isOp() || AdminList.contains(player.getName()));
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,8 @@
|
||||
package mineplex.mapparser;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -19,6 +11,13 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.material.Wool;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class Parse
|
||||
{
|
||||
//Parse Data
|
||||
@ -59,14 +58,14 @@ public class Parse
|
||||
_size = size;
|
||||
|
||||
for (String arg : args)
|
||||
Host.Announce("Parse Arg: " + F.elem(arg));
|
||||
Host.announce("Parse Arg: " + F.elem(arg));
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
Host.Announce("Commencing Parse of World: " + F.elem(_world.getName()));
|
||||
Host.announce("Commencing Parse of World: " + F.elem(_world.getName()));
|
||||
|
||||
//Take BlockID Arguments
|
||||
for (String arg : _args)
|
||||
@ -77,7 +76,7 @@ public class Parse
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Host.Announce("Invalid Data ID: " + F.elem(arg));
|
||||
Host.announce("Invalid Data ID: " + F.elem(arg));
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +101,7 @@ public class Parse
|
||||
|
||||
_processed++;
|
||||
if (_processed % 10000000 == 0)
|
||||
Host.Announce("Scanning World: " + F.elem((int)(_processed/1000000) + "M of " + (int)(((_size*2)*(_size*2)*256)/1000000) + "M"));
|
||||
Host.announce("Scanning World: " + F.elem((int)(_processed/1000000) + "M of " + (int)(((_size*2)*(_size*2)*256)/1000000) + "M"));
|
||||
|
||||
Block block = _world.getBlockAt(_callLoc.getBlockX()+_x, _y, _callLoc.getBlockZ()+_z);
|
||||
|
||||
@ -144,7 +143,7 @@ public class Parse
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Host.Announce("Invalid Sign Data: " + UtilWorld.locToStr(block.getLocation()));
|
||||
Host.announce("Invalid Sign Data: " + UtilWorld.locToStr(block.getLocation()));
|
||||
}
|
||||
|
||||
//Add
|
||||
@ -176,21 +175,21 @@ public class Parse
|
||||
if (_cornerA == null)
|
||||
{
|
||||
_cornerA = wool.getLocation();
|
||||
Host.Announce("Corner A: " + UtilWorld.locToStrClean(_cornerA));
|
||||
Host.announce("Corner A: " + UtilWorld.locToStrClean(_cornerA));
|
||||
}
|
||||
|
||||
else if (_cornerB == null)
|
||||
{
|
||||
_cornerB = wool.getLocation();
|
||||
Host.Announce("Corner B: " + UtilWorld.locToStrClean(_cornerB));
|
||||
Host.announce("Corner B: " + UtilWorld.locToStrClean(_cornerB));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Host.Announce("More than 2 Corner Markers:");
|
||||
Host.Announce("Corner A: " + UtilWorld.locToStrClean(_cornerA));
|
||||
Host.Announce("Corner B: " + UtilWorld.locToStrClean(_cornerB));
|
||||
Host.Announce("Excess: " + UtilWorld.locToStrClean(wool.getLocation()));
|
||||
Host.announce("More than 2 Corner Markers:");
|
||||
Host.announce("Corner A: " + UtilWorld.locToStrClean(_cornerA));
|
||||
Host.announce("Corner B: " + UtilWorld.locToStrClean(_cornerB));
|
||||
Host.announce("Excess: " + UtilWorld.locToStrClean(wool.getLocation()));
|
||||
}
|
||||
|
||||
//Remove Blocks
|
||||
@ -414,7 +413,7 @@ public class Parse
|
||||
|
||||
if (_cornerA == null || _cornerB == null)
|
||||
{
|
||||
Host.Announce("Missing Corner Locations! Defaulted to -256 to +256.");
|
||||
Host.announce("Missing Corner Locations! Defaulted to -256 to +256.");
|
||||
|
||||
_cornerA = new Location(_world, -256, 0, -256);
|
||||
_cornerB = new Location(_world, 256, 0, 256);
|
||||
@ -487,12 +486,12 @@ public class Parse
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Host.Announce("Error: File Write Error");
|
||||
Host.announce("Error: File Write Error");
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Host.Announce("WorldConfig.dat Saved.");
|
||||
Host.announce("WorldConfig.dat Saved.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1,18 +1,17 @@
|
||||
package mineplex.mapparser;
|
||||
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.ZipUtil;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.ZipUtil;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
public class WorldManager
|
||||
{
|
||||
private MapParser Host;
|
||||
@ -99,7 +98,7 @@ public class WorldManager
|
||||
FileUtils.deleteQuietly(new File(world.getName() + File.separator + file.getName()));
|
||||
}
|
||||
|
||||
MapData data = Host.GetData(world.getName().replace("parse", "map"));
|
||||
MapData data = Host.getData(world.getName().replace("parse", "map"));
|
||||
GameType gameType = data.MapGameType;
|
||||
String fileName = gameType + "_" + data.MapName + ".zip";
|
||||
|
||||
|
@ -0,0 +1,58 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AddSplashTextCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public AddSplashTextCommand(MapParser plugin)
|
||||
{
|
||||
super(plugin, "addtext");
|
||||
setUsage("/addText <text>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
if(!player.isOp())
|
||||
{
|
||||
player.sendMessage(C.cRed + "You cannot do this command!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(args[0].equalsIgnoreCase("clear"))
|
||||
{
|
||||
getPlugin().getAdditionalText().clear();
|
||||
player.sendMessage(C.cRed + "Cleared all text.");
|
||||
return true;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < args.length; i++)
|
||||
{
|
||||
builder.append(args[i]);
|
||||
if ((i + 1) != args.length)
|
||||
{
|
||||
builder.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
getPlugin().addAdditionalText(builder.toString());
|
||||
player.sendMessage(C.cGreen + "Added text!");
|
||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', builder.toString()));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ public class AdminCommand extends BaseCommand
|
||||
}
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().GetData(world.getName()).HasAccess(player))
|
||||
if (!getPlugin().getData(world.getName()).HasAccess(player))
|
||||
{
|
||||
message(player, "You are not on Admin-List for this Map.");
|
||||
return true;
|
||||
@ -46,21 +46,21 @@ public class AdminCommand extends BaseCommand
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
if (data.AdminList.contains(other.getName()))
|
||||
{
|
||||
data.AdminList.remove(other.getName());
|
||||
data.Write();
|
||||
|
||||
getPlugin().Announce("Admin-List for " + F.elem(world.getName()) + " (" + other.getName() + " = " + F.tf(false) + ")");
|
||||
getPlugin().announce("Admin-List for " + F.elem(world.getName()) + " (" + other.getName() + " = " + F.tf(false) + ")");
|
||||
}
|
||||
else
|
||||
{
|
||||
data.AdminList.add(other.getName());
|
||||
data.Write();
|
||||
|
||||
getPlugin().Announce("Admin-List for " + F.elem(world.getName()) + " (" + other.getName() + " = " + F.tf(true) + ")");
|
||||
getPlugin().announce("Admin-List for " + F.elem(world.getName()) + " (" + other.getName() + " = " + F.tf(true) + ")");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
|
||||
@ -41,18 +40,18 @@ public class AuthorCommand extends BaseCommand
|
||||
}
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().GetData(world.getName()).HasAccess(player))
|
||||
if (!getPlugin().getData(world.getName()).HasAccess(player))
|
||||
{
|
||||
message(player, "You do not have Build-Access on this Map.");
|
||||
return true;
|
||||
}
|
||||
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
data.MapCreator = authorName;
|
||||
data.Write();
|
||||
|
||||
getPlugin().Announce("Map Author for " + F.elem(world.getName()) + " set to " + F.elem(authorName) + ".");
|
||||
getPlugin().announce("Map Author for " + F.elem(world.getName()) + " set to " + F.elem(authorName) + ".");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -50,19 +50,19 @@ public class CopyCommand extends BaseCommand
|
||||
String worldName = getPlugin().getWorldString(originalMapName, originalGametype);
|
||||
String newWorldName = getPlugin().getWorldString(newMapName, newGameType);
|
||||
|
||||
if (!getPlugin().DoesMapExist(worldName))
|
||||
if (!getPlugin().doesMapExist(worldName))
|
||||
{
|
||||
message(player, "Could not find a map with the name " + F.elem(originalMapName) + " of type " + F.elem(originalGametype.toString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getPlugin().DoesMapExist(newWorldName))
|
||||
if (getPlugin().doesMapExist(newWorldName))
|
||||
{
|
||||
message(player, "Destination map already exists " + F.elem(newMapName) + " of type " + F.elem(newGameType.toString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
World world = getPlugin().GetMapWorld(worldName);
|
||||
World world = getPlugin().getMapWorld(worldName);
|
||||
|
||||
if (world != null)
|
||||
{
|
||||
|
@ -1,18 +1,16 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.mapparser.GameType;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.WorldType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.mapparser.GameType;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
|
||||
/**
|
||||
* Created by Shaun on 8/16/2014.
|
||||
*/
|
||||
@ -28,7 +26,7 @@ public class CreateCommand extends BaseCommand
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
message(player, "Invalid Input. " + F.elem("/create <MapName>"));
|
||||
message(player, "Invalid Input. " + F.elem("/create <MapName> [-v]"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -36,21 +34,38 @@ public class CreateCommand extends BaseCommand
|
||||
|
||||
String worldName = "map/" + gameType.GetName() + "/" + args[0];
|
||||
|
||||
if (getPlugin().DoesMapExist(worldName))
|
||||
if (getPlugin().doesMapExist(worldName))
|
||||
{
|
||||
message(player, "Map name is already in use!");
|
||||
return true;
|
||||
}
|
||||
|
||||
getPlugin().Announce("Creating World: " + F.elem(worldName));
|
||||
boolean voidWorld = false;
|
||||
|
||||
if (args.length == 2)
|
||||
{
|
||||
voidWorld = args[1].equalsIgnoreCase("-v");
|
||||
}
|
||||
|
||||
|
||||
WorldCreator worldCreator = new WorldCreator(worldName);
|
||||
worldCreator.environment(World.Environment.NORMAL);
|
||||
worldCreator.type(WorldType.FLAT);
|
||||
if (voidWorld)
|
||||
{
|
||||
//Cheeky little trick, saves time and energy.
|
||||
worldCreator.generatorSettings("3;minecraft:air;2");
|
||||
getPlugin().announce("Creating World: " + F.elem(worldName) + " -" + C.cRed + "VOID");
|
||||
}
|
||||
else
|
||||
{
|
||||
getPlugin().announce("Creating World: " + F.elem(worldName));
|
||||
}
|
||||
|
||||
worldCreator.generateStructures(false);
|
||||
|
||||
World world = Bukkit.getServer().createWorld(worldCreator);
|
||||
|
||||
|
||||
world.setSpawnLocation(0, 100, 0);
|
||||
|
||||
message(player, "Teleporting to World: " + F.elem(worldName));
|
||||
@ -58,7 +73,7 @@ public class CreateCommand extends BaseCommand
|
||||
player.teleport(world.getSpawnLocation());
|
||||
|
||||
//Give Access
|
||||
MapData mapData = getPlugin().GetData(worldName);
|
||||
MapData mapData = getPlugin().getData(worldName);
|
||||
mapData.AdminList.add(player.getName());
|
||||
mapData.MapGameType = gameType;
|
||||
mapData.Write();
|
||||
|
@ -0,0 +1,38 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class CurrentlyLiveCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public CurrentlyLiveCommand(MapParser plugin, String... aliases)
|
||||
{
|
||||
super(plugin, "islive", "setlive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
MapData data = getPlugin().getData(player.getWorld().getName());
|
||||
|
||||
if(data == null)
|
||||
{
|
||||
player.sendMessage(C.cRed + "There was an error with your map.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(alias.equalsIgnoreCase("setlive"))
|
||||
{
|
||||
data._currentlyLive = true;
|
||||
}
|
||||
|
||||
player.sendMessage(C.cGray + "Currently Live: " + (data._currentlyLive ? C.cGreen + "True" : C.cRed + "False"));
|
||||
return true;
|
||||
}
|
||||
}
|
@ -44,21 +44,21 @@ public class DeleteCommand extends BaseCommand
|
||||
|
||||
final String worldName = getPlugin().getWorldString(mapName, gameType);
|
||||
|
||||
if (!getPlugin().DoesMapExist(worldName))
|
||||
if (!getPlugin().doesMapExist(worldName))
|
||||
{
|
||||
message(player, "Map does not exist: " + F.elem(worldName));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!getPlugin().GetData(worldName).HasAccess(player))
|
||||
if (!getPlugin().getData(worldName).HasAccess(player))
|
||||
{
|
||||
message(player, "You do not have Build-Access on this Map.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getPlugin().GetMapWorld(worldName) != null)
|
||||
if (getPlugin().getMapWorld(worldName) != null)
|
||||
{
|
||||
World world = getPlugin().GetMapWorld(worldName);
|
||||
World world = getPlugin().getMapWorld(worldName);
|
||||
|
||||
//Teleport Out
|
||||
for (Player other : world.getPlayers())
|
||||
@ -73,9 +73,9 @@ public class DeleteCommand extends BaseCommand
|
||||
boolean deleted = FileUtils.deleteQuietly(new File(worldName));
|
||||
|
||||
if (deleted)
|
||||
getPlugin().Announce("Deleted World: " + F.elem(worldName));
|
||||
getPlugin().announce("Deleted World: " + F.elem(worldName));
|
||||
else
|
||||
getPlugin().Announce("Failed to delete World: " + F.elem(worldName));
|
||||
getPlugin().announce("Failed to delete World: " + F.elem(worldName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2,13 +2,11 @@ package mineplex.mapparser.command;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.mapparser.GameType;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
@ -41,7 +39,7 @@ public class GameTypeCommand extends BaseCommand
|
||||
}
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().GetData(world.getName()).HasAccess(player))
|
||||
if (!getPlugin().getData(world.getName()).HasAccess(player))
|
||||
{
|
||||
message(player, "You do not have Build-Access on this Map.");
|
||||
return true;
|
||||
@ -59,7 +57,7 @@ public class GameTypeCommand extends BaseCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getPlugin().DoesMapExist(getPlugin().getShortWorldName(world.getName()), type))
|
||||
if (getPlugin().doesMapExist(getPlugin().getShortWorldName(world.getName()), type))
|
||||
{
|
||||
message(player, "A world with the same name already exists for the new gametype: " + type.GetName());
|
||||
return true;
|
||||
@ -85,11 +83,11 @@ public class GameTypeCommand extends BaseCommand
|
||||
message(player, "Map " + world.getName() + " renamed to " + newName);
|
||||
|
||||
|
||||
MapData data = getPlugin().GetData(newName);
|
||||
MapData data = getPlugin().getData(newName);
|
||||
data.MapGameType = type;
|
||||
data.Write();
|
||||
|
||||
getPlugin().Announce("GameType for " + F.elem(newName) + " set to " + F.elem(args[0]) + ".");
|
||||
getPlugin().announce("GameType for " + F.elem(newName) + " set to " + F.elem(args[0]) + ".");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -0,0 +1,81 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.mapparser.GameType;
|
||||
import mineplex.mapparser.GameTypeInfo;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class InfoCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public InfoCommand(MapParser plugin)
|
||||
{
|
||||
super(plugin, "info");
|
||||
setUsage("/info <gametype> & /info addInfo <gameType> <info>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
String gameRaw = args[0];
|
||||
GameType gameType;
|
||||
try
|
||||
{
|
||||
gameType = GameType.match(gameRaw);
|
||||
} catch (Exception e)
|
||||
{
|
||||
player.sendMessage(C.cRed + "Invalid Game Type: " + gameRaw);
|
||||
return true;
|
||||
}
|
||||
GameTypeInfo info = getPlugin().getInfo(gameType);
|
||||
if (info == null)
|
||||
{
|
||||
player.sendMessage(C.cRed + "No info found for " + gameType.GetName());
|
||||
return true;
|
||||
}
|
||||
info.sendInfo(player);
|
||||
return true;
|
||||
}
|
||||
if (args.length >= 3 && args[0].equalsIgnoreCase("addInfo"))
|
||||
{
|
||||
String gameRaw = args[1];
|
||||
GameType gameType;
|
||||
try
|
||||
{
|
||||
gameType = GameType.match(gameRaw);
|
||||
} catch (Exception e)
|
||||
{
|
||||
player.sendMessage(C.cRed + "Invalid Game Type: " + gameRaw);
|
||||
return true;
|
||||
}
|
||||
GameTypeInfo info = getPlugin().getInfo(gameType);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 2; i < args.length; i++)
|
||||
{
|
||||
builder.append(args[i]);
|
||||
if ((i + 1) != args.length)
|
||||
{
|
||||
builder.append(" ");
|
||||
}
|
||||
}
|
||||
if (info == null)
|
||||
{
|
||||
info = new GameTypeInfo(gameType, Lists.newArrayList());
|
||||
getPlugin().setInfo(gameType, info);
|
||||
}
|
||||
|
||||
info.addInfo(builder.toString());
|
||||
player.sendMessage(C.cGray + "Added new info to " + F.elem(gameRaw));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class LockCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public LockCommand(MapParser plugin)
|
||||
{
|
||||
super(plugin, "lock");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
MapData data = getPlugin().getData(player.getWorld().getName());
|
||||
|
||||
if(data == null)
|
||||
{
|
||||
player.sendMessage(C.cRed + "There was an error with your map.");
|
||||
return true;
|
||||
}
|
||||
|
||||
data._locked = !data._locked;
|
||||
player.sendMessage(F.tf(data._locked) + " lock for world " + player.getWorld().getName());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,19 +1,18 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.mapparser.GameType;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Shaun on 8/15/2014.
|
||||
@ -45,8 +44,9 @@ public class MapCommand extends BaseCommand
|
||||
if (possibleMaps.size() == 0)
|
||||
{
|
||||
message(player, "No maps found with the name: " + F.elem(args[0]));
|
||||
return true;
|
||||
}
|
||||
else if (possibleMaps.size() > 1)
|
||||
if (possibleMaps.size() > 1)
|
||||
{
|
||||
message(player, "Found more than one possible match:");
|
||||
for (String s : possibleMaps)
|
||||
@ -91,10 +91,10 @@ public class MapCommand extends BaseCommand
|
||||
System.out.println("Could not delete uid.dat for " + worldName);
|
||||
}
|
||||
|
||||
World world = getPlugin().GetMapWorld(worldName);
|
||||
World world = getPlugin().getMapWorld(worldName);
|
||||
if (world == null)
|
||||
{
|
||||
if (getPlugin().DoesMapExist(worldName))
|
||||
if (getPlugin().doesMapExist(worldName))
|
||||
{
|
||||
world = Bukkit.createWorld(new WorldCreator(worldName));
|
||||
}
|
||||
@ -113,7 +113,7 @@ public class MapCommand extends BaseCommand
|
||||
}
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().GetData(world.getName()).CanJoin(player))
|
||||
if (!getPlugin().getData(world.getName()).CanJoin(player))
|
||||
{
|
||||
message(player, "You do not have Join-Access on this Map.");
|
||||
return true;
|
||||
@ -124,7 +124,7 @@ public class MapCommand extends BaseCommand
|
||||
|
||||
player.teleport(new Location(world, 0, 106, 0));
|
||||
|
||||
MapData data = getPlugin().GetData(worldName);
|
||||
MapData data = getPlugin().getData(worldName);
|
||||
|
||||
UtilPlayer.message(player, F.value("Map Name", data.MapName));
|
||||
UtilPlayer.message(player, F.value("Author", data.MapCreator));
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
|
||||
@ -43,18 +42,18 @@ public class NameCommand extends BaseCommand
|
||||
mapName = mapName.trim();
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().GetData(world.getName()).HasAccess(player))
|
||||
if (!getPlugin().getData(world.getName()).HasAccess(player))
|
||||
{
|
||||
message(player, "You do not have Build-Access on this Map.");
|
||||
return true;
|
||||
}
|
||||
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
data.MapName = mapName;
|
||||
data.Write();
|
||||
|
||||
getPlugin().Announce("Map Name for " + F.elem(world.getName()) + " set to " + F.elem(mapName) + ".");
|
||||
getPlugin().announce("Map Name for " + F.elem(world.getName()) + " set to " + F.elem(mapName) + ".");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class PMCommand extends BaseCommand
|
||||
{
|
||||
public PMCommand(MapParser plugin)
|
||||
{
|
||||
super(plugin, "m", "message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
if(!player.isOp())
|
||||
{
|
||||
player.sendMessage(C.cRed + "You are not allowed to do that!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length == 0)
|
||||
{
|
||||
player.sendMessage(C.cRed + "Please put a message in!");
|
||||
return true;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for(String s : args)
|
||||
{
|
||||
builder.append(s).append(" ");
|
||||
}
|
||||
for(Player ops : UtilServer.getPlayers())
|
||||
{
|
||||
if(!ops.isOp())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ops.sendMessage(F.main("Message", builder.toString().trim()));
|
||||
ops.playSound(ops.getLocation(), Sound.NOTE_PLING, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -32,7 +32,7 @@ public class ParseCommand200 extends BaseCommand
|
||||
|
||||
World world = parseLoc.getWorld();
|
||||
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
if (data.MapName.equals("null") || data.MapCreator.equals("null") || data.MapGameType.equals("null"))
|
||||
{
|
||||
@ -57,7 +57,7 @@ public class ParseCommand200 extends BaseCommand
|
||||
}
|
||||
|
||||
//Parse the World
|
||||
getPlugin().setCurrentParse(new Parse(getPlugin(), parseableWorld, args, parseLoc, getPlugin().GetData(parseLoc.getWorld().getName()), 200));
|
||||
getPlugin().setCurrentParse(new Parse(getPlugin(), parseableWorld, args, parseLoc, getPlugin().getData(parseLoc.getWorld().getName()), 200));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class ParseCommand400 extends BaseCommand
|
||||
|
||||
World world = parseLoc.getWorld();
|
||||
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
if (data.MapName.equals("null") || data.MapCreator.equals("null") || data.MapGameType.equals("null"))
|
||||
{
|
||||
@ -57,7 +57,7 @@ public class ParseCommand400 extends BaseCommand
|
||||
}
|
||||
|
||||
//Parse the World
|
||||
getPlugin().setCurrentParse(new Parse(getPlugin(), parseableWorld, args, parseLoc, getPlugin().GetData(parseLoc.getWorld().getName()), 400));
|
||||
getPlugin().setCurrentParse(new Parse(getPlugin(), parseableWorld, args, parseLoc, getPlugin().getData(parseLoc.getWorld().getName()), 400));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class ParseCommand600 extends BaseCommand
|
||||
|
||||
World world = parseLoc.getWorld();
|
||||
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
if (data.MapName.equals("null") || data.MapCreator.equals("null") || data.MapGameType.equals("null"))
|
||||
{
|
||||
@ -57,7 +57,7 @@ public class ParseCommand600 extends BaseCommand
|
||||
}
|
||||
|
||||
//Parse the World
|
||||
getPlugin().setCurrentParse(new Parse(getPlugin(), parseableWorld, args, parseLoc, getPlugin().GetData(parseLoc.getWorld().getName()), 600));
|
||||
getPlugin().setCurrentParse(new Parse(getPlugin(), parseableWorld, args, parseLoc, getPlugin().getData(parseLoc.getWorld().getName()), 600));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class PlayerHeadCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public PlayerHeadCommand(MapParser plugin, String... aliases)
|
||||
{
|
||||
super(plugin, "playerhead");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
if(args.length == 1) {
|
||||
String name = args[0];
|
||||
ItemStack itemStack = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
|
||||
SkullMeta meta = (SkullMeta) itemStack.getItemMeta();
|
||||
meta.setOwner(name);
|
||||
itemStack.setItemMeta(meta);
|
||||
player.getInventory().addItem(itemStack);
|
||||
player.sendMessage(C.cGray + "Given " + F.elem(name) + "'s head");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class RefreshWorldEditCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public RefreshWorldEditCommand(MapParser plugin)
|
||||
{
|
||||
super(plugin, "refreshworldedit", "refreshwe", "wefresh");
|
||||
setUsage("/refreshwe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
Bukkit.broadcastMessage(F.name(player.getName()) + " is reloading World Edit");
|
||||
Plugin plugin = getPlugin().getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
plugin.onDisable();
|
||||
plugin.onEnable();
|
||||
Bukkit.broadcastMessage(F.name(player.getName()) + " has reloaded World Edit");
|
||||
return true;
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@ package mineplex.mapparser.command;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -25,7 +24,7 @@ public class RenameCommand extends BaseCommand
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
World world = player.getWorld();
|
||||
MapData data = getPlugin().GetData(world.getName());
|
||||
MapData data = getPlugin().getData(world.getName());
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
|
@ -48,11 +48,11 @@ public class SaveCommand extends BaseCommand
|
||||
}
|
||||
|
||||
String worldName = possibleMaps.get(0);
|
||||
World world = getPlugin().GetMapWorld(worldName);
|
||||
World world = getPlugin().getMapWorld(worldName);
|
||||
|
||||
if (world != null)
|
||||
{
|
||||
if (!getPlugin().GetData(worldName).HasAccess(player))
|
||||
if (!getPlugin().getData(worldName).HasAccess(player))
|
||||
{
|
||||
message(player, "You do not have Build-Access on this Map.");
|
||||
return true;
|
||||
@ -71,7 +71,7 @@ public class SaveCommand extends BaseCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
getPlugin().Announce("Saved World: " + F.elem(args[0]));
|
||||
getPlugin().announce("Saved World: " + F.elem(args[0]));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -0,0 +1,82 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class WarpCommand extends BaseCommand
|
||||
{
|
||||
|
||||
public WarpCommand(MapParser plugin)
|
||||
{
|
||||
super(plugin, "warp");
|
||||
setUsage("/warp <name> & /warp <set> <name>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String alias, String[] args)
|
||||
{
|
||||
MapData data = getPlugin().getData(player.getWorld().getName());
|
||||
|
||||
if(data == null)
|
||||
{
|
||||
player.sendMessage(C.cRed + "There was an error with your map.");
|
||||
return true;
|
||||
}
|
||||
|
||||
Map<String, Location> warps = data._warps;
|
||||
|
||||
if(args.length == 1)
|
||||
{
|
||||
if(args[0].equalsIgnoreCase("list"))
|
||||
{
|
||||
for(String s : warps.keySet())
|
||||
{
|
||||
player.sendMessage(F.elem(s) + " @ " + F.elem(UtilWorld.locToStrClean(warps.get(s))));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Location location = warps.get(args[0].toLowerCase());
|
||||
|
||||
if(location == null){
|
||||
player.sendMessage(C.cRed + "Unknown warp!");
|
||||
return true;
|
||||
}
|
||||
|
||||
player.sendMessage(C.cGray + "Warping to " + F.elem(args[0]));
|
||||
player.teleport(location);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length == 2)
|
||||
{
|
||||
if(!args[0].equalsIgnoreCase("set"))
|
||||
{
|
||||
player.sendMessage(C.cRed + "Please use " + F.elem("/warp set <name>") + C.cRed + " to set a warp");
|
||||
return true;
|
||||
}
|
||||
String warp = args[1].toLowerCase();
|
||||
if(warps.containsKey(warp))
|
||||
{
|
||||
player.sendMessage(C.cRed + "That warp already exists!");
|
||||
return true;
|
||||
}
|
||||
warps.put(warp, player.getLocation());
|
||||
player.sendMessage(C.cGray + "Created a new warp: " + F.elem(warp));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package mineplex.mapparser.module;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public abstract class Module implements Listener
|
||||
{
|
||||
|
||||
private MapParser _plugin;
|
||||
private String _name;
|
||||
|
||||
public Module(String name, MapParser plugin) {
|
||||
_name = name;
|
||||
_plugin = plugin;
|
||||
register();
|
||||
plugin.getModules().put(this.getClass(), this);
|
||||
}
|
||||
|
||||
public void register()
|
||||
{
|
||||
_plugin.getServer().getPluginManager().registerEvents(this, _plugin);
|
||||
}
|
||||
|
||||
public MapParser getPlugin()
|
||||
{
|
||||
return _plugin;
|
||||
}
|
||||
|
||||
public MapData GetData(String world)
|
||||
{
|
||||
return getPlugin().getData(world);
|
||||
}
|
||||
|
||||
public void displayHelp(Player player)
|
||||
{
|
||||
MapData data = GetData(player.getWorld().getName());
|
||||
player.sendMessage(C.cGray + "Currently Live: " + (data._currentlyLive ? C.cGreen + "True" : C.cRed + "False"));
|
||||
for(String s : getPlugin().getAdditionalText())
|
||||
{
|
||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', s));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package mineplex.mapparser.module.modules;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import mineplex.mapparser.command.BaseCommand;
|
||||
import mineplex.mapparser.module.Module;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class CommandModule extends Module
|
||||
{
|
||||
private Map<String, BaseCommand> _commands = Maps.newHashMap();
|
||||
private Map<String, BaseCommand> _commandsByAlias = Maps.newHashMap();
|
||||
|
||||
public CommandModule(MapParser plugin)
|
||||
{
|
||||
super("Commands", plugin);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
String[] parts = event.getMessage().split(" ");
|
||||
String commandLabel = parts[0].substring(1);
|
||||
String[] args = new String[parts.length - 1];
|
||||
System.arraycopy(parts, 1, args, 0, parts.length - 1);
|
||||
|
||||
if (getPlugin().getCurParse() != null)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Parser", "Cannot use commands during Map Parse!"));
|
||||
return;
|
||||
}
|
||||
if (event.getMessage().toLowerCase().startsWith("/help"))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
displayHelp(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (commandLabel.equalsIgnoreCase("gmc"))
|
||||
{
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (commandLabel.equalsIgnoreCase("gms"))
|
||||
{
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (commandLabel.equalsIgnoreCase("gmsp"))
|
||||
{
|
||||
player.setGameMode(GameMode.SPECTATOR);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
BaseCommand baseCommand = _commands.get(commandLabel.toLowerCase());
|
||||
|
||||
if (baseCommand == null)
|
||||
{
|
||||
baseCommand = _commandsByAlias.get(commandLabel.toLowerCase());
|
||||
if (baseCommand == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
if (!baseCommand.execute(player, commandLabel, args))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Parser", "Invalid Input."));
|
||||
UtilPlayer.message(player, F.elem(baseCommand.getUsage()));
|
||||
}
|
||||
}
|
||||
|
||||
public void add(BaseCommand baseCommand)
|
||||
{
|
||||
_commands.put(baseCommand.getAliases().get(0).toLowerCase(), baseCommand);
|
||||
for (String label : baseCommand.getAliases())
|
||||
{
|
||||
_commandsByAlias.put(label.toLowerCase(), baseCommand);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,354 @@
|
||||
package mineplex.mapparser.module.modules;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.mapparser.BackupTask;
|
||||
import mineplex.mapparser.MapData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import mineplex.mapparser.Parse;
|
||||
import mineplex.mapparser.TickEvent;
|
||||
import mineplex.mapparser.module.Module;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
import org.bukkit.event.block.BlockFormEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.block.LeavesDecayEvent;
|
||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class EventModule extends Module
|
||||
{
|
||||
|
||||
private List<World> _updated = Lists.newArrayList();
|
||||
|
||||
public EventModule(MapParser plugin)
|
||||
{
|
||||
super("Events", plugin);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
player.teleport(getPlugin().getSpawnLocation());
|
||||
|
||||
displayHelp(player);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onTick(TickEvent event)
|
||||
{
|
||||
for (World world : getPlugin().getServer().getWorlds())
|
||||
{
|
||||
if (_updated.contains(world))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (world.getName().toLowerCase().contains("halloween"))
|
||||
{
|
||||
world.setTime(16000);
|
||||
} else
|
||||
{
|
||||
world.setTime(8000);
|
||||
}
|
||||
_updated.add(world);
|
||||
world.setStorm(false);
|
||||
world.setGameRuleValue("doDaylightCycle", "false");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onParseUpdate(TickEvent event)
|
||||
{
|
||||
if (getPlugin().getCurParse() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Parse parse = getPlugin().getCurParse();
|
||||
|
||||
if (parse.Update())
|
||||
{
|
||||
getPlugin().announce("Parse Completed!");
|
||||
|
||||
getPlugin().announce("Cleaning and Creating ZIP...");
|
||||
|
||||
try
|
||||
{
|
||||
getPlugin().getWorldManager().finalizeParsedWorld(parse.getWorld());
|
||||
} catch (Exception e)
|
||||
{
|
||||
getPlugin().announce("Creating ZIP Failed! Please Try Again!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
getPlugin().setCurrentParse(null);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void SaveUnloadWorlds(TickEvent event)
|
||||
{
|
||||
for (World world : getPlugin().getServer().getWorlds())
|
||||
{
|
||||
if (world.getName().equalsIgnoreCase("world"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (world.getName().startsWith("parse_"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!world.getName().startsWith("map"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (world.getPlayers().isEmpty())
|
||||
{
|
||||
getPlugin().announce("Saving & Closing World: " + F.elem(world.getName()));
|
||||
MapUtil.UnloadWorld(getPlugin(), world, true);
|
||||
_updated.remove(world);
|
||||
getPlugin()._mapsBeingZipped.add(world.getName());
|
||||
System.out.println("Starting backup of " + world);
|
||||
new BackupTask(getPlugin(), world.getName(), data ->
|
||||
{
|
||||
System.out.println("Finished backup of " + world);
|
||||
getPlugin()._mapsBeingZipped.remove(world.getName());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Chat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
String world = C.cDGreen + C.Bold + getPlugin().getShortWorldName(event.getPlayer().getWorld().getName());
|
||||
|
||||
String name = C.cYellow + event.getPlayer().getName();
|
||||
if (getPlugin().getData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
name = C.cGreen + event.getPlayer().getName();
|
||||
}
|
||||
|
||||
String grayName = C.cBlue + event.getPlayer().getName();
|
||||
String grayWorld = C.cBlue + C.Bold + event.getPlayer().getWorld().getName();
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (player.getWorld().equals(event.getPlayer().getWorld()))
|
||||
{
|
||||
player.sendMessage(world + ChatColor.RESET + " " + name + ChatColor.RESET + " " + event.getMessage());
|
||||
} else
|
||||
{
|
||||
player.sendMessage(grayWorld + ChatColor.RESET + " " + grayName + ChatColor.RESET + " " + C.cGray + event.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
System.out.println(world + ChatColor.RESET + " " + name + ChatColor.RESET + " " + event.getMessage());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void InteractCancel(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.getPlayer().isOp())
|
||||
{
|
||||
return;
|
||||
}
|
||||
//Permission
|
||||
if (!getPlugin().getData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void TeleportCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (!event.getMessage().toLowerCase().startsWith("/tp"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
String[] tokens = event.getMessage().split(" ");
|
||||
|
||||
if (tokens.length != 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
Player target = UtilPlayer.searchOnline(player, tokens[1], true);
|
||||
if (target != null)
|
||||
{
|
||||
MapData data = getPlugin().getData(target.getWorld().getName());
|
||||
if(!data.CanJoin(player))
|
||||
{
|
||||
player.sendMessage(C.cRed + "That server is currently locked, and you don't have access to it.");
|
||||
return;
|
||||
}
|
||||
UtilPlayer.message(player, F.main("Game", "You teleported to " + F.name(target.getName()) + "."));
|
||||
player.teleport(target);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void commandCancel(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (event.getMessage().startsWith("/tp") ||
|
||||
event.getMessage().startsWith("/hub") ||
|
||||
event.getMessage().startsWith("/list") ||
|
||||
event.getMessage().startsWith("/map") ||
|
||||
event.getMessage().startsWith("/create") ||
|
||||
event.getMessage().startsWith("/copy") ||
|
||||
event.getMessage().startsWith("/delete"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().getData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Parser", "You do not have Build-Access for this Map."));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void FlySpeed(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (!event.getMessage().toLowerCase().startsWith("/speed"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
String[] tokens = event.getMessage().split(" ");
|
||||
|
||||
if (tokens.length != 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
try
|
||||
{
|
||||
float speed = Float.parseFloat(tokens[1]);
|
||||
|
||||
player.setFlySpeed(speed);
|
||||
|
||||
UtilPlayer.message(player, F.main("Game", "Fly Speed set to " + F.elem("" + speed) + "."));
|
||||
} catch (Exception e)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "Invalid Speed Input."));
|
||||
}
|
||||
}
|
||||
|
||||
//#################################################################################################
|
||||
//# #
|
||||
//# Simple methods #
|
||||
//# #
|
||||
//# #
|
||||
//#################################################################################################
|
||||
|
||||
@EventHandler
|
||||
public void Join(PlayerJoinEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
if (player.getName().equalsIgnoreCase("TadahTech"))
|
||||
{
|
||||
event.setJoinMessage(C.cGreenB + "Your build server Saviour, TIMOTHY! has arrived, please take a moment to thank him.");
|
||||
getPlugin().getServer().getOnlinePlayers().forEach(o -> o.playSound(o.getLocation(), Sound.AMBIENCE_THUNDER, 1.0F, 1.0F));
|
||||
return;
|
||||
}
|
||||
event.setJoinMessage(F.sys("Player Join", event.getPlayer().getName()));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Join(PlayerQuitEvent event)
|
||||
{
|
||||
event.setQuitMessage(F.sys("Player Quit", event.getPlayer().getName()));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDroppedItemSpawn(EntitySpawnEvent event)
|
||||
{
|
||||
if (event.getEntityType() != EntityType.ARMOR_STAND)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void DisableBurn(BlockBurnEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableIgnite(BlockIgniteEvent event)
|
||||
{
|
||||
if (event.getCause() == IgniteCause.LAVA || event.getCause() == IgniteCause.SPREAD)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableFire(BlockSpreadEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableFade(BlockFadeEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableDecay(LeavesDecayEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableIceForm(BlockFormEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package mineplex.mapparser.module.modules;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import mineplex.mapparser.module.Module;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class MMMazeModule extends Module
|
||||
{
|
||||
|
||||
public MMMazeModule(MapParser plugin)
|
||||
{
|
||||
super("MM-Maze", plugin);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void mmMazeParser(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) return;
|
||||
|
||||
//Permission
|
||||
if (!GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.WEB))
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
// parse
|
||||
|
||||
Block clicked = event.getClickedBlock();
|
||||
Location center = clicked.getLocation();
|
||||
Location lowestCorner = center.clone().subtract(49, 0, 49);
|
||||
|
||||
// 0 = air or other
|
||||
// 1 = path - quartz
|
||||
// 2 = mob spawn - gold
|
||||
// 3 = safe spawn - stone
|
||||
|
||||
int[][] maze = new int[99][99];
|
||||
|
||||
for (int i = 0; i < 99; i++)
|
||||
for (int j = 0; j < 99; j++)
|
||||
maze[i][j] = getMMParseValue(lowestCorner.clone().add(j, 0, i).getBlock().getType());
|
||||
|
||||
//Save
|
||||
try
|
||||
{
|
||||
FileWriter fstream = new FileWriter(GetData(player.getWorld().getName()).MapFolder + File.separator + "Maze.dat");
|
||||
BufferedWriter out = new BufferedWriter(fstream);
|
||||
|
||||
out.write("private static final int[][] PARSED_MAZE = {" + System.lineSeparator());
|
||||
for (int j[] : maze)
|
||||
{
|
||||
out.write("{");
|
||||
boolean first = true;
|
||||
for (int k : j)
|
||||
{
|
||||
if(!first) out.write(",");
|
||||
out.write(k + "");
|
||||
|
||||
first = false;
|
||||
}
|
||||
out.write("}," + System.lineSeparator());
|
||||
}
|
||||
out.write("};" + System.lineSeparator());
|
||||
|
||||
out.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
player.sendMessage(C.cRed + C.Bold + "MMMazeParse: " + ChatColor.RESET + "An error has occured, see console.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
player.sendMessage(C.cGreen + C.Bold + "MMMazeParse: " + ChatColor.RESET + "Maze parsed.");
|
||||
}
|
||||
|
||||
private int getMMParseValue(Material m)
|
||||
{
|
||||
switch (m) {
|
||||
case QUARTZ_BLOCK:
|
||||
return 1;
|
||||
|
||||
case GOLD_BLOCK:
|
||||
return 2;
|
||||
|
||||
case STONE:
|
||||
return 3;
|
||||
|
||||
case DIRT:
|
||||
return 4;
|
||||
|
||||
case COBBLESTONE:
|
||||
return 5;
|
||||
|
||||
case BRICK:
|
||||
return 6;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package mineplex.mapparser.module.modules;
|
||||
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import mineplex.mapparser.module.Module;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class SignModule extends Module
|
||||
{
|
||||
public SignModule(MapParser plugin)
|
||||
{
|
||||
super("Sign", plugin);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void signChangeLog(SignChangeEvent event)
|
||||
{
|
||||
if (GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
ArrayList<String> text = new ArrayList<>();
|
||||
|
||||
text.add("Date: " + UtilTime.now());
|
||||
text.add("Player: " + event.getPlayer().getName());
|
||||
text.add("Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation()));
|
||||
for (int i = 0; i < event.getLines().length; i++)
|
||||
{
|
||||
text.add("Line " + i + ": " + event.getLines()[i]);
|
||||
}
|
||||
writeSignLog(text, event.getPlayer().getWorld());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void signCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (event.getMessage().toLowerCase().contains("set"))
|
||||
{
|
||||
ArrayList<String> text = new ArrayList<>();
|
||||
|
||||
text.add("Date: " + UtilTime.now());
|
||||
text.add("Player: " + event.getPlayer().getName());
|
||||
text.add("Location: " + UtilWorld.locToStrClean(event.getPlayer().getLocation()));
|
||||
text.add("Message: " + event.getMessage());
|
||||
|
||||
writeSignCommandLog(text, event.getPlayer().getWorld());
|
||||
}
|
||||
}
|
||||
|
||||
public void writeSignCommandLog(ArrayList<String> text, World world)
|
||||
{
|
||||
try
|
||||
{
|
||||
File file = new File(world.getName() + "/" + "command_sign_log.txt");
|
||||
|
||||
if (!file.exists())
|
||||
{
|
||||
file.createNewFile();
|
||||
}
|
||||
|
||||
FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
|
||||
BufferedWriter bw = new BufferedWriter(fw);
|
||||
|
||||
bw.write("\n\n");
|
||||
for (String line : text)
|
||||
bw.write("\n" + line);
|
||||
|
||||
bw.close();
|
||||
} catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void writeSignLog(ArrayList<String> text, World world)
|
||||
{
|
||||
try
|
||||
{
|
||||
File file = new File(world.getName() + "/" + "sign_log.txt");
|
||||
|
||||
if (!file.exists())
|
||||
{
|
||||
file.createNewFile();
|
||||
}
|
||||
|
||||
FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
|
||||
BufferedWriter bw = new BufferedWriter(fw);
|
||||
|
||||
bw.write("\n\n");
|
||||
for (String line : text)
|
||||
bw.write("\n" + line);
|
||||
|
||||
bw.close();
|
||||
} catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package mineplex.mapparser.module.modules;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.mapparser.BlockData;
|
||||
import mineplex.mapparser.MapParser;
|
||||
import mineplex.mapparser.module.Module;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TreeToolModule extends Module
|
||||
{
|
||||
|
||||
private Map<UUID, List<Set<BlockData>>> _treeHistory = Maps.newHashMap();
|
||||
|
||||
public TreeToolModule(MapParser plugin)
|
||||
{
|
||||
super("TreeTool", plugin);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void treeRemover(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//Permission
|
||||
if (!getPlugin().getData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.NETHER_STAR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
//Remove
|
||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK)
|
||||
{
|
||||
if (event.getClickedBlock().getType() != Material.LOG)
|
||||
{
|
||||
player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Left-Click on Log");
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Block> toRemove = getPlugin().searchLog(Sets.newHashSet(), event.getClickedBlock());
|
||||
|
||||
if (toRemove.isEmpty())
|
||||
{
|
||||
player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Left-Click on Log");
|
||||
return;
|
||||
}
|
||||
|
||||
Set<BlockData> history = Sets.newHashSet();
|
||||
|
||||
for (Block block : toRemove)
|
||||
{
|
||||
history.add(new BlockData(block));
|
||||
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
|
||||
if (!_treeHistory.containsKey(player.getUniqueId()))
|
||||
{
|
||||
_treeHistory.put(player.getUniqueId(), Lists.newArrayList());
|
||||
}
|
||||
|
||||
_treeHistory.get(player.getUniqueId()).add(0, history);
|
||||
|
||||
player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Tree Removed");
|
||||
|
||||
while (_treeHistory.get(player.getUniqueId()).size() > 10)
|
||||
{
|
||||
_treeHistory.get(player.getUniqueId()).remove(10);
|
||||
}
|
||||
|
||||
} else if (UtilEvent.isAction(event, ActionType.R))
|
||||
{
|
||||
if (!_treeHistory.containsKey(player.getUniqueId()) || _treeHistory.get(player.getUniqueId()).isEmpty())
|
||||
{
|
||||
player.sendMessage(C.cGreen + C.Bold + "TreeTool: " + ChatColor.RESET + "No Tree History");
|
||||
return;
|
||||
}
|
||||
|
||||
Set<BlockData> datas = _treeHistory.get(player.getUniqueId()).remove(0);
|
||||
|
||||
datas.forEach(BlockData::restore);
|
||||
|
||||
player.sendMessage(C.cGreen + C.Bold + "TreeTool: " + ChatColor.RESET + "Tree Restored");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -44,6 +44,7 @@ public class CustomDamageEvent extends Event implements Cancellable
|
||||
private boolean _damageeBrute = false;
|
||||
private boolean _damageToLevel = true;
|
||||
private boolean _arrowShow = true;
|
||||
private boolean _projectileDamageSelf = false;
|
||||
|
||||
public CustomDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile projectile, Location knockbackOrigin,
|
||||
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor, String initialSource,
|
||||
@ -169,6 +170,27 @@ public class CustomDamageEvent extends Event implements Cancellable
|
||||
return _projectile;
|
||||
}
|
||||
|
||||
public boolean getProjectileDamageSelf()
|
||||
{
|
||||
return _projectileDamageSelf;
|
||||
}
|
||||
|
||||
public void setProjectileDamageSelf(boolean projectileDamageSelf)
|
||||
{
|
||||
_projectileDamageSelf = projectileDamageSelf;
|
||||
if(!projectileDamageSelf)
|
||||
{
|
||||
_cancellers.remove("Self Projectile Damage");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!_cancellers.contains("Self Projectile Damage"))
|
||||
{
|
||||
_cancellers.add("Self Projectile Damage");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setShowArrows(boolean show)
|
||||
{
|
||||
_arrowShow = show;
|
||||
|
@ -8,24 +8,6 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
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_8_R3.DamageSource;
|
||||
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -48,6 +30,24 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
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_8_R3.DamageSource;
|
||||
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
|
||||
public class DamageManager extends MiniPlugin
|
||||
{
|
||||
private CombatManager _combatManager;
|
||||
@ -240,18 +240,33 @@ public class DamageManager extends MiniPlugin
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void removeDemArrowsCrazyMan(EntityDamageEvent event)
|
||||
/**
|
||||
* Removes arrows after hit, especially in cases where arrows may bounce, like if the damage was cancelled.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void removeArrows(EntityDamageEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
Projectile projectile = GetProjectile(event);
|
||||
Projectile projectile = GetProjectile(event);
|
||||
|
||||
if (projectile instanceof Arrow)
|
||||
{
|
||||
projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0));
|
||||
projectile.remove();
|
||||
}
|
||||
if (projectile instanceof Arrow)
|
||||
{
|
||||
projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0));
|
||||
projectile.remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes arrows after hit, especially in cases where arrows may bounce, like if the damage was cancelled.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void removeArrows(CustomDamageEvent event)
|
||||
{
|
||||
Projectile projectile = event.GetProjectile();
|
||||
|
||||
if (projectile instanceof Arrow)
|
||||
{
|
||||
projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0));
|
||||
projectile.remove();
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -318,6 +333,12 @@ public class DamageManager extends MiniPlugin
|
||||
event.SetCancelled("0 Health");
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.GetProjectile() != null && event.GetDamageeEntity().equals(event.GetProjectile().getShooter()) && !event.getProjectileDamageSelf())
|
||||
{
|
||||
event.SetCancelled("Self Projectile Damage");
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.GetDamageePlayer() != null)
|
||||
{
|
||||
@ -378,6 +399,10 @@ public class DamageManager extends MiniPlugin
|
||||
Player damagee = event.GetDamageePlayer();
|
||||
if (damagee != null)
|
||||
{
|
||||
if (event.GetDamage() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()) > 0)
|
||||
{
|
||||
event.AddMult("Ench Prot", damagee.getName(), getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()), false);
|
||||
@ -435,6 +460,8 @@ public class DamageManager extends MiniPlugin
|
||||
Player player = event.GetDamagerPlayer(true);
|
||||
if (player != null)
|
||||
{
|
||||
if (player.equals(event.GetDamageeEntity()) && !event.getProjectileDamageSelf()) return;
|
||||
|
||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
@ -459,6 +486,11 @@ public class DamageManager extends MiniPlugin
|
||||
if (event.GetDamageeEntity().getHealth() <= 0)
|
||||
return;
|
||||
|
||||
if (event.GetProjectile() != null &&
|
||||
event.GetDamageeEntity().equals(event.GetProjectile().getShooter()) &&
|
||||
!event.getProjectileDamageSelf())
|
||||
return;
|
||||
|
||||
//Player Conditions
|
||||
if (event.GetDamageePlayer() != null)
|
||||
{
|
||||
@ -513,14 +545,21 @@ public class DamageManager extends MiniPlugin
|
||||
origin = event.GetDamagerEntity(true).getLocation();
|
||||
if (event.getKnockbackOrigin() != null)
|
||||
origin = event.getKnockbackOrigin();
|
||||
else if (event.GetProjectile() != null)
|
||||
origin = event.GetProjectile().getLocation();
|
||||
|
||||
//Vec
|
||||
Vector trajectory = UtilAlg.getTrajectory2d(origin, event.GetDamageeEntity().getLocation());
|
||||
trajectory.multiply(0.6 * knockback);
|
||||
trajectory.setY(Math.abs(trajectory.getY()));
|
||||
|
||||
|
||||
//Special handling for projectiles
|
||||
if(event.GetProjectile() != null && event.getKnockbackOrigin() == null)
|
||||
{
|
||||
trajectory = event.GetProjectile().getVelocity();
|
||||
trajectory.setY(0);
|
||||
trajectory.multiply(0.6 * knockback / trajectory.length());
|
||||
trajectory.setY(0.5);
|
||||
}
|
||||
|
||||
//Apply
|
||||
double vel = 0.2 + trajectory.length() * 0.8;
|
||||
|
||||
|
@ -24,6 +24,8 @@ public class ServerGroup
|
||||
private int _requiredTotalServers;
|
||||
private int _requiredJoinableServers;
|
||||
|
||||
private String _uptimes = "";
|
||||
|
||||
private boolean _arcadeGroup;
|
||||
private String _worldZip;
|
||||
private String _plugin;
|
||||
@ -78,6 +80,7 @@ public class ServerGroup
|
||||
_requiredTotalServers = Integer.valueOf(data.get("totalServers"));
|
||||
_requiredJoinableServers = Integer.valueOf(data.get("joinableServers"));
|
||||
_portSection = Integer.valueOf(data.get("portSection"));
|
||||
_uptimes = data.containsKey("uptimes") ? data.get("uptimes") : "";
|
||||
_arcadeGroup = Boolean.valueOf(data.get("arcadeGroup"));
|
||||
_worldZip = data.get("worldZip");
|
||||
_plugin = data.get("plugin");
|
||||
@ -120,7 +123,7 @@ public class ServerGroup
|
||||
parseServers(serverStatuses);
|
||||
}
|
||||
|
||||
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, boolean arcade, String worldZip, String plugin, String configPath
|
||||
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, String uptimes, boolean arcade, String worldZip, String plugin, String configPath
|
||||
, int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String modes, String boosterGroup, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin
|
||||
, boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean rewardGems, boolean rewardItems, boolean rewardStats
|
||||
, boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region
|
||||
@ -134,6 +137,7 @@ public class ServerGroup
|
||||
_requiredTotalServers = totalServers;
|
||||
_requiredJoinableServers = joinable;
|
||||
_portSection = portSection;
|
||||
_uptimes = uptimes;
|
||||
_arcadeGroup = arcade;
|
||||
_worldZip = worldZip;
|
||||
_plugin = plugin;
|
||||
@ -232,6 +236,7 @@ public class ServerGroup
|
||||
public String getServerNpcName() { return _npcName; }
|
||||
public String getPortalBottomCornerLocation() { return _portalBottomCornerLocation; }
|
||||
public String getPortalTopCornerLocation() { return _portalTopCornerLocation; }
|
||||
public String getUptimes() { return _uptimes; }
|
||||
|
||||
public Set<MinecraftServer> getServers() { return _servers; }
|
||||
|
||||
@ -358,6 +363,7 @@ public class ServerGroup
|
||||
_dataMap.put("totalServers", _requiredTotalServers + "");
|
||||
_dataMap.put("joinableServers", _requiredJoinableServers + "");
|
||||
_dataMap.put("portSection", _portSection + "");
|
||||
_dataMap.put("uptimes", _uptimes);
|
||||
_dataMap.put("arcadeGroup", _arcadeGroup + "");
|
||||
_dataMap.put("worldZip", _worldZip);
|
||||
_dataMap.put("plugin", _plugin);
|
||||
@ -368,6 +374,7 @@ public class ServerGroup
|
||||
_dataMap.put("tournament", _tournament + "");
|
||||
_dataMap.put("tournamentPoints", _tournamentPoints + "");
|
||||
_dataMap.put("games", _games);
|
||||
_dataMap.put("modes", _modes);
|
||||
_dataMap.put("serverType", _serverType);
|
||||
_dataMap.put("addNoCheat", _addNoCheat + "");
|
||||
_dataMap.put("teamRejoin", _teamRejoin + "");
|
||||
|
@ -3,37 +3,38 @@ package mineplex.votifier;
|
||||
import java.sql.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.vexsoftware.votifier.model.Vote;
|
||||
import com.vexsoftware.votifier.model.VotifierEvent;
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.bonuses.BonusAmount;
|
||||
import mineplex.core.bonuses.BonusManager;
|
||||
import mineplex.core.bonuses.redis.VotifierCommand;
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UUIDFetcher;
|
||||
import mineplex.serverdata.database.DBPool;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.bonuses.redis.VotifierCommand;
|
||||
import mineplex.database.Tables;
|
||||
import mineplex.database.tables.records.BonusRecord;
|
||||
import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.Utility;
|
||||
import mineplex.serverdata.commands.ServerCommand;
|
||||
import mineplex.serverdata.data.PlayerStatus;
|
||||
import mineplex.serverdata.database.DBPool;
|
||||
import mineplex.serverdata.redis.RedisConfig;
|
||||
import mineplex.serverdata.redis.RedisDataRepository;
|
||||
import mineplex.serverdata.servers.ServerManager;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
|
||||
import com.vexsoftware.votifier.model.Vote;
|
||||
import com.vexsoftware.votifier.model.VotifierEvent;
|
||||
|
||||
/**
|
||||
* Created by shaun on 15-08-05.
|
||||
@ -106,7 +107,7 @@ public class VotifierManager extends MiniPlugin
|
||||
awardBonus(playerName, finalUuid, new Callback<Integer>()
|
||||
{
|
||||
@Override
|
||||
public void run(final Integer gems)
|
||||
public void run(final Integer shards)
|
||||
{
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@ -116,13 +117,13 @@ public class VotifierManager extends MiniPlugin
|
||||
if (usStatus != null)
|
||||
{
|
||||
System.out.println("Found " + playerName + " on US " + usStatus.getServer());
|
||||
notifyServer(playerName, gems, Region.US, usStatus.getServer());
|
||||
notifyServer(playerName, shards, Region.US, usStatus.getServer());
|
||||
}
|
||||
|
||||
if (euStatus != null)
|
||||
{
|
||||
System.out.println("Found " + playerName + " on EU " + euStatus.getServer());
|
||||
notifyServer(playerName, gems, Region.EU, euStatus.getServer());
|
||||
notifyServer(playerName, shards, Region.EU, euStatus.getServer());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -168,11 +169,11 @@ public class VotifierManager extends MiniPlugin
|
||||
// notifyServer(playerName, true);
|
||||
}
|
||||
|
||||
private void notifyServer(String playerName, int gems, Region region, String targetServer)
|
||||
private void notifyServer(String playerName, int shards, Region region, String targetServer)
|
||||
{
|
||||
JedisPool writePool = region == Region.EU ? _euWritePool : _usWritePool;
|
||||
|
||||
VotifierCommand command = new VotifierCommand(playerName, gems, targetServer);
|
||||
VotifierCommand command = new VotifierCommand(playerName, shards, targetServer);
|
||||
publishCommand(command, writePool);
|
||||
}
|
||||
|
||||
@ -222,9 +223,9 @@ public class VotifierManager extends MiniPlugin
|
||||
public void run(Boolean data)
|
||||
{
|
||||
if (data)
|
||||
System.out.println("Gave " + amount.getGems() + " coins to " + playerName);
|
||||
System.out.println("Gave " + amount.getCoins() + " coins to " + playerName);
|
||||
else
|
||||
System.out.println("Failed to give " + amount.getGems() + " coins to " + playerName);
|
||||
System.out.println("Failed to give " + amount.getCoins() + " coins to " + playerName);
|
||||
}
|
||||
}, "Votifier", playerName, accountId, amount.getTotalCoins());
|
||||
}
|
||||
@ -238,7 +239,7 @@ public class VotifierManager extends MiniPlugin
|
||||
|
||||
client.store();
|
||||
System.out.println("Awarded carl ticket to " + playerName);
|
||||
onComplete.run(amount.getTotalGems());
|
||||
onComplete.run(amount.getTotalCoins());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -216,6 +216,7 @@ public class Arcade extends JavaPlugin
|
||||
config.ServerType = _serverConfiguration.getServerGroup().getServerType();
|
||||
config.MinPlayers = _serverConfiguration.getServerGroup().getMinPlayers();
|
||||
config.MaxPlayers = _serverConfiguration.getServerGroup().getMaxPlayers();
|
||||
config.Uptimes = _serverConfiguration.getServerGroup().getUptimes();
|
||||
config.Tournament = _serverConfiguration.getServerGroup().getTournament();
|
||||
config.TournamentPoints = _serverConfiguration.getServerGroup().getTournamentPoints();
|
||||
config.TeamRejoin = _serverConfiguration.getServerGroup().getTeamRejoin();
|
||||
|
@ -73,7 +73,6 @@ import nautilus.game.arcade.command.GameCommand;
|
||||
import nautilus.game.arcade.command.KitUnlockCommand;
|
||||
import nautilus.game.arcade.command.RequiredRankCommand;
|
||||
import nautilus.game.arcade.command.WriteCommand;
|
||||
import nautilus.game.arcade.command.*;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
@ -91,7 +90,6 @@ import org.bukkit.*;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -147,7 +145,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
// Managers
|
||||
private GameCreationManager _gameCreationManager;
|
||||
private GameGemManager _gameGemManager;
|
||||
private GameRewardManager _gameRewardManager;
|
||||
private GameManager _gameManager;
|
||||
private GameLobbyManager _gameLobbyManager;
|
||||
private GamePlayerManager _gamePlayerManager;
|
||||
@ -173,7 +171,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
private ProgressingKitManager _progressionKitManager;
|
||||
private BoosterManager _boosterManager;
|
||||
private GameSpectatorManager _spectatorManager;
|
||||
|
||||
private ServerUptimeManager _serverUptimeManager;
|
||||
|
||||
private IncognitoManager _incognitoManager;
|
||||
|
||||
private TaskManager _taskManager;
|
||||
@ -278,7 +277,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
// Managers
|
||||
_gameChatManager = new GameChatManager(this);
|
||||
_gameCreationManager = new GameCreationManager(this);
|
||||
_gameGemManager = new GameGemManager(this);
|
||||
_gameRewardManager = new GameRewardManager(this);
|
||||
_gameManager = new GameManager(this);
|
||||
_gameLobbyManager = new GameLobbyManager(this, packetHandler);
|
||||
_gameHostManager = new GameHostManager(this);
|
||||
@ -331,7 +330,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
_kitProgressionManager = new KitProgressionManager(getPlugin(), clientManager);
|
||||
_progressionKitManager = new ProgressingKitManager(this);
|
||||
|
||||
_serverUptimeManager = new ServerUptimeManager(this);
|
||||
|
||||
if (GetHost() != null && !GetHost().isEmpty())
|
||||
{
|
||||
Bukkit.getScheduler().runTaskLater(plugin, () -> Portal.transferPlayer(GetHost(), _serverStatusManager.getCurrentServerName()), 80L);
|
||||
@ -508,9 +508,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
return _gameManager;
|
||||
}
|
||||
|
||||
public GameGemManager GetGameGemManager()
|
||||
public GameRewardManager GetGameGemManager()
|
||||
{
|
||||
return _gameGemManager;
|
||||
return _gameRewardManager;
|
||||
}
|
||||
|
||||
public GamePlayerManager GetGamePlayerManager()
|
||||
|
@ -1,5 +1,7 @@
|
||||
package nautilus.game.arcade;
|
||||
|
||||
import mineplex.core.common.MinecraftVersion;
|
||||
import mineplex.core.common.Pair;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
/**
|
||||
@ -14,16 +16,34 @@ public class GameMode
|
||||
private GameType _gameType;
|
||||
private String _name;
|
||||
|
||||
private Pair<MinecraftVersion, String>[] _resourcePackUrls;
|
||||
private boolean _enforceResourcePack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param gameMode Game class that in most cases extends the host game class
|
||||
* @param name Gamemode name
|
||||
*/
|
||||
public GameMode(Class<? extends Game> gameMode, GameType gameType, String name)
|
||||
{
|
||||
this(gameMode, gameType, name, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param gameMode Game class that in most cases extends the host game class
|
||||
* @param gameType original GameType of modded game
|
||||
* @param name Gamemode name
|
||||
* @param resourcePackUrls URLs to 1.8/1.9 resource pack
|
||||
* @param enforceResourcePack enforece resource pack on players
|
||||
*/
|
||||
public GameMode(Class<? extends Game> gameMode, GameType gameType, String name, Pair<MinecraftVersion, String>[] resourcePackUrls, boolean enforceResourcePack)
|
||||
{
|
||||
_gameMode = gameMode;
|
||||
_gameType = gameType;
|
||||
_name = name;
|
||||
_resourcePackUrls = resourcePackUrls;
|
||||
_enforceResourcePack = enforceResourcePack;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,5 +72,23 @@ public class GameMode
|
||||
{
|
||||
return _gameType;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Gamemode resource pack URLs
|
||||
*/
|
||||
public Pair<MinecraftVersion, String>[] getResPackURLs()
|
||||
{
|
||||
return _resourcePackUrls;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Gamemode enforcing of resource packs
|
||||
*/
|
||||
public boolean enforceResourcePack()
|
||||
{
|
||||
return _enforceResourcePack;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package nautilus.game.arcade;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import mineplex.core.common.MinecraftVersion;
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.game.GameCategory;
|
||||
@ -10,6 +12,7 @@ import nautilus.game.arcade.game.games.barbarians.Barbarians;
|
||||
import nautilus.game.arcade.game.games.bossbattles.BossBattles;
|
||||
import nautilus.game.arcade.game.games.bouncyballs.BouncyBalls;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.LuckyBridges;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.OverpoweredBridge;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.SpeedBridges ;
|
||||
import nautilus.game.arcade.game.games.build.Build;
|
||||
@ -20,6 +23,7 @@ import nautilus.game.arcade.game.games.castlesiege.CastleSiege;
|
||||
import nautilus.game.arcade.game.games.champions.ChampionsCTF;
|
||||
import nautilus.game.arcade.game.games.champions.ChampionsDominate;
|
||||
import nautilus.game.arcade.game.games.champions.ChampionsTDM;
|
||||
import nautilus.game.arcade.game.games.champions.modes.SmashDom;
|
||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||
import nautilus.game.arcade.game.games.deathtag.DeathTag;
|
||||
import nautilus.game.arcade.game.games.dragonescape.DragonEscape;
|
||||
@ -33,6 +37,7 @@ import nautilus.game.arcade.game.games.evolution.Evolution;
|
||||
import nautilus.game.arcade.game.games.gladiators.Gladiators;
|
||||
import nautilus.game.arcade.game.games.gladiators.modes.ChampionsGladiators;
|
||||
import nautilus.game.arcade.game.games.gladiators.modes.OverpoweredGladiators;
|
||||
import nautilus.game.arcade.game.games.gladiators.modes.SmashGladiators;
|
||||
import nautilus.game.arcade.game.games.gravity.Gravity;
|
||||
import nautilus.game.arcade.game.games.halloween.Halloween;
|
||||
import nautilus.game.arcade.game.games.hideseek.HideSeek;
|
||||
@ -41,11 +46,14 @@ import nautilus.game.arcade.game.games.holeinwall.HoleInTheWall;
|
||||
import nautilus.game.arcade.game.games.horsecharge.Horse;
|
||||
import nautilus.game.arcade.game.games.lobbers.BombLobbers;
|
||||
import nautilus.game.arcade.game.games.micro.Micro;
|
||||
import nautilus.game.arcade.game.games.micro.modes.CookieFight;
|
||||
import nautilus.game.arcade.game.games.micro.modes.OverpoweredMicroBattles;
|
||||
import nautilus.game.arcade.game.games.micro.modes.TinySmash;
|
||||
import nautilus.game.arcade.game.games.micro.modes.TinyWinners;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkCow;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||
import nautilus.game.arcade.game.games.mineware.MineWare;
|
||||
import nautilus.game.arcade.game.games.minestrike.Minestrike;
|
||||
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
|
||||
import nautilus.game.arcade.game.games.monsterleague.MonsterLeague;
|
||||
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
|
||||
import nautilus.game.arcade.game.games.oldmineware.OldMineWare;
|
||||
@ -59,9 +67,12 @@ import nautilus.game.arcade.game.games.runner.modes.FasterThanLight;
|
||||
import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.EweHeroes;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.OverpoweredSheepQuest;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.SmashSheep;
|
||||
import nautilus.game.arcade.game.games.skywars.SoloSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.TeamSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.SkySmash;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.UHCSkywars;
|
||||
import nautilus.game.arcade.game.games.smash.SoloSuperSmash;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmashDominate;
|
||||
@ -78,7 +89,9 @@ import nautilus.game.arcade.game.games.squidshooter.SquidShooter;
|
||||
import nautilus.game.arcade.game.games.stacker.Stacker;
|
||||
import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames;
|
||||
import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modes.ChangingKits;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modes.OverpoweredSurvival;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modes.StrikeGames;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modes.UHCSurvivalgames;
|
||||
import nautilus.game.arcade.game.games.tug.Tug;
|
||||
import nautilus.game.arcade.game.games.turfforts.TurfForts;
|
||||
@ -92,7 +105,6 @@ import nautilus.game.arcade.game.games.valentines.Valentines;
|
||||
import nautilus.game.arcade.game.games.wither.WitherGame;
|
||||
import nautilus.game.arcade.game.games.wizards.Wizards;
|
||||
import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public enum GameType
|
||||
{
|
||||
@ -132,12 +144,12 @@ public enum GameType
|
||||
Lobbers(BombLobbers.class, GameDisplay.Lobbers),
|
||||
Micro(Micro.class, GameDisplay.Micro),
|
||||
MilkCow(MilkCow.class, GameDisplay.MilkCow),
|
||||
MineStrike(MineStrike.class, GameDisplay.MineStrike, new Pair[]
|
||||
MineStrike(Minestrike.class, GameDisplay.MineStrike, new Pair[]
|
||||
{
|
||||
Pair.create(MinecraftVersion.Version1_8, "http://file.mineplex.com/ResMinestrike.zip"),
|
||||
Pair.create(MinecraftVersion.Version1_9, "http://file.mineplex.com/ResMinestrike19.zip")
|
||||
}, true),
|
||||
MineWare(MineWare.class, GameDisplay.MineWare),
|
||||
BawkBawkBattles(BawkBawkBattles.class, GameDisplay.BawkBawkBattles),
|
||||
MinecraftLeague(MinecraftLeague.class, GameDisplay.Minecraft_League),
|
||||
OldMineWare(OldMineWare.class, GameDisplay.OldMineWare),
|
||||
Paintball(Paintball.class, GameDisplay.Paintball),
|
||||
@ -187,7 +199,7 @@ public enum GameType
|
||||
GameType.Cards, GameType.CastleSiege, GameType.ChampionsDominate, GameType.ChampionsTDM, GameType.Christmas,
|
||||
GameType.DeathTag, GameType.DragonEscape, GameType.DragonEscapeTeams, GameType.DragonRiders, GameType.Dragons,
|
||||
GameType.Draw, GameType.Evolution, GameType.Gravity, GameType.Halloween, GameType.HideSeek,
|
||||
GameType.HoleInTheWall, GameType.Horse, GameType.Micro, GameType.MilkCow, GameType.MineStrike, GameType.MineWare,
|
||||
GameType.HoleInTheWall, GameType.Horse, GameType.Micro, GameType.MilkCow, GameType.MineStrike, GameType.BawkBawkBattles,
|
||||
GameType.OldMineWare, GameType.Paintball, GameType.Quiver, GameType.QuiverTeams, GameType.Runner, GameType.SearchAndDestroy,
|
||||
GameType.Sheep, GameType.Skywars, GameType.SkywarsTeams, GameType.Smash, GameType.SmashDomination, GameType.SmashTeams,
|
||||
GameType.Snake, GameType.SneakyAssassins, GameType.SnowFight, GameType.Spleef, GameType.SpleefTeams, GameType.SquidShooter,
|
||||
@ -195,20 +207,42 @@ public enum GameType
|
||||
GameType.WitherAssault, GameType.Wizards, GameType.ZombieSurvival}, true),
|
||||
|
||||
Brawl(null, new GameMode[]{
|
||||
new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"), new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"),
|
||||
new GameMode(OverpoweredGladiators.class, GameType.Gladiators, "OP Gladiators"), new GameMode(ChampionsGladiators.class, GameType.Gladiators, "Champions Gladiators"),
|
||||
new GameMode(OverpoweredSkywars.class, GameType.Skywars, "OP Skywars"), new GameMode(UHCSkywars.class, GameType.Skywars, "UHC Skywars"),
|
||||
new GameMode(TeamBuild.class, GameType.Build, "Team Master Builders"), new GameMode(DukesOfDecoration.class, GameType.Build, "Dukes Of Decoration"),
|
||||
new GameMode(CutClean.class, GameType.UHC, "Cut Clean"), new GameMode(GodBattles.class, GameType.UHC, "God Battles"),
|
||||
new GameMode(BloodDiamonds.class, GameType.UHC, "Blood Diamonds"), new GameMode(Assassins.class, GameType.UHC, "Assassins"),
|
||||
new GameMode(OverpoweredSurvival.class, GameType.SurvivalGames, "OP Survival Games"), new GameMode(UHCSurvivalgames.class, GameType.SurvivalGames, "UHC Survivalgames"),
|
||||
new GameMode(UltraSpleef.class, GameType.Spleef, "Ultra Spleef"),
|
||||
new GameMode(RandomKitSSM.class, GameType.Smash, "Random Kit SSM"),
|
||||
new GameMode(EweHeroes.class, GameType.Sheep, "Heroes Of The Ewe"),
|
||||
new GameMode(FasterThanLight.class, GameType.Runner, "Faster Than Light"),
|
||||
new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"),
|
||||
new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"),
|
||||
new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"),
|
||||
new GameMode(LuckyBridges.class, GameType.Bridge, "Lucky Bridges"),
|
||||
new GameMode(OverpoweredGladiators.class, GameType.Gladiators, "OP Gladiators"),
|
||||
new GameMode(ChampionsGladiators.class, GameType.Gladiators, "Champions Gladiators"),
|
||||
new GameMode(SmashGladiators.class, GameType.Gladiators, "Smash Gladiators"),
|
||||
new GameMode(OverpoweredSkywars.class, GameType.Skywars, "OP Skywars"),
|
||||
new GameMode(UHCSkywars.class, GameType.Skywars, "UHC Skywars"),
|
||||
new GameMode(SkySmash.class, GameType.Skywars, "Sky Smash"),
|
||||
new GameMode(TeamBuild.class, GameType.Build, "Team Master Builders"),
|
||||
new GameMode(DukesOfDecoration.class, GameType.Build, "Dukes Of Decoration"),
|
||||
new GameMode(CutClean.class, GameType.UHC, "Cut Clean"),
|
||||
new GameMode(GodBattles.class, GameType.UHC, "God Battles"),
|
||||
new GameMode(BloodDiamonds.class, GameType.UHC, "Blood Diamonds"),
|
||||
new GameMode(Assassins.class, GameType.UHC, "Assassins"),
|
||||
new GameMode(OverpoweredSurvival.class, GameType.SurvivalGames, "OP Survival Games"),
|
||||
new GameMode(UHCSurvivalgames.class, GameType.SurvivalGames, "UHC Survivalgames"),
|
||||
new GameMode(ChangingKits.class, GameType.SurvivalGames, "Changing Kits"),
|
||||
new GameMode(StrikeGames.class, GameType.SurvivalGames, "Strike Games", new Pair[]
|
||||
{
|
||||
Pair.create(MinecraftVersion.Version1_8, "http://file.mineplex.com/ResStrikeGames18.zip"),
|
||||
Pair.create(MinecraftVersion.Version1_9, "http://file.mineplex.com/ResStrikeGames19.zip")
|
||||
}, true),
|
||||
new GameMode(TinyWinners.class, GameType.Micro, "Tiny Winners"),
|
||||
new GameMode(Countdown.class, GameType.HideSeek, "Countdown"),
|
||||
new GameMode(OverpoweredMicroBattles.class, GameType.Micro, "OP Micro Battles"),
|
||||
new GameMode(CookieFight.class, GameType.Micro, "Cookie Fight"),
|
||||
new GameMode(TinySmash.class, GameType.Micro, "Tiny Smash"),
|
||||
new GameMode(UltraSpleef.class, GameType.Spleef, "Ultra Spleef"),
|
||||
new GameMode(RandomKitSSM.class, GameType.Smash, "Random Kit SSM"),
|
||||
new GameMode(EweHeroes.class, GameType.Sheep, "Heroes Of The Ewe"),
|
||||
new GameMode(SmashSheep.class, GameType.Sheep, "Smash Sheep"),
|
||||
new GameMode(OverpoweredSheepQuest.class, GameType.Sheep, "OP Sheep Quest"),
|
||||
new GameMode(FasterThanLight.class, GameType.Runner, "Faster Than Light"),
|
||||
new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"),
|
||||
new GameMode(Countdown.class, GameType.HideSeek, "Countdown"),
|
||||
new GameMode(SmashDom.class, GameType.ChampionsDominate, "Smash Dominate"),
|
||||
}, GameDisplay.Brawl, null, false, null, false, true);
|
||||
|
||||
GameDisplay _display;
|
||||
@ -277,13 +311,21 @@ public enum GameType
|
||||
return _gameModes;
|
||||
}
|
||||
|
||||
public boolean isEnforceResourcePack()
|
||||
public boolean isEnforceResourcePack(Game game)
|
||||
{
|
||||
if (hasGamemodes())
|
||||
{
|
||||
return getGameMode(game.getClass()).enforceResourcePack();
|
||||
}
|
||||
return _enforceResourcePack;
|
||||
}
|
||||
|
||||
public Pair<MinecraftVersion, String>[] getResourcePackUrls()
|
||||
public Pair<MinecraftVersion, String>[] getResourcePackUrls(Game game)
|
||||
{
|
||||
if (hasGamemodes())
|
||||
{
|
||||
return getGameMode(game.getClass()).getResPackURLs();
|
||||
}
|
||||
return _resourcePacks;
|
||||
}
|
||||
|
||||
@ -331,18 +373,28 @@ public enum GameType
|
||||
return _display.getKitGameName();
|
||||
}
|
||||
|
||||
public GameType getModeGameType(Class<? extends Game> game)
|
||||
public boolean isUsingGameModes()
|
||||
{
|
||||
return _gameMaps;
|
||||
}
|
||||
|
||||
public GameMode getGameMode(Class<? extends Game> game)
|
||||
{
|
||||
for (GameMode mode : getGameModes())
|
||||
{
|
||||
if (mode.getGameClass() != null && mode.getGameClass().getName().contentEquals(game.getName()))
|
||||
{
|
||||
return mode.getType();
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public GameType getModeGameType(Class<? extends Game> game)
|
||||
{
|
||||
return getGameMode(game).getType();
|
||||
}
|
||||
|
||||
public boolean isUsingGameModesMaps()
|
||||
{
|
||||
return _gameMaps;
|
||||
|
@ -99,7 +99,7 @@ public class CompassAddon extends MiniPlugin
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
if (Manager.GetGame().CompassGiveItem || Manager.isSpectator(player))
|
||||
if (Manager.GetGame().CompassGiveItem || (Manager.GetGame().CompassGiveItemSpectators && Manager.isSpectator(player)))
|
||||
if (!player.getInventory().contains(Material.COMPASS))
|
||||
{
|
||||
if (player.getOpenInventory() == null || player.getOpenInventory().getCursor() == null || player.getOpenInventory().getCursor().getType() != Material.COMPASS)
|
||||
|
@ -55,7 +55,7 @@ public class GameBoosterManager extends MiniPlugin
|
||||
|
||||
if (active == null)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Thanks", "There is no active booster to Thank!"));
|
||||
UtilPlayer.message(player, F.main("Thanks", "There is no active amplifier to Thank!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -81,10 +81,10 @@ public class GameBoosterManager extends MiniPlugin
|
||||
Booster booster = event.getBooster();
|
||||
if (event.getBoosterGroup().equals(_boosterGroup))
|
||||
{
|
||||
Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated an Amplifier for " + booster.getMultiplier() + "x Gems and Shards!"));
|
||||
Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier for " + booster.getMultiplier() + "x Shards!"));
|
||||
} else
|
||||
{
|
||||
Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated an Amplifier on " + F.elem(event.getBoosterGroup().replaceAll("_", " ")) + "!"));
|
||||
Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier on " + F.elem(event.getBoosterGroup().replaceAll("_", " ")) + "!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -202,10 +202,12 @@ public abstract class Game implements Listener
|
||||
public boolean WorldLeavesDecay = false;
|
||||
public boolean WorldSoilTrample = false;
|
||||
public boolean WorldBoneMeal = false;
|
||||
public boolean WorldChunkUnload = false;
|
||||
|
||||
public int HungerSet = -1;
|
||||
public int HealthSet = -1;
|
||||
|
||||
public boolean SpawnTeleport = true;
|
||||
public boolean PrepareFreeze = true;
|
||||
|
||||
private double _itemMergeRadius = 0;
|
||||
@ -240,6 +242,7 @@ public abstract class Game implements Listener
|
||||
// Addons
|
||||
public boolean CompassEnabled = false;
|
||||
public boolean CompassGiveItem = true;
|
||||
public boolean CompassGiveItemSpectators = true;
|
||||
|
||||
public boolean SoupEnabled = true;
|
||||
public boolean TeamArmor = false;
|
||||
@ -326,7 +329,6 @@ public abstract class Game implements Listener
|
||||
private NautHashMap<String, Entity> _deadBodies = new NautHashMap<String, Entity>();
|
||||
private NautHashMap<String, Long> _deadBodiesExpire = new NautHashMap<String, Long>();
|
||||
|
||||
public ArrayList<String> GemBoosters = new ArrayList<String>();
|
||||
private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>();
|
||||
|
||||
private NautHashMap<Player, Player> _teamReqs = new NautHashMap<Player, Player>();
|
||||
@ -397,7 +399,7 @@ public abstract class Game implements Listener
|
||||
new ExperienceStatTracker(this), new WinStatTracker(this), new LoseStatTracker(this), new DamageDealtStatTracker(
|
||||
this), new DamageTakenStatTracker(this), new GamesPlayedStatTracker(this));
|
||||
|
||||
Manager.getResourcePackManager().setResourcePack(gameType.getResourcePackUrls(), gameType.isEnforceResourcePack());
|
||||
Manager.getResourcePackManager().setResourcePack(gameType.getResourcePackUrls(this), gameType.isEnforceResourcePack(this));
|
||||
|
||||
_useEntityPacketHandler = new IPacketHandler()
|
||||
{
|
||||
@ -420,13 +422,14 @@ public abstract class Game implements Listener
|
||||
System.out.println("Loading " + GetName() + "...");
|
||||
}
|
||||
|
||||
public void registerModule(Module module)
|
||||
public <T extends Module> T registerModule(T module)
|
||||
{
|
||||
if (!_modules.containsKey(module.getClass()))
|
||||
{
|
||||
module.initialize(this);
|
||||
_modules.put(module.getClass(), module);
|
||||
UtilServer.RegisterEvents(module);
|
||||
module.initialize(this);
|
||||
return module;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -434,6 +437,16 @@ public abstract class Game implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterModule(Module module)
|
||||
{
|
||||
if (_modules.containsKey(module.getClass()) && _modules.get(module.getClass()) == module)
|
||||
{
|
||||
_modules.remove(module.getClass());
|
||||
module.cleanup();
|
||||
HandlerList.unregisterAll(module);
|
||||
}
|
||||
}
|
||||
|
||||
public void setKits(Kit[] kits)
|
||||
{
|
||||
_kits = kits;
|
||||
@ -866,6 +879,11 @@ public abstract class Game implements Listener
|
||||
}
|
||||
|
||||
public void SetKit(Player player, Kit kit, boolean announce)
|
||||
{
|
||||
SetKit(player, kit, announce, true);
|
||||
}
|
||||
|
||||
public void SetKit(Player player, Kit kit, boolean announce, boolean apply)
|
||||
{
|
||||
GameTeam team = GetTeam(player);
|
||||
if (team != null)
|
||||
@ -896,7 +914,7 @@ public abstract class Game implements Listener
|
||||
UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + "."));
|
||||
}
|
||||
|
||||
if (InProgress())
|
||||
if (InProgress() && apply)
|
||||
{
|
||||
kit.ApplyKit(player);
|
||||
}
|
||||
@ -1458,46 +1476,6 @@ public abstract class Game implements Listener
|
||||
SetState(GameState.End);
|
||||
}
|
||||
|
||||
public void AddGemBooster(Player player)
|
||||
{
|
||||
if (!GemBoosterEnabled)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You cannot use " + F.elem("Gem Boosters")) + " for this game.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (GemBoosters.size() >= 4)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "Games cannot have more than " + F.elem("4 Gem Boosters")) + ".");
|
||||
return;
|
||||
}
|
||||
|
||||
if (GemBoosters.contains(player.getName()))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You can only use " + F.elem("1 Gem Booster")) + " per game.");
|
||||
return;
|
||||
}
|
||||
|
||||
Announce(F.elem(player.getName()) + " used a " + F.elem(C.cGreen + "Gem Booster") + " for "
|
||||
+ F.elem("+" + (100 - (GemBoosters.size() * 25)) + "% Gems") + "!");
|
||||
|
||||
GemBoosters.add(player.getName());
|
||||
}
|
||||
|
||||
public double GetGemBoostAmount()
|
||||
{
|
||||
if (GemBoosters.size() == 1)
|
||||
return 1;
|
||||
if (GemBoosters.size() == 2)
|
||||
return 1.75;
|
||||
if (GemBoosters.size() == 3)
|
||||
return 2.25;
|
||||
if (GemBoosters.size() == 4)
|
||||
return 2.5;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void AddStat(Player player, String stat, int amount, boolean limitTo1, boolean global)
|
||||
{
|
||||
if (!Manager.IsRewardStats())
|
||||
|
@ -12,6 +12,9 @@ public class GameServerConfig
|
||||
public String BoosterGroup = null;
|
||||
public int MinPlayers = -1;
|
||||
public int MaxPlayers = -1;
|
||||
|
||||
public String Uptimes;
|
||||
|
||||
public ArrayList<GameType> GameList = new ArrayList<GameType>();
|
||||
public ArrayList<String> GameModeList = new ArrayList<String>();
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user