Merge remote-tracking branch 'origin/master' into Myst_HALLOWEEN
This commit is contained in:
commit
435e74225a
BIN
Art/Halloween Horror.jpg
Normal file
BIN
Art/Halloween Horror.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 KiB |
BIN
Art/Pumpkin.png
Normal file
BIN
Art/Pumpkin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 692 KiB |
BIN
Art/Spooky Sale.png
Normal file
BIN
Art/Spooky Sale.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 176 KiB |
@ -60,7 +60,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
|
||||
final Rank rank = tempRank;
|
||||
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.SUPPORT)
|
||||
{
|
||||
if (!testServer && rank.has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ import mineplex.core.pet.repository.token.PetChangeToken;
|
||||
import mineplex.core.pet.repository.token.PetToken;
|
||||
import mineplex.core.shop.page.ConfirmationPage;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.playerCache.PlayerCache;
|
||||
import net.minecraft.server.v1_7_R4.ItemStack;
|
||||
import net.minecraft.server.v1_7_R4.Items;
|
||||
|
||||
@ -85,6 +86,8 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
|
||||
if (getClientManager().Get(getPlayer()) != null)
|
||||
token.AccountId = getClientManager().Get(getPlayer()).getAccountId();
|
||||
else
|
||||
token.AccountId = PlayerCache.getInstance().getPlayer(getPlayer().getUniqueId()).getAccountId();
|
||||
|
||||
token.Name = getPlayer().getName();
|
||||
token.PetType = _pet.GetPetType().toString();
|
||||
|
@ -155,7 +155,7 @@ public class DonationRepository extends RepositoryBase
|
||||
{
|
||||
if (response)
|
||||
{
|
||||
executeUpdate(UPDATE_ACCOUNT_COINS, new ColumnInt("coins", coins), new ColumnInt("id", accountId));
|
||||
//executeUpdate(UPDATE_ACCOUNT_COINS, new ColumnInt("coins", coins), new ColumnInt("id", accountId));
|
||||
//executeUpdate(INSERT_COIN_TRANSACTION, new ColumnInt("id", accountId), new ColumnVarChar("reason", 100, "Rewarded by " + giver), new ColumnInt("coins", coins));
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ import mineplex.core.gadget.gadgets.MorphEnderman;
|
||||
import mineplex.core.gadget.gadgets.MorphPig;
|
||||
import mineplex.core.gadget.gadgets.MorphPumpkinKing;
|
||||
import mineplex.core.gadget.gadgets.MorphSlime;
|
||||
import mineplex.core.gadget.gadgets.MorphTitan;
|
||||
import mineplex.core.gadget.gadgets.MorphVillager;
|
||||
import mineplex.core.gadget.gadgets.MorphWither;
|
||||
import mineplex.core.gadget.gadgets.OutfitRaveSuit;
|
||||
@ -51,6 +52,7 @@ import mineplex.core.gadget.gadgets.ParticleHeart;
|
||||
import mineplex.core.gadget.gadgets.ParticleHelix;
|
||||
import mineplex.core.gadget.gadgets.ParticleLegend;
|
||||
import mineplex.core.gadget.gadgets.ParticleRain;
|
||||
import mineplex.core.gadget.gadgets.ParticleTitan;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
@ -163,6 +165,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new MorphWither(this));
|
||||
addGadget(new MorphBunny(this));
|
||||
addGadget(new MorphSlime(this, _achievementManager));
|
||||
addGadget(new MorphTitan(this));
|
||||
|
||||
// Particles
|
||||
addGadget(new ParticleFoot(this));
|
||||
@ -175,6 +178,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new ParticleFairy(this));
|
||||
addGadget(new ParticleLegend(this));
|
||||
addGadget(new ParticleBlizzard(this));
|
||||
addGadget(new ParticleTitan(this));
|
||||
//addGadget(new ParticleKronos(this));
|
||||
|
||||
// Music
|
||||
|
@ -0,0 +1,35 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.MorphGadget;
|
||||
|
||||
public class MorphTitan extends MorphGadget
|
||||
{
|
||||
public MorphTitan(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Titans Morph", new String[]
|
||||
{
|
||||
C.cWhite + "Coming Soon...",
|
||||
" ",
|
||||
C.cRed + "Unlocked with Titan Rank",
|
||||
},
|
||||
-1,
|
||||
Material.REDSTONE_BLOCK, (byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EnableCustom(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisableCustom(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public class ParticleTitan extends ParticleGadget
|
||||
{
|
||||
public ParticleTitan(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Titans Particle", new String[]
|
||||
{
|
||||
C.cWhite + "Coming Soon...",
|
||||
" ",
|
||||
C.cRed + "Unlocked with Titan Rank",
|
||||
},
|
||||
-1,
|
||||
Material.REDSTONE_BLOCK, (byte)0);
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@ import mineplex.core.mount.types.MountFrost;
|
||||
import mineplex.core.mount.types.MountMule;
|
||||
import mineplex.core.mount.types.MountSlime;
|
||||
import mineplex.core.mount.types.MountSpider;
|
||||
import mineplex.core.mount.types.MountTitan;
|
||||
import mineplex.core.mount.types.MountUndead;
|
||||
import mineplex.core.mount.types.MountZombie;
|
||||
|
||||
@ -66,6 +67,7 @@ public class MountManager extends MiniPlugin
|
||||
_types.add(new MountCart(this));
|
||||
_types.add(new MountSpider(this));
|
||||
_types.add(new MountZombie(this));
|
||||
_types.add(new MountTitan(this));
|
||||
//_types.add(new MountSheep(this));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
package mineplex.core.mount.types;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Horse.Color;
|
||||
import org.bukkit.entity.Horse.Style;
|
||||
import org.bukkit.entity.Horse.Variant;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.mount.HorseMount;
|
||||
import mineplex.core.mount.MountManager;
|
||||
|
||||
public class MountTitan extends HorseMount
|
||||
{
|
||||
public MountTitan(MountManager manager)
|
||||
{
|
||||
super(manager, "Titans Mount", new String[]
|
||||
{
|
||||
C.cWhite + "Coming Soon...",
|
||||
" ",
|
||||
C.cRed + "Unlocked with Titan Rank",
|
||||
},
|
||||
Material.REDSTONE_BLOCK,
|
||||
(byte)0,
|
||||
-1,
|
||||
Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null);
|
||||
}
|
||||
}
|
@ -34,6 +34,9 @@ public class PetRepository extends RepositoryBase
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (token.PetId == 0 || token.AccountId == 0)
|
||||
return;
|
||||
|
||||
executeInsert("INSERT INTO accountPets(petName, petId, accountId) VALUES (?, ?, ?);", null, new ColumnVarChar("petName", 32, token.PetName)
|
||||
, new ColumnInt("petId", token.PetId)
|
||||
, new ColumnInt("accountId", token.AccountId));
|
||||
@ -49,6 +52,9 @@ public class PetRepository extends RepositoryBase
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (token.PetId == 0 || token.AccountId == 0)
|
||||
return;
|
||||
|
||||
executeUpdate("DELETE FROM accountPets WHERE petId = ? AND accountId = ?;"
|
||||
, new ColumnInt("petId", token.PetId)
|
||||
, new ColumnInt("accountId", token.AccountId));
|
||||
@ -69,6 +75,9 @@ public class PetRepository extends RepositoryBase
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (token.PetId == 0 || token.AccountId == 0)
|
||||
return;
|
||||
|
||||
int rowsChanged = executeUpdate("UPDATE accountPets SET petName = ? WHERE petId = ? AND accountId = ?;", new ColumnVarChar("petName", 32, token.PetName)
|
||||
, new ColumnInt("petId", token.PetId)
|
||||
, new ColumnInt("accountId", token.AccountId));
|
||||
|
@ -13,6 +13,7 @@ import mineplex.core.pet.repository.token.PetToken;
|
||||
import mineplex.core.reward.RewardData;
|
||||
import mineplex.core.reward.RewardManager;
|
||||
import mineplex.core.reward.RewardRarity;
|
||||
import mineplex.playerCache.PlayerCache;
|
||||
|
||||
/**
|
||||
* Created by shaun on 14-09-18.
|
||||
@ -36,6 +37,12 @@ public class PetReward extends UnknownPackageReward
|
||||
protected RewardData giveRewardCustom(Player player)
|
||||
{
|
||||
PetChangeToken token = new PetChangeToken();
|
||||
|
||||
if (_inventoryManager.getClientManager().Get(player) != null)
|
||||
token.AccountId = _inventoryManager.getClientManager().Get(player).getAccountId();
|
||||
else
|
||||
token.AccountId = PlayerCache.getInstance().getPlayer(player.getUniqueId()).getAccountId();
|
||||
|
||||
token.Name = player.getName();
|
||||
token.PetType = _petEntity.toString();
|
||||
token.PetName = getPackageName();
|
||||
|
@ -1,6 +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;
|
||||
@ -29,6 +31,7 @@ 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.block.SignChangeEvent;
|
||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
@ -50,30 +53,32 @@ import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.mapparser.command.*;
|
||||
|
||||
public class MapParser extends JavaPlugin implements Listener
|
||||
{
|
||||
private WorldManager _worldManager;
|
||||
|
||||
|
||||
private Parse _curParse = null;
|
||||
private HashMap<String, MapData> _mapData = new HashMap<String, MapData>();
|
||||
private HashSet<String> _mapsBeingZipped = new HashSet<String>();
|
||||
private List<BaseCommand> _commands = new ArrayList<BaseCommand>();
|
||||
private Location _spawnLocation;
|
||||
|
||||
|
||||
private HashMap<Player, Boolean> _permissionMap = new HashMap<Player, Boolean>();
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
_worldManager = new WorldManager(this);
|
||||
|
||||
|
||||
getServer().getPluginManager().registerEvents(this, this);
|
||||
|
||||
|
||||
getServer().getWorlds().get(0).setSpawnLocation(0, 106, 0);
|
||||
_spawnLocation = new Location(getServer().getWorlds().get(0), 0, 106, 0);
|
||||
|
||||
|
||||
//Updates
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Ticker(this), 1, 1);
|
||||
|
||||
@ -101,21 +106,21 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void PlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
|
||||
player.teleport(getSpawnLocation());
|
||||
|
||||
|
||||
ResetInventory(event.getPlayer());
|
||||
|
||||
|
||||
DisplayHelp(player);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void permissionUpdate(TickEvent event)
|
||||
{
|
||||
@ -124,11 +129,11 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
permissionSet(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void permissionSet(Player player)
|
||||
{
|
||||
boolean hasPermission = GetData(player.getWorld().getName()).HasAccess(player);
|
||||
|
||||
|
||||
if (!_permissionMap.containsKey(player) || _permissionMap.get(player) != hasPermission)
|
||||
{
|
||||
for (Plugin plugin : Bukkit.getPluginManager().getPlugins())
|
||||
@ -137,18 +142,18 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
player.addAttachment(plugin, "voxelsniper.sniper", hasPermission);
|
||||
player.addAttachment(plugin, "voxelsniper.brush.*", hasPermission);
|
||||
}
|
||||
|
||||
|
||||
_permissionMap.put(player, hasPermission);
|
||||
|
||||
|
||||
UtilPlayer.message(player, "Plugin Permissions: " + F.tf(hasPermission));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void DisplayHelp(Player player)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Parser", "Listing Commands;"));
|
||||
UtilPlayer.message(player, F.value("Parameters", "Parameters: <?> = Required, [?] = Optional"));
|
||||
UtilPlayer.message(player, F.value("Parameters", "Parameters: <?> = Required, [?] = Optional"));
|
||||
UtilPlayer.message(player, F.value("/hub", "Return to hub world"));
|
||||
UtilPlayer.message(player, " ");
|
||||
UtilPlayer.message(player, F.value("/name <name>", "Set name for current map"));
|
||||
@ -165,9 +170,9 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
UtilPlayer.message(player, F.value("/map <name> [gametype]", "Teleport to a map"));
|
||||
UtilPlayer.message(player, " ");
|
||||
UtilPlayer.message(player, C.cYellow + "Documentation: " + C.cGreen + "http://tinyurl.com/mpxmaps");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void Command(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
@ -186,7 +191,7 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
if (event.getMessage().toLowerCase().startsWith("/help"))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
|
||||
DisplayHelp(player);
|
||||
}
|
||||
|
||||
@ -197,7 +202,7 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
if (alias.equalsIgnoreCase(commandLabel))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
|
||||
if (!command.execute(player, commandLabel, args))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Parser", "Invalid Input."));
|
||||
@ -229,13 +234,13 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
{
|
||||
if (_curParse == null)
|
||||
return;
|
||||
|
||||
|
||||
if (_curParse.Update())
|
||||
{
|
||||
Announce("Parse Completed!");
|
||||
|
||||
|
||||
Announce("Cleaning and Creating ZIP...");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
_worldManager.finalizeParsedWorld(_curParse.getWorld());
|
||||
@ -245,55 +250,55 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
Announce("Creating ZIP Failed! Please Try Again!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
_curParse = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void DisableCreatures(EntitySpawnEvent event)
|
||||
{
|
||||
if (event.getEntityType() == EntityType.DROPPED_ITEM || event.getEntity() instanceof LivingEntity)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void Updates(PlayerMoveEvent event)
|
||||
{
|
||||
@ -305,12 +310,12 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
world.setTime(8000);
|
||||
world.setStorm(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (event.getPlayer().getGameMode() != GameMode.CREATIVE)
|
||||
event.getPlayer().setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void SaveUnloadWorlds(TickEvent event)
|
||||
{
|
||||
@ -333,14 +338,14 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
_mapsBeingZipped.add(world.getName());
|
||||
System.out.println("Starting backup of " + world);
|
||||
BackupTask backupTask = new BackupTask(this, world.getName(), new Callback<Boolean>()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
System.out.println("Finished backup of " + world);
|
||||
_mapsBeingZipped.remove(world.getName());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -466,13 +471,13 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
|
||||
public void ResetInventory(Player player)
|
||||
{
|
||||
// UtilInv.Clear(player);
|
||||
//
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_SPADE));
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_AXE));
|
||||
// player.getInventory().addItem(new ItemStack(Material.WOOD_AXE));
|
||||
// UtilInv.Clear(player);
|
||||
//
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_SPADE));
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
||||
// player.getInventory().addItem(new ItemStack(Material.STONE_AXE));
|
||||
// player.getInventory().addItem(new ItemStack(Material.WOOD_AXE));
|
||||
}
|
||||
|
||||
public WorldManager getWorldManager()
|
||||
@ -531,14 +536,14 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
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"))
|
||||
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 (!GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
@ -563,24 +568,24 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
{
|
||||
event.setQuitMessage(F.sys("Player Quit", event.getPlayer().getName()));
|
||||
}
|
||||
|
||||
|
||||
@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)
|
||||
{
|
||||
@ -588,30 +593,30 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
player.teleport(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@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)
|
||||
@ -619,28 +624,28 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
UtilPlayer.message(player, F.main("Game", "Invalid Speed Input."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private HashMap<Player, ArrayList<HashSet<BlockData>>> treeHistory = new HashMap<Player, ArrayList<HashSet<BlockData>>>();
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void treeRemover(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
|
||||
//Permission
|
||||
if (!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)
|
||||
{
|
||||
@ -649,31 +654,31 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Left-Click on Log");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
HashSet<Block> toRemove = searchLog(new HashSet<Block>(), event.getClickedBlock());
|
||||
|
||||
|
||||
if (toRemove.isEmpty())
|
||||
{
|
||||
player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Left-Click on Log");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
HashSet<BlockData> history = new HashSet<BlockData>();
|
||||
|
||||
|
||||
for (Block block : toRemove)
|
||||
{
|
||||
history.add(new BlockData(block));
|
||||
|
||||
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
|
||||
|
||||
if (!treeHistory.containsKey(player))
|
||||
treeHistory.put(player, new ArrayList<HashSet<BlockData>>());
|
||||
|
||||
|
||||
treeHistory.get(player).add(0, history);
|
||||
|
||||
|
||||
player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Tree Removed");
|
||||
|
||||
|
||||
while (treeHistory.get(player).size() > 10)
|
||||
treeHistory.get(player).remove(10);
|
||||
}
|
||||
@ -684,12 +689,12 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
player.sendMessage(C.cGreen + C.Bold + "TreeTool: " + ChatColor.RESET + "No Tree History");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
HashSet<BlockData> datas = treeHistory.get(player).remove(0);
|
||||
|
||||
|
||||
for (BlockData data : datas)
|
||||
data.restore();
|
||||
|
||||
|
||||
player.sendMessage(C.cGreen + C.Bold + "TreeTool: " + ChatColor.RESET + "Tree Restored");
|
||||
}
|
||||
}
|
||||
@ -699,51 +704,82 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
//Not Tree
|
||||
if (current.getType() != Material.LOG && current.getType() != Material.LEAVES)
|
||||
return blocks;
|
||||
|
||||
|
||||
if (!blocks.add(current))
|
||||
return blocks;
|
||||
|
||||
|
||||
for (Block other : UtilBlock.getSurrounding(current, true))
|
||||
{
|
||||
if (current.getType() != Material.LOG && current.getType() != Material.LEAVES)
|
||||
continue;
|
||||
|
||||
|
||||
if (blocks.contains(other))
|
||||
continue;
|
||||
|
||||
|
||||
//Dont spread from leaves to log
|
||||
if (current.getType() == Material.LEAVES && other.getType() == Material.LOG)
|
||||
continue;
|
||||
|
||||
|
||||
searchLog(blocks, other);
|
||||
}
|
||||
|
||||
|
||||
return blocks;
|
||||
}
|
||||
|
||||
|
||||
long lastUse = 0;
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void leaptest(PlayerInteractEvent event)
|
||||
{
|
||||
|
||||
|
||||
if (event.getPlayer().getItemInHand() == null)
|
||||
return;
|
||||
|
||||
|
||||
if (event.getPlayer().getItemInHand().getType() != Material.FEATHER)
|
||||
return;
|
||||
|
||||
|
||||
if (System.currentTimeMillis() - lastUse < 800)
|
||||
{
|
||||
Bukkit.broadcastMessage("Cooldown");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
lastUse = System.currentTimeMillis();
|
||||
|
||||
|
||||
Vector vel = event.getPlayer().getLocation().getDirection().multiply(1.2);
|
||||
vel.add(new Vector(0,0.6,0));
|
||||
|
||||
|
||||
event.getPlayer().setVelocity(vel);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void signChangeLog(SignChangeEvent event)
|
||||
{
|
||||
if (GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||
{
|
||||
try
|
||||
{
|
||||
File file = new File(event.getPlayer().getWorld().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");
|
||||
bw.write("\n" + "Date: " + UtilTime.now());
|
||||
bw.write("\n" + "Player: " + event.getPlayer().getName());
|
||||
bw.write("\n" + "Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation()));
|
||||
for (int i=0 ; i<event.getLines().length ; i++)
|
||||
bw.write("\n" + "Line " + i + ": " + event.getLines()[i]);
|
||||
|
||||
bw.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ public class HolidayManager implements Listener
|
||||
}
|
||||
|
||||
//Gems
|
||||
for (int i=0 ; i < 4 + Math.random()*16 ; i++)
|
||||
for (int i=0 ; i < 4 + Math.random()*8 ; i++)
|
||||
{
|
||||
Item gem = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5),
|
||||
ItemStackFactory.Instance.CreateStack(Material.EMERALD, (byte)0, 1, UtilMath.r(999999) + "Gem"));
|
||||
@ -392,7 +392,7 @@ public class HolidayManager implements Listener
|
||||
event.setCancelled(true);
|
||||
event.getItem().remove();
|
||||
|
||||
Manager.GetDonation().RewardCoins(null, type + " Coins", event.getPlayer().getName(), Manager.GetClients().Get(event.getPlayer()).getAccountId(), 4 * event.getItem().getItemStack().getAmount());
|
||||
Manager.GetDonation().RewardCoinsLater(type + " Coins", event.getPlayer(), 4 * event.getItem().getItemStack().getAmount());
|
||||
|
||||
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f);
|
||||
}
|
||||
@ -401,7 +401,7 @@ public class HolidayManager implements Listener
|
||||
event.setCancelled(true);
|
||||
event.getItem().remove();
|
||||
|
||||
Manager.GetDonation().RewardGems(null, type + " Gems", event.getPlayer().getName(), event.getPlayer().getUniqueId(), 4 * event.getItem().getItemStack().getAmount());
|
||||
Manager.GetDonation().RewardGemsLater(type + " Gems", event.getPlayer(), 4 * event.getItem().getItemStack().getAmount());
|
||||
|
||||
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user