From 108421164c4119ea3177dfd13d5b3053cd74aa63 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 10 Nov 2014 23:30:16 -0800 Subject: [PATCH 1/6] Added support for stats with spaces in them for GiveStat. --- .../core/stats/command/GiveStatCommand.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/command/GiveStatCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/command/GiveStatCommand.java index 088a4e052..3ce6a847b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/stats/command/GiveStatCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/command/GiveStatCommand.java @@ -1,10 +1,13 @@ package mineplex.core.stats.command; +import java.util.UUID; + import org.bukkit.entity.Player; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; +import mineplex.core.common.util.UUIDFetcher; import mineplex.core.common.util.UtilPlayer; import mineplex.core.stats.StatsManager; @@ -27,12 +30,28 @@ public class GiveStatCommand extends CommandBase try { Player player = UtilPlayer.searchOnline(caller, args[0], true); + + String statName = args[1]; + + for (int i = 2; i < args.length - 1; i++) + { + statName += " " + args[i]; + } + if (player == null) - return; + { + UUID uuid = UUIDFetcher.getUUIDOf(args[0]); + if (uuid != null) + { + Plugin.incrementStat(uuid.toString(), statName, Integer.parseInt(args[args.length - 1])); + } + } + else + { + Plugin.incrementStat(player, statName, Integer.parseInt(args[args.length - 1])); + } - Plugin.incrementStat(player, args[1], Integer.parseInt(args[2])); - - UtilPlayer.message(caller, F.main("Stats", "Applied " + F.elem(Integer.parseInt(args[2]) + " " + args[1]) + " to " + F.elem(player.getName()) + ".")); + UtilPlayer.message(caller, F.main("Stats", "Applied " + F.elem(Integer.parseInt(args[args.length - 1]) + " " + statName) + " to " + F.elem(player.getName()) + ".")); } catch (Exception e) { From 827fef535fc611df8a8c0223281296c1da6fb924 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 10 Nov 2014 23:30:41 -0800 Subject: [PATCH 2/6] Some commented out testing code in DisguiseManager --- .../core/disguise/DisguiseManager.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 19c3fb90a..5711e3026 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -6,11 +6,20 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; +import net.minecraft.server.v1_7_R4.AttributeSnapshot; +import net.minecraft.server.v1_7_R4.PacketPlayOutAbilities; import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation; import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent; import net.minecraft.server.v1_7_R4.EntityPlayer; import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutBlockChange; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityHeadRotation; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityLook; +import net.minecraft.server.v1_7_R4.PacketPlayOutKeepAlive; +import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_7_R4.PacketPlayOutScoreboardObjective; +import net.minecraft.server.v1_7_R4.PacketPlayOutScoreboardScore; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; @@ -19,9 +28,13 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.PacketPlayOutTileEntityData; import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; +import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateSign; +import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateTime; +import net.minecraft.server.v1_7_R4.PacketPlayOutWorldEvent; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; @@ -62,6 +75,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler private boolean _handlingPacket = false; private Field _attributesA; + private Field _attributesB; private Field _soundB; private Field _soundC; private Field _soundD; @@ -76,6 +90,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { _attributesA = PacketPlayOutUpdateAttributes.class.getDeclaredField("a"); _attributesA.setAccessible(true); + _attributesB = PacketPlayOutUpdateAttributes.class.getDeclaredField("b"); + _attributesB.setAccessible(true); _soundB = PacketPlayOutNamedSoundEffect.class.getDeclaredField("b"); _soundB.setAccessible(true); _soundC = PacketPlayOutNamedSoundEffect.class.getDeclaredField("c"); @@ -371,6 +387,53 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { if (_handlingPacket) return; + + /* + if (packetInfo.getPlayer().getName().equalsIgnoreCase("jRayx") + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityVelocity) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityHeadRotation) + && !(packetInfo.getPacket() instanceof PacketPlayOutRelEntityMove) + && !(packetInfo.getPacket() instanceof PacketPlayOutRelEntityMoveLook) + && !(packetInfo.getPacket() instanceof PacketPlayOutTileEntityData) + && !(packetInfo.getPacket() instanceof PacketPlayOutUpdateTime) + && !(packetInfo.getPacket() instanceof PacketPlayOutAbilities) + && !(packetInfo.getPacket() instanceof PacketPlayOutSpawnEntityLiving) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityMetadata) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityEquipment) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityLook) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityDestroy) + && !(packetInfo.getPacket() instanceof PacketPlayOutScoreboardScore) + && !(packetInfo.getPacket() instanceof PacketPlayOutScoreboardObjective) + && !(packetInfo.getPacket() instanceof PacketPlayOutKeepAlive) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityTeleport) + && !(packetInfo.getPacket() instanceof PacketPlayOutBlockChange) + && !(packetInfo.getPacket() instanceof PacketPlayOutMapChunkBulk) + && !(packetInfo.getPacket() instanceof PacketPlayOutNamedSoundEffect) + && !(packetInfo.getPacket() instanceof PacketPlayOutUpdateSign) + && !(packetInfo.getPacket() instanceof PacketPlayOutWorldEvent)) + { + System.out.println(packetInfo.getPacket().getClass().toString()); + + if (packetInfo.getPacket() instanceof PacketPlayOutUpdateAttributes) + { + try + { + for (Object attrObject : (List)_attributesB.get(packetInfo.getPacket())) + { + AttributeSnapshot attribute = (AttributeSnapshot)attrObject; + System.out.println(attribute.a()); + System.out.println(attribute.b()); + System.out.println(attribute.c()); + } + } + catch (IllegalArgumentException | IllegalAccessException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + */ final Packet packet = packetInfo.getPacket(); Player owner = packetInfo.getPlayer(); From 8d62966abcfb956ff30824e2a88546dfc7b5eb07 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Wed, 12 Nov 2014 05:13:16 -0800 Subject: [PATCH 3/6] Created Clans project. Converted Fields code complete (not tested). --- .../core/database/column/ColumnByte.java | 43 +++ .../core/database/column/ColumnDouble.java | 43 +++ Plugins/Mineplex.Game.Clans/.classpath | 12 + .../.externalToolBuilders/ClansBuilder.launch | 13 + Plugins/Mineplex.Game.Clans/.project | 27 ++ .../.settings/org.eclipse.jdt.core.prefs | 11 + .../src/me/chiss/Core/Field/Field.java | 41 +++ .../src/me/chiss/Core/Field/FieldBlock.java | 271 ++++---------- .../me/chiss/Core/Field/FieldBlockData.java | 8 +- .../chiss/Core/Field/FieldBlockLootData.java | 0 .../src/me/chiss/Core/Field/FieldMonster.java | 174 +++++++++ .../chiss/Core/Field/FieldMonsterInput.java | 0 .../src/me/chiss/Core/Field/FieldOre.java | 122 ++----- .../src/me/chiss/Core/Field/FieldOreData.java | 0 .../Core/Field/Monsters/FieldMonsterBase.java | 10 +- .../src/me/chiss/Core/Field/UtilField.java | 0 .../Field/commands/FieldBlockCommand.java | 145 ++++++++ .../Field/commands/FieldMonsterCommand.java | 170 +++++++++ .../Core/Field/commands/FieldOreCommand.java | 60 ++++ .../Field/repository/FieldBlockToken.java | 14 + .../Field/repository/FieldMonsterToken.java | 13 + .../Core/Field/repository/FieldOreToken.java | 7 + .../Field/repository/FieldRepository.java | 182 ++++++++++ .../src/mineplex/game/clans/Clans.java | 147 ++++++++ .../src/me/chiss/Core/Field/Field.java | 69 ---- .../src/me/chiss/Core/Field/FieldMonster.java | 332 ------------------ .../Field/repository/FieldRepository.java | 72 ---- Website/LOCWebsite.suo | Bin 474624 -> 474624 bytes 28 files changed, 1214 insertions(+), 772 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnByte.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnDouble.java create mode 100644 Plugins/Mineplex.Game.Clans/.classpath create mode 100644 Plugins/Mineplex.Game.Clans/.externalToolBuilders/ClansBuilder.launch create mode 100644 Plugins/Mineplex.Game.Clans/.project create mode 100644 Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/FieldBlock.java (60%) rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/FieldBlockData.java (94%) rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/FieldBlockLootData.java (100%) create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/FieldMonsterInput.java (100%) rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/FieldOre.java (73%) rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/FieldOreData.java (100%) rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java (93%) rename Plugins/{Nautilus.Game.PvP => Mineplex.Game.Clans}/src/me/chiss/Core/Field/UtilField.java (100%) create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java create mode 100644 Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java delete mode 100644 Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Field.java delete mode 100644 Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldMonster.java delete mode 100644 Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/repository/FieldRepository.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnByte.java b/Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnByte.java new file mode 100644 index 000000000..40464a318 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnByte.java @@ -0,0 +1,43 @@ +package mineplex.core.database.column; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +public class ColumnByte extends Column +{ + public ColumnByte(String name) + { + super(name); + Value = (byte)0; + } + + public ColumnByte(String name, Byte value) + { + super(name, value); + } + + @Override + public String getCreateString() + { + return Name + " TINYINT"; + } + + @Override + public Byte getValue(ResultSet resultSet) throws SQLException + { + return resultSet.getByte(Name); + } + + @Override + public void setValue(PreparedStatement preparedStatement, int columnNumber) throws SQLException + { + preparedStatement.setLong(columnNumber, Value); + } + + @Override + public ColumnByte clone() + { + return new ColumnByte(Name, Value); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnDouble.java b/Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnDouble.java new file mode 100644 index 000000000..1163df926 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/database/column/ColumnDouble.java @@ -0,0 +1,43 @@ +package mineplex.core.database.column; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +public class ColumnDouble extends Column +{ + public ColumnDouble(String name) + { + super(name); + Value = 0.0; + } + + public ColumnDouble(String name, Double value) + { + super(name, value); + } + + @Override + public String getCreateString() + { + return Name + " DOUBLE"; + } + + @Override + public Double getValue(ResultSet resultSet) throws SQLException + { + return resultSet.getDouble(Name); + } + + @Override + public void setValue(PreparedStatement preparedStatement, int columnNumber) throws SQLException + { + preparedStatement.setDouble(columnNumber, Value); + } + + @Override + public ColumnDouble clone() + { + return new ColumnDouble(Name, Value); + } +} diff --git a/Plugins/Mineplex.Game.Clans/.classpath b/Plugins/Mineplex.Game.Clans/.classpath new file mode 100644 index 000000000..dbcbd71a8 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Plugins/Mineplex.Game.Clans/.externalToolBuilders/ClansBuilder.launch b/Plugins/Mineplex.Game.Clans/.externalToolBuilders/ClansBuilder.launch new file mode 100644 index 000000000..71b1d0ddd --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/.externalToolBuilders/ClansBuilder.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Plugins/Mineplex.Game.Clans/.project b/Plugins/Mineplex.Game.Clans/.project new file mode 100644 index 000000000..f5ddd40a1 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/.project @@ -0,0 +1,27 @@ + + + Mineplex.Game.Clans + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/ClansBuilder.launch + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..7341ab168 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java new file mode 100644 index 000000000..05b34120f --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java @@ -0,0 +1,41 @@ +package me.chiss.Core.Field; + +import org.bukkit.plugin.java.JavaPlugin; + +import me.chiss.Core.Field.repository.FieldRepository; +import mineplex.core.MiniPlugin; +import mineplex.core.creature.Creature; +import mineplex.core.energy.Energy; +import mineplex.minecraft.game.core.condition.ConditionFactory; + +public class Field extends MiniPlugin +{ + private FieldBlock _block; + private FieldOre _ore; + private FieldMonster _mob; + + public Field(JavaPlugin plugin, Creature creature, ConditionFactory condition, Energy energy, String serverName) + { + super("Field Factory", plugin); + + FieldRepository repository = new FieldRepository(plugin); + _block = new FieldBlock(plugin, condition, energy, repository, serverName); + _ore = new FieldOre(plugin, repository, serverName); + _mob = new FieldMonster(plugin, repository, creature, serverName); + } + + public FieldBlock GetBlock() + { + return _block; + } + + public FieldOre GetOre() + { + return _ore; + } + + public FieldMonster GetMonster() + { + return _mob; + } +} diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlock.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlock.java similarity index 60% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlock.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlock.java index 72d0d1d47..726ddb4d9 100644 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlock.java +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlock.java @@ -4,8 +4,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.WeakHashMap; -import nautilus.minecraft.core.webserver.token.Server.FieldBlockToken; - import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; @@ -17,19 +15,26 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; -import me.chiss.Core.Module.AModule; -import mineplex.core.server.IRepository; +import me.chiss.Core.Field.repository.FieldBlockToken; +import me.chiss.Core.Field.repository.FieldRepository; +import mineplex.core.MiniPlugin; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.Rank; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.energy.Energy; +import mineplex.minecraft.game.core.condition.ConditionFactory; -public class FieldBlock extends AModule +public class FieldBlock extends MiniPlugin { + private ConditionFactory _conditionFactory; + private Energy _energy; + private FieldRepository _repository; private HashMap _blocks; private HashSet _active = new HashSet(); @@ -44,183 +49,25 @@ public class FieldBlock extends AModule private String _serverName; - public FieldBlock(JavaPlugin plugin, IRepository repository, String serverName) + public FieldBlock(JavaPlugin plugin, ConditionFactory conditionFactory, Energy energy, FieldRepository repository, String serverName) { - super("Field Block", plugin, repository); - + super("Field Block", plugin); + + _conditionFactory = conditionFactory; + _energy = energy; + _repository = repository; _blocks = new HashMap(); _serverName = serverName; load(); } - - //Module Functions - @Override - public void enable() - { - - } - - @Override - public void disable() - { - clean(); - } - - @Override - public void config() - { - - } - - @Override - public void commands() - { - AddCommand("fb"); - } - - @Override - public void command(Player caller, String cmd, String[] args) - { - if (!Clients().Get(caller).Rank().Has(Rank.ADMIN, true)) - return; - - if (args.length == 0) - { - showSettings(caller); - return; - } - - if (args[0].equalsIgnoreCase("toggle")) - { - if (!_active.remove(caller.getName())) - _active.add(caller.getName()); - - UtilPlayer.message(caller, F.main(GetName(), "Interact Active: " + F.tf(_active.contains(caller.getName())))); - } - - else if (args[0].equalsIgnoreCase("load")) - { - load(); - UtilPlayer.message(caller, F.main(_moduleName, "Reloaded Field Blocks from Database.")); - } - - else if (args[0].equalsIgnoreCase("wipe")) - { - wipe(caller); - } - - else if (args[0].equalsIgnoreCase("help")) - { - help(caller); - } - - else if (args.length <= 1) - { - help(caller); - } - - else if (args[0].equalsIgnoreCase("title")) - { - _title.put(caller, args[1]); - showSettings(caller); - } - - else if (args[0].equalsIgnoreCase("stock")) - { - try - { - int count = Integer.parseInt(args[1]); - if (count < 1) count = 1; - _stock.put(caller, count); - showSettings(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Stock Max.")); - } - } - - else if (args[0].equalsIgnoreCase("regen")) - { - try - { - double regen = Double.parseDouble(args[1]); - if (regen < 0) regen = 0; - _regen.put(caller, UtilMath.trim(1, regen)); - showSettings(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Stock Regeneration Time.")); - } - } - - else if (args[0].equalsIgnoreCase("empty")) - { - try - { - String[] toks = args[1].split(":"); - - int id = Integer.parseInt(toks[0]); - byte data = Byte.parseByte(toks[1]); - - _emptyId.put(caller, id); - _emptyData.put(caller, data); - showSettings(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Empty Block.")); - } - } - - - else if (args[0].equalsIgnoreCase("loot")) - { - boolean error = false; - for (String cur : args[1].split(",")) - { - String[] loot = cur.split(":"); - - if (loot.length != 5) - { - error = true; - break; - } - - try - { - Integer.parseInt(loot[0]); - Byte.parseByte(loot[1]); - Integer.parseInt(loot[2]); - Integer.parseInt(loot[3]); - Integer.parseInt(loot[4]); - } - catch (Exception e) - { - error = true; - break; - } - } - - if (error) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Loot String.")); - return; - } - - _lootString.put(caller, args[1]); - showSettings(caller); - } - } - - private void showSettings(Player caller) + + public void showSettings(Player caller) { populateSettings(caller); - UtilPlayer.message(caller, F.main(_moduleName, "Field Addition Settings;")); + UtilPlayer.message(caller, F.main(GetName(), "Field Addition Settings;")); UtilPlayer.message(caller, F.desc("Title", _title.get(caller))); UtilPlayer.message(caller, F.desc("Stock", _stock.get(caller)+"")); UtilPlayer.message(caller, F.desc("Regen", _regen.get(caller)+"")); @@ -257,34 +104,31 @@ public class FieldBlock extends AModule if (event.getPlayer().getItemInHand() != null && event.getPlayer().getItemInHand().getType().toString().contains("PICKAXE")) { - if (Util().Event().isAction(event, ActionType.R_BLOCK)) + if (UtilEvent.isAction(event, ActionType.R_BLOCK)) showBlock(event.getPlayer(), event); } - else if (Util().Gear().isMat(event.getPlayer().getItemInHand(), Material.GLOWSTONE_DUST)) + else if (UtilGear.isMat(event.getPlayer().getItemInHand(), Material.GLOWSTONE_DUST)) { - if (Util().Event().isAction(event, ActionType.L_BLOCK)) + if (UtilEvent.isAction(event, ActionType.L_BLOCK)) addBlock(event.getPlayer(), event); - else if (Util().Event().isAction(event, ActionType.R)) + else if (UtilEvent.isAction(event, ActionType.R)) glowBlocks(event.getPlayer(), event); } - else if (Util().Gear().isMat(event.getPlayer().getItemInHand(), Material.REDSTONE)) + else if (UtilGear.isMat(event.getPlayer().getItemInHand(), Material.REDSTONE)) { - if (Util().Event().isAction(event, ActionType.L_BLOCK)) + if (UtilEvent.isAction(event, ActionType.L_BLOCK)) delBlock(event.getPlayer(), event); - else if (Util().Event().isAction(event, ActionType.R)) + else if (UtilEvent.isAction(event, ActionType.R)) glowBlocks(event.getPlayer(), event); } } private void glowBlocks(Player player, PlayerInteractEvent event) { - if (!Clients().Get(player).Rank().Has(Rank.ADMIN, false)) - return; - load(); for (FieldBlockData cur : _blocks.values()) @@ -293,12 +137,12 @@ public class FieldBlock extends AModule event.setCancelled(true); } - private void wipe(Player player) + public void wipe(Player player) { for (FieldBlockData cur : _blocks.values()) { cur.setEmpty(); - GetRepository().DeleteFieldBlock(_serverName, UtilWorld.locToStr(cur.getLocation())); + _repository.deleteFieldBlock(_serverName, UtilWorld.locToStr(cur.getLocation())); } _blocks.clear(); @@ -308,10 +152,7 @@ public class FieldBlock extends AModule private void delBlock(Player player, PlayerInteractEvent event) { - if (!Clients().Get(player).Rank().Has(Rank.ADMIN, false)) - return; - - GetRepository().DeleteFieldBlock(_serverName, UtilWorld.locToStr(event.getClickedBlock().getLocation())); + _repository.deleteFieldBlock(_serverName, UtilWorld.locToStr(event.getClickedBlock().getLocation())); //Inform event.getClickedBlock().getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, 42); @@ -322,9 +163,6 @@ public class FieldBlock extends AModule private void addBlock(Player player, PlayerInteractEvent event) { - if (!Clients().Get(player).Rank().Has(Rank.ADMIN, false)) - return; - populateSettings(player); showSettings(player); @@ -340,7 +178,7 @@ public class FieldBlock extends AModule token.StockRegenTime = _regen.get(player); token.Loot = _lootString.get(player); - GetRepository().AddFieldBlock(token); + _repository.addFieldBlock(token); //Inform event.getClickedBlock().getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, 41); @@ -388,7 +226,7 @@ public class FieldBlock extends AModule { clean(); - for (FieldBlockToken token : GetRepository().GetFieldBlocks(_serverName)) + for (FieldBlockToken token : _repository.getFieldBlocks(_serverName)) { Location loc = UtilWorld.strToLoc(token.Location); _blocks.put(token.Location, new FieldBlockData(this, loc, token.BlockId, token.BlockData, token.EmptyId, token.EmptyData, token.StockMax, token.StockRegenTime, token.Loot)); @@ -409,5 +247,50 @@ public class FieldBlock extends AModule return _blocks.get(UtilWorld.locToStr(block.getLocation())); return null; + } + + public Energy getEnergy() + { + return _energy; + } + + public HashSet getActive() + { + return _active; + } + + public WeakHashMap getLootString() + { + return _lootString; + } + + public WeakHashMap getEmptyId() + { + return _emptyId; + } + + public WeakHashMap getEmptyData() + { + return _emptyData; + } + + public WeakHashMap getRegen() + { + return _regen; + } + + public WeakHashMap getStock() + { + return _stock; + } + + public WeakHashMap getTitle() + { + return null; + } + + public ConditionFactory getCondition() + { + return _conditionFactory; } } diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlockData.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockData.java similarity index 94% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlockData.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockData.java index 8dc5afe28..8fd91b4af 100644 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlockData.java +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockData.java @@ -53,7 +53,7 @@ public class FieldBlockData if (loot.length != 5) { - Field.Log("Loot Failure: " + cur); + System.out.println("Loot Failure: " + cur); continue; } @@ -68,7 +68,7 @@ public class FieldBlockData } catch (Exception e) { - Field.Log("Loot Failure: " + cur); + System.out.println("Loot Failure: " + cur); } } @@ -129,7 +129,7 @@ public class FieldBlockData public void handleMined(Player player) { - if (!Field.Energy().use(player, "Mine Field Block", 60, true, true)) + if (!Field.getEnergy().Use(player, "Mine Field Block", 60, true, true)) return; //Set Break Time - Avoid Instant Regen @@ -151,7 +151,7 @@ public class FieldBlockData } //Slow - Field.Condition().Factory().Slow("Field Slow", player, player, 6, 1, false, true, false); + Field.getCondition().Slow("Field Slow", player, player, 6, 1, false, true, false, false); } public boolean tryMine() diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlockLootData.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockLootData.java similarity index 100% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldBlockLootData.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockLootData.java diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java new file mode 100644 index 000000000..417e3e353 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java @@ -0,0 +1,174 @@ +package me.chiss.Core.Field; + +import java.util.HashSet; +import java.util.WeakHashMap; + +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilWorld; +import mineplex.core.creature.Creature; +import me.chiss.Core.Field.Monsters.FieldMonsterBase; +import me.chiss.Core.Field.repository.FieldMonsterToken; +import me.chiss.Core.Field.repository.FieldRepository; + +public class FieldMonster extends MiniPlugin +{ + private Creature _creature; + private FieldRepository _repository; + private HashSet _pits; + private String _serverName; + + private WeakHashMap _input = new WeakHashMap(); + + public FieldMonster(JavaPlugin plugin, FieldRepository repository, Creature creature, String serverName) + { + super("Field Monster", plugin); + + _repository = repository; + _creature = creature; + _pits = new HashSet(); + _serverName = serverName; + + Load(); + } + + public void Help(Player caller) + { + UtilPlayer.message(caller, F.main(GetName(), "Commands List;")); + UtilPlayer.message(caller, F.help("/fm type ", "Set Monster Type", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm max <#>", "Set Monster Limit", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm rate ", "Set Monster Rate", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm radius <#>", "Set Area Radius", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm height <#>", "Set Area Height", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm create ", "Create at your Location", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm delete ", "Delete Field", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm list", "List Monster Fields", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm info ", "Display Monster Field", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm kill", "Kills all Field Monsters", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/fm wipe", "Delete All Monster Field (Database)", Rank.ADMIN)); + } + + public void Create(Player caller, String name) + { + FieldMonsterInput input = _input.get(caller); + + if (input.type == null) + { + UtilPlayer.message(caller, F.main(GetName(), "You have not set Monster Type.")); + return; + } + + for (FieldMonsterBase pit : _pits) + { + if (name.equalsIgnoreCase(pit.GetName())) + { + UtilPlayer.message(caller, F.main(GetName(), "Monster Field with this name already exists.")); + return; + } + } + + FieldMonsterBase pit = new FieldMonsterBase(this, name, _serverName, input.type, input.mobMax, input.mobRate, caller.getLocation(), input.radius, input.height); + Add(pit, true); + + UtilPlayer.message(caller, F.main(GetName(), "You created Monster Field.")); + pit.Display(caller); + } + + private void Add(FieldMonsterBase pit, boolean repo) + { + UtilServer.getServer().getPluginManager().registerEvents(pit, GetPlugin()); + _pits.add(pit); + + if (repo) + _repository.addFieldMonster(pit.GetToken()); + } + + public void Delete(Player caller, String name) + { + HashSet remove = new HashSet(); + + for (FieldMonsterBase pit : _pits) + if (pit.GetName().equalsIgnoreCase(name)) + remove.add(pit); + + int i = remove.size(); + + for (FieldMonsterBase pit : remove) + Delete(pit, true); + + UtilPlayer.message(caller, F.main(GetName(), "Deleted " + i + " Monster Field(s).")); + } + + private void Delete(FieldMonsterBase pit, boolean repo) + { + _pits.remove(pit); + pit.RemoveMonsters(); + HandlerList.unregisterAll(pit); + + if (repo) + _repository.deleteFieldMonster(_serverName, pit.GetToken().Name); + } + + public void Wipe(Player player, boolean repo) + { + HashSet remove = new HashSet(); + + for (FieldMonsterBase pit : _pits) + remove.add(pit); + + _pits.clear(); + + for (FieldMonsterBase pit : remove) + Delete(pit, repo); + + UtilPlayer.message(player, F.main(_moduleName, "Field Monsters Wiped.")); + } + + private void Load() + { + Wipe(null, false); + + for (FieldMonsterToken token : _repository.getFieldMonsters(_serverName)) + { + EntityType type = UtilEnt.searchEntity(null, token.Type, false); + if (type == null) continue; + + Location loc = UtilWorld.strToLoc(token.Centre); + if (loc == null) continue; + + FieldMonsterBase pit = new FieldMonsterBase(this, token.Name, _serverName, type, token.MobMax, token.MobRate, loc, token.Radius, token.Height); + Add(pit, false); + } + } + + private void Clean() + { + for (FieldMonsterBase pit : _pits) + pit.RemoveMonsters(); + } + + public WeakHashMap getInput() + { + return _input; + } + + public HashSet getPits() + { + return _pits; + } + + public Creature getCreature() + { + return _creature; + } +} diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldMonsterInput.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonsterInput.java similarity index 100% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldMonsterInput.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonsterInput.java diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldOre.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOre.java similarity index 73% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldOre.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOre.java index c64bf2609..e6a510ff9 100644 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldOre.java +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOre.java @@ -3,8 +3,6 @@ package me.chiss.Core.Field; import java.util.ArrayList; import java.util.HashSet; -import nautilus.minecraft.core.webserver.token.Server.FieldOreToken; - import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; @@ -16,20 +14,24 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; -import me.chiss.Core.Module.AModule; -import mineplex.core.server.IRepository; +import me.chiss.Core.Field.repository.FieldOreToken; +import me.chiss.Core.Field.repository.FieldRepository; +import mineplex.core.MiniPlugin; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.Rank; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilEvent.ActionType; -public class FieldOre extends AModule +public class FieldOre extends MiniPlugin { + private FieldRepository _repository; private HashSet _active = new HashSet(); private ArrayList _oreInactive = new ArrayList(); @@ -42,86 +44,15 @@ public class FieldOre extends AModule private String _serverName; - public FieldOre(JavaPlugin plugin, IRepository repository, String serverName) + public FieldOre(JavaPlugin plugin, FieldRepository repository, String serverName) { - super("Field Ore", plugin, repository); + super("Field Ore", plugin); + _repository = repository; _serverName = serverName; load(); } - - @Override - public void enable() - { - - } - - @Override - public void disable() - { - clean(); - } - - @Override - public void config() - { - - } - - @Override - public void commands() - { - AddCommand("fo"); - } - - @Override - public void command(Player caller, String cmd, String[] args) - { - if (!Clients().Get(caller).Rank().Has(Rank.ADMIN, true)) - return; - - if (args.length == 0) - { - help(caller); - return; - } - - if (args[0].equalsIgnoreCase("toggle")) - { - if (!_active.remove(caller.getName())) - _active.add(caller.getName()); - - UtilPlayer.message(caller, F.main(GetName(), "Interact Active: " + F.tf(_active.contains(caller.getName())))); - } - - else if (args[0].equalsIgnoreCase("help")) - { - help(caller); - } - - else if (args[0].equalsIgnoreCase("reset")) - { - reset(caller); - } - - else if (args[0].equalsIgnoreCase("fill")) - { - fill(caller); - } - - else if (args[0].equalsIgnoreCase("list")) - { - list(caller); - } - - else if (args[0].equalsIgnoreCase("wipe")) - { - wipe(caller); - } - - - } public void help(Player caller) { @@ -139,17 +70,17 @@ public class FieldOre extends AModule if (!_active.contains(event.getPlayer().getName())) return; - if (Util().Gear().isMat(event.getPlayer().getItemInHand(), Material.DIAMOND)) + if (UtilGear.isMat(event.getPlayer().getItemInHand(), Material.DIAMOND)) { - if (Util().Event().isAction(event, ActionType.L)) + if (UtilEvent.isAction(event, ActionType.L)) addBlock(event.getPlayer(), event); - else if (Util().Event().isAction(event, ActionType.R_BLOCK)) + else if (UtilEvent.isAction(event, ActionType.R_BLOCK)) delBlock(event.getPlayer(), event); } } - private void reset(Player player) + public void reset(Player player) { for (FieldOreData ore : _oreActive) { @@ -162,7 +93,7 @@ public class FieldOre extends AModule UtilPlayer.message(player, F.main(_moduleName, "Field Ore Reset.")); } - private void fill(Player player) + public void fill(Player player) { while (!_oreInactive.isEmpty()) _oreInactive.get(UtilMath.r(_oreInactive.size())).StartVein(2 + UtilMath.r(5)); @@ -170,20 +101,20 @@ public class FieldOre extends AModule UtilPlayer.message(player, F.main(_moduleName, "Field Ore Generated.")); } - private void list(Player player) + public void list(Player player) { UtilPlayer.message(player, F.main(_moduleName, F.value("Total", ""+_oreLocations.size()))); UtilPlayer.message(player, F.main(_moduleName, F.value("Active", ""+_oreActive.size()))); UtilPlayer.message(player, F.main(_moduleName, F.value("Inactive", ""+_oreInactive.size()))); } - private void wipe(Player player) + public void wipe(Player player) { reset(player); for (Location loc : _oreLocations) { - GetRepository().DeleteFieldOre(_serverName, UtilWorld.locToStr(loc)); + _repository.deleteFieldOre(_serverName, UtilWorld.locToStr(loc)); } _oreInactive.clear(); @@ -194,9 +125,6 @@ public class FieldOre extends AModule private void addBlock(Player player, PlayerInteractEvent event) { - if (!Clients().Get(player).Rank().Has(Rank.ADMIN, false)) - return; - Block block = player.getTargetBlock(null, 0); if (Get(block.getLocation()) != null) @@ -209,7 +137,7 @@ public class FieldOre extends AModule FieldOreToken token = new FieldOreToken(); token.Server = _serverName; token.Location = UtilWorld.locToStr(block.getLocation()); - GetRepository().AddFieldOre(token); + _repository.addFieldOre(token); //Memory _oreInactive.add(new FieldOreData(this, block.getLocation())); @@ -223,9 +151,6 @@ public class FieldOre extends AModule private void delBlock(Player player, PlayerInteractEvent event) { - if (!Clients().Get(player).Rank().Has(Rank.ADMIN, false)) - return; - event.setCancelled(true); FieldOreData ore = Get(event.getPlayer().getTargetBlock(null, 0).getLocation()); @@ -236,7 +161,7 @@ public class FieldOre extends AModule return; } - GetRepository().DeleteFieldOre(_serverName, UtilWorld.locToStr(event.getClickedBlock().getLocation())); + _repository.deleteFieldOre(_serverName, UtilWorld.locToStr(event.getClickedBlock().getLocation())); ore.GetLocation().getBlock().setType(Material.STONE); @@ -320,7 +245,7 @@ public class FieldOre extends AModule { clean(); - for (FieldOreToken token : GetRepository().GetFieldOres(_serverName)) + for (FieldOreToken token : _repository.getFieldOres(_serverName)) { Location loc = UtilWorld.strToLoc(token.Location); @@ -337,4 +262,9 @@ public class FieldOre extends AModule _oreActive.clear(); _oreLocations.clear(); } + + public HashSet getActivePlayers() + { + return _active; + } } diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldOreData.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOreData.java similarity index 100% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldOreData.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOreData.java diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java similarity index 93% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java index 766fc4c5d..3ec4965ba 100644 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java @@ -6,6 +6,7 @@ import java.util.HashSet; import me.chiss.Core.Field.FieldMonster; import me.chiss.Core.Field.UtilField; +import me.chiss.Core.Field.repository.FieldMonsterToken; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.util.F; @@ -14,13 +15,12 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; -import nautilus.minecraft.core.webserver.token.Server.FieldMonsterToken; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; import org.bukkit.Location; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -84,7 +84,7 @@ public class FieldMonsterBase implements Listener _mobLast = System.currentTimeMillis(); - Entity ent = Manager.Creature().SpawnEntity(SelectLocation(), _type); + Entity ent = Manager.getCreature().SpawnEntity(SelectLocation(), _type); _mobs.put(ent, 0); } diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/UtilField.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/UtilField.java similarity index 100% rename from Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/UtilField.java rename to Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/UtilField.java diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java new file mode 100644 index 000000000..1b3fdbfff --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java @@ -0,0 +1,145 @@ +package me.chiss.Core.Field.commands; + +import org.bukkit.entity.Player; + +import me.chiss.Core.Field.FieldBlock; +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; + +public class FieldBlockCommand extends CommandBase +{ + public FieldBlockCommand(FieldBlock plugin) + { + super(plugin, Rank.ADMIN, "fb"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args[0].equalsIgnoreCase("toggle")) + { + if (!Plugin.getActive().remove(caller.getName())) + Plugin.getActive().add(caller.getName()); + + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Interact Active: " + F.tf(Plugin.getActive().contains(caller.getName())))); + } + + else if (args[0].equalsIgnoreCase("load")) + { + Plugin.load(); + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Reloaded Field Blocks from Database.")); + } + + else if (args[0].equalsIgnoreCase("wipe")) + { + Plugin.wipe(caller); + } + + else if (args[0].equalsIgnoreCase("help")) + { + Plugin.help(caller); + } + + else if (args.length <= 1) + { + Plugin.help(caller); + } + + else if (args[0].equalsIgnoreCase("title")) + { + Plugin.getTitle().put(caller, args[1]); + Plugin.showSettings(caller); + } + + else if (args[0].equalsIgnoreCase("stock")) + { + try + { + int count = Integer.parseInt(args[1]); + if (count < 1) count = 1; + Plugin.getStock().put(caller, count); + Plugin.showSettings(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Stock Max.")); + } + } + + else if (args[0].equalsIgnoreCase("regen")) + { + try + { + double regen = Double.parseDouble(args[1]); + if (regen < 0) regen = 0; + Plugin.getRegen().put(caller, UtilMath.trim(1, regen)); + Plugin.showSettings(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Stock Regeneration Time.")); + } + } + + else if (args[0].equalsIgnoreCase("empty")) + { + try + { + String[] toks = args[1].split(":"); + + int id = Integer.parseInt(toks[0]); + byte data = Byte.parseByte(toks[1]); + + Plugin.getEmptyId().put(caller, id); + Plugin.getEmptyData().put(caller, data); + Plugin.showSettings(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Empty Block.")); + } + } + + + else if (args[0].equalsIgnoreCase("loot")) + { + boolean error = false; + for (String cur : args[1].split(",")) + { + String[] loot = cur.split(":"); + + if (loot.length != 5) + { + error = true; + break; + } + + try + { + Integer.parseInt(loot[0]); + Byte.parseByte(loot[1]); + Integer.parseInt(loot[2]); + Integer.parseInt(loot[3]); + Integer.parseInt(loot[4]); + } + catch (Exception e) + { + error = true; + break; + } + } + + if (error) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Loot String.")); + return; + } + + Plugin.getLootString().put(caller, args[1]); + Plugin.showSettings(caller); + } + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java new file mode 100644 index 000000000..c313ebd79 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java @@ -0,0 +1,170 @@ +package me.chiss.Core.Field.commands; + +import org.bukkit.entity.Player; + +import me.chiss.Core.Field.FieldMonster; +import me.chiss.Core.Field.FieldMonsterInput; +import me.chiss.Core.Field.Monsters.FieldMonsterBase; +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilPlayer; + +public class FieldMonsterCommand extends CommandBase +{ + public FieldMonsterCommand(FieldMonster plugin) + { + super(plugin, Rank.ADMIN, "fm"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (!Plugin.getInput().containsKey(caller)) + Plugin.getInput().put(caller, new FieldMonsterInput()); + + FieldMonsterInput input = Plugin.getInput().get(caller); + + if (args.length == 0) + { + Plugin.getInput().get(caller).Display(caller); + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Type " + F.elem("/fm help") + " for commands.")); + } + + else if (args[0].equalsIgnoreCase("help")) + { + Plugin.Help(caller); + } + + else if (args[0].equalsIgnoreCase("type")) + { + try + { + input.type = UtilEnt.searchEntity(caller, args[1], true); + if (input.type != null) + input.Display(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Monster Type.")); + } + } + + else if (args[0].equalsIgnoreCase("max")) + { + try + { + int value = Integer.parseInt(args[1]); + if (value < 1) value = 1; + input.mobMax = value; + input.Display(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Monster Max.")); + } + } + + else if (args[0].equalsIgnoreCase("rate")) + { + try + { + double value = Double.parseDouble(args[1]); + if (value < 0) value = 0; + input.mobRate = value; + input.Display(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Monster Rate.")); + } + } + + else if (args[0].equalsIgnoreCase("radius")) + { + try + { + int integer = Integer.parseInt(args[1]); + if (integer < 1) integer = 1; + input.radius = integer; + input.Display(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Area Radius.")); + } + } + + else if (args[0].equalsIgnoreCase("height")) + { + try + { + int integer = Integer.parseInt(args[1]); + if (integer < 1) integer = 1; + input.height = integer; + input.Display(caller); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Area Height.")); + } + } + + else if (args[0].equalsIgnoreCase("create")) + { + if (args.length < 2) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Missing Monster Field Name.")); + } + else + { + Plugin.Create(caller, args[1]); + } + } + + else if (args[0].equalsIgnoreCase("delete")) + { + if (args.length < 2) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Missing Monster Field Name.")); + } + else + { + Plugin.Delete(caller, args[1]); + } + } + + else if (args[0].equalsIgnoreCase("list")) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Monster Fields;")); + + for (FieldMonsterBase pit : Plugin.getPits()) + pit.Display(caller); + } + + else if (args[0].equalsIgnoreCase("info")) + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Monster Fields;")); + + for (FieldMonsterBase pit : Plugin.getPits()) + pit.Display(caller); + } + + else if (args[0].equalsIgnoreCase("wipe")) + { + Plugin.Wipe(caller, true); + } + + else if (args[0].equalsIgnoreCase("kill")) + { + for (FieldMonsterBase pit : Plugin.getPits()) + pit.RemoveMonsters(); + } + + else + { + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Command.")); + } + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java new file mode 100644 index 000000000..9a129fa97 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java @@ -0,0 +1,60 @@ +package me.chiss.Core.Field.commands; + +import org.bukkit.entity.Player; + +import me.chiss.Core.Field.FieldOre; +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; + +public class FieldOreCommand extends CommandBase +{ + public FieldOreCommand(FieldOre plugin) + { + super(plugin, Rank.ADMIN, "fo"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args.length == 0) + { + Plugin.help(caller); + return; + } + + if (args[0].equalsIgnoreCase("toggle")) + { + if (!Plugin.getActivePlayers().remove(caller.getName())) + Plugin.getActivePlayers().add(caller.getName()); + + UtilPlayer.message(caller, F.main(Plugin.GetName(), "Interact Active: " + F.tf(Plugin.getActivePlayers().contains(caller.getName())))); + } + + else if (args[0].equalsIgnoreCase("help")) + { + Plugin.help(caller); + } + + else if (args[0].equalsIgnoreCase("reset")) + { + Plugin.reset(caller); + } + + else if (args[0].equalsIgnoreCase("fill")) + { + Plugin.fill(caller); + } + + else if (args[0].equalsIgnoreCase("list")) + { + Plugin.list(caller); + } + + else if (args[0].equalsIgnoreCase("wipe")) + { + Plugin.wipe(caller); + } + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java new file mode 100644 index 000000000..5e14a9575 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java @@ -0,0 +1,14 @@ +package me.chiss.Core.Field.repository; + +public class FieldBlockToken +{ + public String Server; + public String Location; + public int BlockId; + public byte BlockData; + public int EmptyId; + public byte EmptyData; + public int StockMax; + public double StockRegenTime; + public String Loot; +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java new file mode 100644 index 000000000..4af6f408a --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java @@ -0,0 +1,13 @@ +package me.chiss.Core.Field.repository; + +public class FieldMonsterToken +{ + public String Name; + public String Server; + public String Type; + public int MobMax; + public double MobRate; + public String Centre; + public int Radius; + public int Height; +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java new file mode 100644 index 000000000..ca8724762 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java @@ -0,0 +1,7 @@ +package me.chiss.Core.Field.repository; + +public class FieldOreToken +{ + public String Server; + public String Location; +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java new file mode 100644 index 000000000..55d8e538f --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java @@ -0,0 +1,182 @@ +package me.chiss.Core.Field.repository; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.database.RepositoryBase; +import mineplex.core.database.ResultSetCallable; +import mineplex.core.database.column.ColumnByte; +import mineplex.core.database.column.ColumnDouble; +import mineplex.core.database.column.ColumnInt; +import mineplex.core.database.column.ColumnVarChar; + +public class FieldRepository extends RepositoryBase +{ + private static String CREATE_FIELD_BLOCK_TABLE = "CREATE TABLE IF NOT EXISTS fieldBlock (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), location VARCHAR(100), blockId INT, blockData TINYINT, emptyId INT, emptyData TINYINT, stockMax INT, stockRegenTime DOUBLE, loot VARCHAR(100) PRIMARY KEY (id), INDEX serverLocation (server, location));"; + private static String CREATE_FIELD_ORE_TABLE = "CREATE TABLE IF NOT EXISTS fieldOre (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), location VARCHAR(100), PRIMARY KEY (id), INDEX serverLocation (server, location));"; + private static String CREATE_FIELD_MONSTER_TABLE = "CREATE TABLE IF NOT EXISTS fieldMonster (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), name VARCHAR(100), type VARCHAR(100), mobMax INT, mobRate DOUBLE, center VARCHAR(100), radius INT, height INT PRIMARY KEY (id), INDEX serverName (server, name));"; + private static String RETRIEVE_FIELD_BLOCKS = "SELECT server, location, blockId, blockData, emptyId, emptyData, stockMax, stockRegen, loot FROM fieldBlock WHERE server = ?;"; + private static String ADD_FIELD_BLOCK = "INSERT INTO fieldBlock (server, location, blockId, blockData, emptyId, emptyData, stockMax, stockRegen, loot) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);"; + private static String DEL_FIELD_BLOCK = "DELETE FROM fieldBlock WHERE server = ? AND location = ?;"; + private static String RETRIEVE_FIELD_ORES = "SELECT server, location FROM fieldOre WHERE server = ?;"; + private static String ADD_FIELD_ORE = "INSERT INTO fieldBlock (server, location) VALUES (?, ?);"; + private static String DEL_FIELD_ORE = "DELETE FROM fieldOre WHERE server = ? AND location = ?;"; + private static String RETRIEVE_FIELD_MONSTERS = "SELECT server, name, type, mobMax, mobRate, center, radius, height FROM fieldMonster WHERE server = ?;"; + private static String ADD_FIELD_MONSTER = "INSERT INTO fieldBlock (server, name, type, mobMax, mobRate, center, radius, height) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; + private static String DEL_FIELD_MONSTER = "DELETE FROM fieldBlock WHERE server = ? AND name = ?;"; + + public FieldRepository(JavaPlugin plugin) + { + super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh"); + } + + public List getFieldBlocks(String server) + { + final List fieldBlocks = new ArrayList(); + + this.executeQuery(RETRIEVE_FIELD_BLOCKS, new ResultSetCallable() + { + @Override + public void processResultSet(ResultSet resultSet) throws SQLException + { + while (resultSet.next()) + { + FieldBlockToken token = new FieldBlockToken(); + token.Server = resultSet.getString(1); + token.Location = resultSet.getString(2); + token.BlockId = resultSet.getInt(3); + token.BlockData = resultSet.getByte(4); + token.EmptyId = resultSet.getInt(5); + token.EmptyData = resultSet.getByte(6); + token.StockMax = resultSet.getInt(7); + token.StockRegenTime = resultSet.getLong(8); + token.Loot = resultSet.getString(9); + + fieldBlocks.add(token); + } + } + }, new ColumnVarChar("server", 100, server)); + + return fieldBlocks; + } + + public void addFieldBlock(FieldBlockToken token) + { + executeUpdate(ADD_FIELD_BLOCK, + new ColumnVarChar("server", 100, token.Server), + new ColumnVarChar("location", 100, token.Location), + new ColumnInt("blockId", token.BlockId), + new ColumnByte("blockData", token.BlockData), + new ColumnInt("emptyId", token.EmptyId), + new ColumnByte("emptyData", token.EmptyData), + new ColumnInt("stockMax", token.StockMax), + new ColumnDouble("stockRegen", token.StockRegenTime), + new ColumnVarChar("loot", 100, token.Loot) + ); + } + + public void deleteFieldBlock(String server, String location) + { + executeUpdate(DEL_FIELD_BLOCK, new ColumnVarChar("server", 100, server), new ColumnVarChar("location", 100, location)); + } + + public List getFieldOres(String server) + { + final List fieldOres = new ArrayList(); + + this.executeQuery(RETRIEVE_FIELD_ORES, new ResultSetCallable() + { + @Override + public void processResultSet(ResultSet resultSet) throws SQLException + { + while (resultSet.next()) + { + FieldOreToken token = new FieldOreToken(); + token.Server = resultSet.getString(1); + token.Location = resultSet.getString(2); + + fieldOres.add(token); + } + } + }, new ColumnVarChar("server", 100, server)); + + return fieldOres; + } + + public void addFieldOre(FieldOreToken token) + { + executeUpdate(ADD_FIELD_ORE, + new ColumnVarChar("server", 100, token.Server), + new ColumnVarChar("location", 100, token.Location) + ); + } + + public void deleteFieldOre(String server, String location) + { + executeUpdate(DEL_FIELD_ORE, new ColumnVarChar("server", 100, server), new ColumnVarChar("location", 100, location)); + } + + public List getFieldMonsters(String server) + { + List fieldMonsters = new ArrayList(); + + this.executeQuery(RETRIEVE_FIELD_MONSTERS, new ResultSetCallable() + { + @Override + public void processResultSet(ResultSet resultSet) throws SQLException + { + while (resultSet.next()) + { + FieldMonsterToken token = new FieldMonsterToken(); + token.Name = resultSet.getString(1); + token.Server = resultSet.getString(2); + token.Type = resultSet.getString(3); + token.MobMax = resultSet.getInt(4); + token.MobRate = resultSet.getDouble(5); + token.Centre = resultSet.getString(6); + token.Radius = resultSet.getInt(7); + token.Height = resultSet.getInt(8); + } + } + }, new ColumnVarChar("server", 100, server)); + + return fieldMonsters; + } + + public void addFieldMonster(FieldMonsterToken token) + { + executeUpdate(ADD_FIELD_MONSTER, + new ColumnVarChar("server", 100, token.Server), + new ColumnVarChar("name", 100, token.Name), + new ColumnVarChar("blockId", 100, token.Type), + new ColumnInt("mobMax", token.MobMax), + new ColumnDouble("mobRate", token.MobRate), + new ColumnVarChar("center", 100, token.Centre), + new ColumnInt("redius", token.Radius), + new ColumnInt("height", token.Height) + ); + } + + public void deleteFieldMonster(String server, String name) + { + executeUpdate(DEL_FIELD_MONSTER, new ColumnVarChar("server", 100, server), new ColumnVarChar("name", 100, name)); + } + + @Override + protected void initialize() + { + executeUpdate(CREATE_FIELD_BLOCK_TABLE); + executeUpdate(CREATE_FIELD_ORE_TABLE); + executeUpdate(CREATE_FIELD_MONSTER_TABLE); + } + + @Override + protected void update() + { + } + +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java new file mode 100644 index 000000000..0a580d70d --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -0,0 +1,147 @@ +package mineplex.game.clans; + +import java.io.File; + +import mineplex.core.CustomTagFix; +import mineplex.core.account.CoreClientManager; +import mineplex.core.antihack.AntiHack; +import mineplex.core.antistack.AntiStack; +import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.command.CommandCenter; +import mineplex.core.common.util.FileUtil; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.creature.Creature; +import mineplex.core.disguise.DisguiseManager; +import mineplex.core.donation.DonationManager; +import mineplex.core.friend.FriendManager; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.inventory.InventoryManager; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.logger.Logger; +import mineplex.core.memory.MemoryFix; +import mineplex.core.message.MessageManager; +import mineplex.core.monitor.LagMeter; +import mineplex.core.mount.MountManager; +import mineplex.core.npc.NpcManager; +import mineplex.core.packethandler.PacketHandler; +import mineplex.core.pet.PetManager; +import mineplex.core.portal.Portal; +import mineplex.core.preferences.PreferencesManager; +import mineplex.core.projectile.ProjectileManager; +import mineplex.core.punish.Punish; +import mineplex.core.recharge.Recharge; +import mineplex.core.serverConfig.ServerConfiguration; +import mineplex.core.spawn.Spawn; +import mineplex.core.status.ServerStatusManager; +import mineplex.core.teleport.Teleport; +import mineplex.core.updater.FileUpdater; +import mineplex.core.updater.Updater; +import mineplex.minecraft.game.core.combat.CombatManager; +import mineplex.minecraft.game.core.damage.DamageManager; +import net.minecraft.server.v1_7_R4.MinecraftServer; + +import org.bukkit.plugin.java.JavaPlugin; + +public class Clans extends JavaPlugin +{ + private String WEB_CONFIG = "webServer"; + + //Modules + private CoreClientManager _clientManager; + private DonationManager _donationManager; + private DamageManager _damageManager; + + private ServerConfiguration _serverConfiguration; + + @Override + public void onEnable() + { + //Delete Old Games Folders + DeleteFolders(); + + //Configs + getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/"); + getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG)); + saveConfig(); + + String webServerAddress = getConfig().getString(WEB_CONFIG); + + Logger.initialize(this); + + //Static Modules + CommandCenter.Initialize(this); + _clientManager = new CoreClientManager(this, webServerAddress); + CommandCenter.Instance.setClientManager(_clientManager); + + ItemStackFactory.Initialize(this, false); + Recharge.Initialize(this); + + _donationManager = new DonationManager(this, webServerAddress); + + _serverConfiguration = new ServerConfiguration(this); + + PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager); + new MessageManager(this, _clientManager, preferenceManager); + + AntiStack antistack = new AntiStack(this); + Creature creature = new Creature(this); + Spawn spawn = new Spawn(this); + Teleport teleport = new Teleport(this, _clientManager, spawn); + ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, _clientManager)); + Portal portal = new Portal(this, serverStatusManager.getCurrentServerName()); + new FileUpdater(this, portal); + PacketHandler packetHandler = new PacketHandler(this); + + DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler); + + _damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager); + + Punish punish = new Punish(this, webServerAddress, _clientManager); + AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager); + AntiHack.Instance.setKick(false); + + BlockRestore blockRestore = new BlockRestore(this); + + ProjectileManager projectileManager = new ProjectileManager(this); + + //Inventory + InventoryManager inventoryManager = new InventoryManager(this); + PetManager petManager = new PetManager(this, _clientManager, _donationManager, creature, webServerAddress); + MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager); + GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager); + CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, true); + cosmeticManager.setInterfaceSlot(7); + + new MemoryFix(this); + new CustomTagFix(this, packetHandler); + + new FriendManager(this, _clientManager, preferenceManager); + + //Updates + getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); + + MinecraftServer.getServer().getPropertyManager().setProperty("debug", true); + } + + private void DeleteFolders() + { + File curDir = new File("."); + + File[] filesList = curDir.listFiles(); + for(File file : filesList) + { + if (!file.isDirectory()) + continue; + + if (file.getName().length() < 4) + continue; + + if (!file.getName().substring(0, 4).equalsIgnoreCase("Game")) + continue; + + FileUtil.DeleteFolder(file); + + System.out.println("Deleted Old Game: " + file.getName()); + } + } +} diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Field.java b/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Field.java deleted file mode 100644 index 8a1fb481c..000000000 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/Field.java +++ /dev/null @@ -1,69 +0,0 @@ -package me.chiss.Core.Field; - - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import me.chiss.Core.Module.AModule; -import mineplex.core.server.IRepository; - -public class Field extends AModule -{ - private FieldBlock _block; - private FieldOre _ore; - private FieldMonster _mob; - - public Field(JavaPlugin plugin, IRepository repository, String serverName) - { - super("Field Factory", plugin, repository); - - _block = new FieldBlock(plugin, repository, serverName); - _ore = new FieldOre(plugin, repository, serverName); - _mob = new FieldMonster(plugin, repository, serverName); - } - - @Override - public void enable() - { - - } - - @Override - public void disable() - { - - } - - @Override - public void config() - { - - } - - @Override - public void commands() - { - - } - - @Override - public void command(Player caller, String cmd, String[] args) - { - - } - - public FieldBlock GetBlock() - { - return _block; - } - - public FieldOre GetOre() - { - return _ore; - } - - public FieldMonster GetMonster() - { - return _mob; - } -} diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldMonster.java b/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldMonster.java deleted file mode 100644 index 9f9dc5886..000000000 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/FieldMonster.java +++ /dev/null @@ -1,332 +0,0 @@ -package me.chiss.Core.Field; - -import java.util.HashSet; -import java.util.WeakHashMap; - -import nautilus.minecraft.core.webserver.token.Server.FieldMonsterToken; - -import org.bukkit.Location; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; -import org.bukkit.plugin.java.JavaPlugin; - -import mineplex.core.server.IRepository; -import mineplex.core.common.Rank; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilWorld; -import me.chiss.Core.Field.Monsters.FieldMonsterBase; -import me.chiss.Core.Module.AModule; - -public class FieldMonster extends AModule -{ - private HashSet _pits; - private String _serverName; - - private WeakHashMap _input = new WeakHashMap(); - - public FieldMonster(JavaPlugin plugin, IRepository repository, String serverName) - { - super("Field Monster", plugin, repository); - - _pits = new HashSet(); - _serverName = serverName; - - Load(); - } - - @Override - public void enable() - { - - } - - @Override - public void disable() - { - Clean(); - } - - @Override - public void config() - { - - } - - @Override - public void commands() - { - AddCommand("fm"); - } - - @Override - public void command(Player caller, String cmd, String[] args) - { - if (!Clients().Get(caller).Rank().Has(Rank.ADMIN, true)) - return; - - if (!_input.containsKey(caller)) - _input.put(caller, new FieldMonsterInput()); - - FieldMonsterInput input = _input.get(caller); - - if (args.length == 0) - { - _input.get(caller).Display(caller); - UtilPlayer.message(caller, F.main(_moduleName, "Type " + F.elem("/fm help") + " for commands.")); - } - - else if (args[0].equalsIgnoreCase("help")) - { - Help(caller); - } - - else if (args[0].equalsIgnoreCase("type")) - { - try - { - input.type = UtilEnt.searchEntity(caller, args[1], true); - if (input.type != null) - input.Display(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Monster Type.")); - } - } - - else if (args[0].equalsIgnoreCase("max")) - { - try - { - int value = Integer.parseInt(args[1]); - if (value < 1) value = 1; - input.mobMax = value; - input.Display(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Monster Max.")); - } - } - - else if (args[0].equalsIgnoreCase("rate")) - { - try - { - double value = Double.parseDouble(args[1]); - if (value < 0) value = 0; - input.mobRate = value; - input.Display(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Monster Rate.")); - } - } - - else if (args[0].equalsIgnoreCase("radius")) - { - try - { - int integer = Integer.parseInt(args[1]); - if (integer < 1) integer = 1; - input.radius = integer; - input.Display(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Area Radius.")); - } - } - - else if (args[0].equalsIgnoreCase("height")) - { - try - { - int integer = Integer.parseInt(args[1]); - if (integer < 1) integer = 1; - input.height = integer; - input.Display(caller); - } - catch (Exception e) - { - UtilPlayer.message(caller, F.main(_moduleName, "Invalid Area Height.")); - } - } - - else if (args[0].equalsIgnoreCase("create")) - { - if (args.length < 2) - { - UtilPlayer.message(caller, F.main(_moduleName, "Missing Monster Field Name.")); - } - else - { - Create(caller, args[1]); - } - } - - else if (args[0].equalsIgnoreCase("delete")) - { - if (args.length < 2) - { - UtilPlayer.message(caller, F.main(_moduleName, "Missing Monster Field Name.")); - } - else - { - Delete(caller, args[1]); - } - } - - else if (args[0].equalsIgnoreCase("list")) - { - UtilPlayer.message(caller, F.main(_moduleName, "Listing Monster Fields;")); - - for (FieldMonsterBase pit : _pits) - pit.Display(caller); - } - - else if (args[0].equalsIgnoreCase("info")) - { - UtilPlayer.message(caller, F.main(GetName(), "Listing Monster Fields;")); - - for (FieldMonsterBase pit : _pits) - pit.Display(caller); - } - - else if (args[0].equalsIgnoreCase("wipe")) - { - Wipe(caller, true); - } - - else if (args[0].equalsIgnoreCase("kill")) - { - for (FieldMonsterBase pit : _pits) - pit.RemoveMonsters(); - } - - else - { - UtilPlayer.message(caller, F.main(GetName(), "Invalid Command.")); - } - } - - private void Help(Player caller) - { - UtilPlayer.message(caller, F.main(GetName(), "Commands List;")); - UtilPlayer.message(caller, F.help("/fm type ", "Set Monster Type", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm max <#>", "Set Monster Limit", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm rate ", "Set Monster Rate", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm radius <#>", "Set Area Radius", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm height <#>", "Set Area Height", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm create ", "Create at your Location", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm delete ", "Delete Field", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm list", "List Monster Fields", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm info ", "Display Monster Field", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm kill", "Kills all Field Monsters", Rank.ADMIN)); - UtilPlayer.message(caller, F.help("/fm wipe", "Delete All Monster Field (Database)", Rank.ADMIN)); - } - - private void Create(Player caller, String name) - { - FieldMonsterInput input = _input.get(caller); - - if (input.type == null) - { - UtilPlayer.message(caller, F.main(GetName(), "You have not set Monster Type.")); - return; - } - - for (FieldMonsterBase pit : _pits) - { - if (name.equalsIgnoreCase(pit.GetName())) - { - UtilPlayer.message(caller, F.main(GetName(), "Monster Field with this name already exists.")); - return; - } - } - - FieldMonsterBase pit = new FieldMonsterBase(this, name, _serverName, input.type, input.mobMax, input.mobRate, caller.getLocation(), input.radius, input.height); - Add(pit, true); - - UtilPlayer.message(caller, F.main(GetName(), "You created Monster Field.")); - pit.Display(caller); - } - - private void Add(FieldMonsterBase pit, boolean repo) - { - UtilServer.getServer().getPluginManager().registerEvents(pit, Plugin()); - _pits.add(pit); - - if (repo) - GetRepository().AddFieldMonster(pit.GetToken()); - } - - private void Delete(Player caller, String name) - { - HashSet remove = new HashSet(); - - for (FieldMonsterBase pit : _pits) - if (pit.GetName().equalsIgnoreCase(name)) - remove.add(pit); - - int i = remove.size(); - - for (FieldMonsterBase pit : remove) - Delete(pit, true); - - UtilPlayer.message(caller, F.main(GetName(), "Deleted " + i + " Monster Field(s).")); - } - - private void Delete(FieldMonsterBase pit, boolean repo) - { - _pits.remove(pit); - pit.RemoveMonsters(); - HandlerList.unregisterAll(pit); - - if (repo) - GetRepository().DeleteFieldMonster(_serverName, pit.GetToken().Name); - } - - private void Wipe(Player player, boolean repo) - { - HashSet remove = new HashSet(); - - for (FieldMonsterBase pit : _pits) - remove.add(pit); - - _pits.clear(); - - for (FieldMonsterBase pit : remove) - Delete(pit, repo); - - UtilPlayer.message(player, F.main(_moduleName, "Field Monsters Wiped.")); - } - - private void Load() - { - Wipe(null, false); - - for (FieldMonsterToken token : GetRepository().GetFieldMonsters(_serverName)) - { - EntityType type = UtilEnt.searchEntity(null, token.Type, false); - if (type == null) continue; - - Location loc = UtilWorld.strToLoc(token.Centre); - if (loc == null) continue; - - FieldMonsterBase pit = new FieldMonsterBase(this, token.Name, _serverName, type, token.MobMax, token.MobRate, loc, token.Radius, token.Height); - Add(pit, false); - } - } - - private void Clean() - { - for (FieldMonsterBase pit : _pits) - pit.RemoveMonsters(); - } -} diff --git a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/repository/FieldRepository.java b/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/repository/FieldRepository.java deleted file mode 100644 index 55722da6b..000000000 --- a/Plugins/Nautilus.Game.PvP/src/me/chiss/Core/Field/repository/FieldRepository.java +++ /dev/null @@ -1,72 +0,0 @@ -package me.chiss.Core.Field.repository; - -public class FieldRepository -{ - public List GetFieldBlocks(String server) - { - return new JsonWebCall(WebServerAddress + "Fields/GetFieldBlocks").Execute(new TypeToken>(){}.getType(), server); - } - - @Override - public void AddFieldBlock(FieldBlockToken token) - { - new AsyncJsonWebCall(WebServerAddress + "Fields/AddFieldBlock").Execute(token); - } - - @Override - public void DeleteFieldBlock(String server, String location) - { - FieldBlockToken token = new FieldBlockToken(); - token.Server = server; - token.Location = location; - - new AsyncJsonWebCall(WebServerAddress + "Fields/DeleteFieldBlock").Execute(token); - } - - //Field Ore - @Override - public List GetFieldOres(String server) - { - return new JsonWebCall(WebServerAddress + "Fields/GetFieldOres").Execute(new TypeToken>(){}.getType(), server); - } - - @Override - public void AddFieldOre(FieldOreToken token) - { - new AsyncJsonWebCall(WebServerAddress + "Fields/AddFieldOre").Execute(token); - } - - @Override - public void DeleteFieldOre(String server, String location) - { - FieldOreToken token = new FieldOreToken(); - token.Server = server; - token.Location = location; - - new AsyncJsonWebCall(WebServerAddress + "Fields/DeleteFieldOre").Execute(token); - } - - //Field Monster - @Override - public List GetFieldMonsters(String server) - { - return new JsonWebCall(WebServerAddress + "Fields/GetFieldMonsters").Execute(new TypeToken>(){}.getType(), server); - } - - @Override - public void AddFieldMonster(FieldMonsterToken token) - { - new AsyncJsonWebCall(WebServerAddress + "Fields/AddFieldMonster").Execute(token); - } - - @Override - public void DeleteFieldMonster(String server, String name) - { - FieldMonsterToken token = new FieldMonsterToken(); - token.Server = server; - token.Name = name; - - new AsyncJsonWebCall(WebServerAddress + "Fields/DeleteFieldMonster").Execute(token); - } - -} diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index 0f4dc2361f5354abbd804ac90862ca71ec3e9584..8a659d60e7b77976795f40580fd30f0400c71794 100644 GIT binary patch delta 13215 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 delta 13124 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 From 2e848c2ac2007be6043d263fec2e44832a1c4752 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Wed, 12 Nov 2014 05:13:58 -0800 Subject: [PATCH 4/6] Fixed some of twiggy conflicts. --- Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java | 2 +- .../Mineplex.Core/src/mineplex/core/report/ReportPlugin.java | 3 +-- .../src/mineplex/serverdata/ServerCommandManager.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java index 8a8427201..0d526ab75 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java @@ -44,7 +44,7 @@ public class Portal extends MiniPlugin Bukkit.getMessenger().registerOutgoingPluginChannel(GetPlugin(), "BungeeCord"); // Register the server command type for future use - ServerCommandManager.getInstance().registerCommandType(TransferCommand.class.getSimpleName(), TransferCommand.class); + ServerCommandManager.getInstance().registerCommandType(TransferCommand.class, new TransferHandler()); } public void SendAllPlayers(String serverName) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java index 5293cf78b..5462203fa 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java @@ -3,7 +3,6 @@ package mineplex.core.report; import mineplex.core.MiniPlugin; import mineplex.core.report.command.ReportCloseCommand; import mineplex.core.report.command.ReportCommand; -import mineplex.core.report.command.ReportDebugCommand; import mineplex.core.report.command.ReportHandleCommand; import org.bukkit.plugin.java.JavaPlugin; @@ -27,6 +26,6 @@ public class ReportPlugin extends MiniPlugin AddCommand(new ReportCommand(this)); AddCommand(new ReportHandleCommand(this)); AddCommand(new ReportCloseCommand(this)); - AddCommand(new ReportDebugCommand(this)); + //AddCommand(new ReportDebugCommand(this)); } } diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerCommandManager.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerCommandManager.java index 361d7d501..6853cf62e 100644 --- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerCommandManager.java +++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerCommandManager.java @@ -121,7 +121,7 @@ public class ServerCommandManager { callback.run(serverCommand); // Run callback } - //} + } } } From 0193c397fb5aa1ee7611044c5e3682234ced8792 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Wed, 12 Nov 2014 19:20:41 -0800 Subject: [PATCH 5/6] Added Kit unlocks to staff server Added password persistence in db. --- .../core/donation/DonationManager.java | 10 +- .../repository/DonationRepository.java | 6 + .../src/mineplex/staffServer/StaffServer.java | 2 +- .../customerSupport/CustomerSupport.java | 4 +- .../staffServer/password/Password.java | 67 ++- .../staffServer/password/PasswordCommand.java | 2 +- .../salespackage/SalesPackageManager.java | 6 +- .../salespackage/command/BoosterCommand.java | 2 +- .../salespackage/command/CoinCommand.java | 2 +- .../command/GemHunterCommand.java | 2 +- .../salespackage/command/RankCommand.java | 2 +- .../salespackage/command/Sales.java | 1 + .../command/TreasureChestCommand.java | 2 +- .../command/TreasureKeyCommand.java | 2 +- .../Models/AccountAdministrator.cs | 76 +++ .../Models/IAccountAdministrator.cs | 1 + .../Controllers/PlayerAccountController.cs | 6 + .../LOC.Website.Web.Publish.xml | 434 +++++++++--------- Website/LOCWebsite.suo | Bin 474624 -> 474624 bytes 19 files changed, 388 insertions(+), 239 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java index 95ae0a980..0b559f9ba 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java @@ -15,6 +15,7 @@ import mineplex.core.common.util.Callback; import mineplex.core.common.util.NautHashMap; import mineplex.core.donation.repository.DonationRepository; import mineplex.core.donation.repository.token.DonorTokenWrapper; +import mineplex.core.server.remotecall.JsonWebCall; import mineplex.core.server.util.TransactionResponse; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -42,8 +43,8 @@ public class DonationManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new GemCommand(this)); - AddCommand(new CoinCommand(this)); + addCommand(new GemCommand(this)); + addCommand(new CoinCommand(this)); } @EventHandler @@ -300,4 +301,9 @@ public class DonationManager extends MiniPlugin //Clean _coinQueue.clear(); } + + public void applyKits(String playerName) + { + _repository.applyKits(playerName); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/DonationRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/DonationRepository.java index 9523c2e06..71c8129ec 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/DonationRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/DonationRepository.java @@ -13,6 +13,7 @@ import mineplex.core.database.column.ColumnVarChar; import mineplex.core.donation.repository.token.GemRewardToken; import mineplex.core.donation.repository.token.PurchaseToken; import mineplex.core.donation.repository.token.UnknownPurchaseToken; +import mineplex.core.server.remotecall.AsyncJsonWebCall; import mineplex.core.server.remotecall.JsonWebCall; import mineplex.core.server.util.TransactionResponse; @@ -184,4 +185,9 @@ public class DonationRepository extends RepositoryBase } }), "Error updating player's null gems and coins DonationRepository : "); } + + public void applyKits(String playerName) + { + new AsyncJsonWebCall(_webAddress + "PlayerAccount/ApplyKits").Execute(playerName); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java index 01541b259..8df18e496 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java @@ -56,7 +56,7 @@ public class StaffServer extends JavaPlugin new FileUpdater(this, portal); new CustomerSupport(this, clientManager, donationManager, new SalesPackageManager(this, clientManager, donationManager, new InventoryManager(this), new StatsManager(this))); - new Password(this); + new Password(this, serverStatusManager.getCurrentServerName()); //Updates getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index 0ed25b7e4..b57adc03b 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -77,12 +77,12 @@ public class CustomerSupport extends MiniPlugin @Override public void AddCommands() { - AddCommand(new checkCommand(this)); + addCommand(new checkCommand(this)); } public void Help(Player caller) { - caller.sendMessage(F.main(GetName(), "Usage : /check defek7")); + caller.sendMessage(F.main(getName(), "Usage : /check defek7")); } public void addAgentMapping(Player caller, String playerName) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java index 8836fdb8f..db26f98bb 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java @@ -9,30 +9,41 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; import mineplex.core.common.util.F; -import mineplex.core.recharge.Recharge; public class Password extends MiniPlugin { + private PasswordRepository _repository; private HashSet _accepted = new HashSet(); - private String _password = "ClothStarRust"; + private String _serverName; + private String _password = null; - public Password(JavaPlugin plugin) + public Password(JavaPlugin plugin, String serverName) { super("Password", plugin); + + _serverName = serverName; + + _repository = new PasswordRepository(plugin, serverName); + _password = _repository.retrievePassword(); } @Override public void AddCommands() { - AddCommand(new PasswordCommand(this)); - AddCommand(new ChangePasswordCommand(this)); + addCommand(new PasswordCommand(this)); + addCommand(new ChangePasswordCommand(this)); + addCommand(new RemovePasswordCommand(this)); + addCommand(new CreatePasswordCommand(this)); } @EventHandler public void promptForPassword(final PlayerJoinEvent event) { - event.getPlayer().sendMessage(F.main(GetName(), "Please enter the server password within 10 seconds.")); + if (_password == null) + return; + + event.getPlayer().sendMessage(F.main(getName(), "Please enter the server password within 10 seconds.")); GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable() { @@ -46,16 +57,56 @@ public class Password extends MiniPlugin public void checkPassword(Player caller, String attempt) { + if (_password == null) + return; + if (attempt.equals(_password)) { _accepted.add(caller); - caller.sendMessage(F.main(GetName(), "I guess you get to stay.")); + caller.sendMessage(F.main(getName(), "That is correct, enjoy your time here...and GET TO WORK ;)")); } } public void changePassword(Player caller, String password) { _password = password; - caller.sendMessage(F.main(GetName(), "Password changed to " + _password)); + + runAsync(new Runnable() + { + public void run() + { + _repository.updatePassword(_password); + } + }); + + caller.sendMessage(F.main(getName(), "Password changed to " + _password)); + } + + public void removePassword(Player caller) + { + runAsync(new Runnable() + { + public void run() + { + _password = null; + _repository.removePassword(); + } + }); + caller.sendMessage(F.main(getName(), "Password removed for " + _serverName)); + } + + public void createPassword(Player caller, String password) + { + _password = password; + + runAsync(new Runnable() + { + public void run() + { + _repository.createPassword(_password); + } + }); + + caller.sendMessage(F.main(getName(), "Password created : " + _password)); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java index 908e15d48..f24d88d40 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java @@ -9,7 +9,7 @@ public class PasswordCommand extends CommandBase { public PasswordCommand(Password plugin) { - super(plugin, Rank.MODERATOR, "password"); + super(plugin, Rank.MODERATOR, "pass", "password"); } @Override diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java index 2efc6a980..973ff09cf 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java @@ -12,6 +12,7 @@ import mineplex.core.inventory.InventoryManager; import mineplex.core.stats.StatsManager; import mineplex.staffServer.salespackage.command.DisplayPackageCommand; import mineplex.staffServer.salespackage.command.Sales; +import mineplex.staffServer.salespackage.salespackages.ApplyKits; import mineplex.staffServer.salespackage.salespackages.Coins; import mineplex.staffServer.salespackage.salespackages.GemHunter; import mineplex.staffServer.salespackage.salespackages.LifetimeHero; @@ -47,6 +48,7 @@ public class SalesPackageManager extends MiniPlugin AddSalesPackage(new LifetimeHero(this)); AddSalesPackage(new GemHunter(this, 4)); AddSalesPackage(new GemHunter(this, 8)); + AddSalesPackage(new ApplyKits(this)); } private void AddSalesPackage(SalesPackageBase salesPackage) @@ -57,8 +59,8 @@ public class SalesPackageManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new DisplayPackageCommand(this)); - AddCommand(new Sales(this)); + addCommand(new DisplayPackageCommand(this)); + addCommand(new Sales(this)); } public DonationManager getDonationManager() diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/BoosterCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/BoosterCommand.java index 492f78307..aaeee75a9 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/BoosterCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/BoosterCommand.java @@ -30,6 +30,6 @@ public class BoosterCommand extends CommandBase Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Gem Booster " + amount, false, 0, false); Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Utility", "Gem Booster", amount); - caller.sendMessage(F.main(Plugin.GetName(), "Added " + amount + " boosters to " + playerName + "'s account!")); + caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " boosters to " + playerName + "'s account!")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java index 117db806c..8367ce2ae 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java @@ -29,6 +29,6 @@ public class CoinCommand extends CommandBase UUID uuid = UUIDFetcher.getUUIDOf(playerName); Plugin.getDonationManager().RewardCoins(null, caller.getName(), playerName, uuid, amount); - caller.sendMessage(F.main(Plugin.GetName(), "Added " + amount + " coins to " + playerName + "'s account!")); + caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " coins to " + playerName + "'s account!")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/GemHunterCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/GemHunterCommand.java index 00a277c64..76f257b67 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/GemHunterCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/GemHunterCommand.java @@ -35,6 +35,6 @@ public class GemHunterCommand extends CommandBase Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Gem Hunter Level " + amount, false, 0, false); Plugin.getStatsManager().incrementStat(uuid.toString(), "Global.GemsEarned", experience); - caller.sendMessage(F.main(Plugin.GetName(), "Added Level " + amount + " Gem Hunter to " + playerName + "'s account!")); + caller.sendMessage(F.main(Plugin.getName(), "Added Level " + amount + " Gem Hunter to " + playerName + "'s account!")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/RankCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/RankCommand.java index 70afd046b..bd155a57f 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/RankCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/RankCommand.java @@ -29,7 +29,7 @@ public class RankCommand extends CommandBase if (rankEnum == Rank.HERO || rankEnum == Rank.ULTRA) { Plugin.getClientManager().SaveRank(playerName, mineplex.core.common.Rank.valueOf(rank), perm); - caller.sendMessage(F.main(Plugin.GetName(), playerName + "'s rank has been updated to " + rank + "!")); + caller.sendMessage(F.main(Plugin.getName(), playerName + "'s rank has been updated to " + rank + "!")); } } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java index 47bb4faf3..8d6a4be3a 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java @@ -22,6 +22,7 @@ public class Sales extends MultiCommandBase AddCommand(new HeroCommand(plugin)); AddCommand(new LifetimeUltraCommand(plugin)); AddCommand(new LifetimeHeroCommand(plugin)); + AddCommand(new KitsCommand(plugin)); } @Override diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureChestCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureChestCommand.java index 939544ead..8f49792ae 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureChestCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureChestCommand.java @@ -30,6 +30,6 @@ public class TreasureChestCommand extends CommandBase Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Chest " + amount, false, 0, false); Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Utility", "Treasure Chest", amount); - caller.sendMessage(F.main(Plugin.GetName(), "Added " + amount + " treasure chests to " + playerName + "'s account!")); + caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " treasure chests to " + playerName + "'s account!")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureKeyCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureKeyCommand.java index bbd479bd1..077b4fc28 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureKeyCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/TreasureKeyCommand.java @@ -30,6 +30,6 @@ public class TreasureKeyCommand extends CommandBase Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Key " + amount, false, 0, false); Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Treasure", "Treasure Key", amount); - caller.sendMessage(F.main(Plugin.GetName(), "Added " + amount + " treasure Keys to " + playerName + "'s account!")); + caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " treasure Keys to " + playerName + "'s account!")); } } diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index a95d73dad..6ea1af528 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -568,6 +568,82 @@ } } + public void ApplyKits(String name) + { + using (var repository = _repositoryFactory.CreateRepository()) + { + var account = repository.Where(x => String.Equals(x.Name, name)).Include(x => x.Rank).FirstOrDefault(); + account.LoadNavigationProperties(repository.Context); + + addAccountTransaction(repository, account, "Bacon Brawl Bebe Piggles", 0, 0); + addAccountTransaction(repository, account, "Bacon Brawl `Pig`", 0, 0); + addAccountTransaction(repository, account, "A Barbarians Life Barbarian Archer", 0, 0); + addAccountTransaction(repository, account, "A Barbarians Life Bomber", 0, 0); + addAccountTransaction(repository, account, "The Bridges Archer", 0, 0); + addAccountTransaction(repository, account, "The Bridges Bomber", 0, 0); + addAccountTransaction(repository, account, "The Bridges Brawler", 0, 0); + addAccountTransaction(repository, account, "The Bridges Miner", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Castle Assassin", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Castle Brawler", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Castle Knight", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Undead Archer", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Undead Zombie", 0, 0); + addAccountTransaction(repository, account, "Death Tag Runner Archer", 0, 0); + addAccountTransaction(repository, account, "Death Tag Runner Traitor", 0, 0); + addAccountTransaction(repository, account, "Dragon Escape Disruptor", 0, 0); + addAccountTransaction(repository, account, "Dragon Escape Warper", 0, 0); + addAccountTransaction(repository, account, "Dragons Marksman", 0, 0); + addAccountTransaction(repository, account, "Dragons Pyrotechnic", 0, 0); + addAccountTransaction(repository, account, "Block Hunt Instant Hider", 0, 0); + addAccountTransaction(repository, account, "Block Hunt Shocking Hider", 0, 0); + addAccountTransaction(repository, account, "Block Hunt Radar Hunter", 0, 0); + addAccountTransaction(repository, account, "Block Hunt TNT Hunter", 0, 0); + addAccountTransaction(repository, account, "Super Paintball Machine Gun", 0, 0); + addAccountTransaction(repository, account, "Super Paintball Shotgun", 0, 0); + addAccountTransaction(repository, account, "One in the Quiver Brawler", 0, 0); + addAccountTransaction(repository, account, "One in the Quiver Enchanter", 0, 0); + addAccountTransaction(repository, account, "Runner Archer", 0, 0); + addAccountTransaction(repository, account, "Runner Frosty", 0, 0); + addAccountTransaction(repository, account, "Sheep Quest Archer", 0, 0); + addAccountTransaction(repository, account, "Sheep Quest Brute", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Blaze", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Chicken", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Mad Cow", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Creeper", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Enderman", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Undead Knight", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Magma Cube", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Pig", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Skeletal Horse", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Sky Squid", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Snowman", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Witch", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Wither", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Wither Skeleton", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Wolf", 0, 0); + addAccountTransaction(repository, account, "Snake Super Snake", 0, 0); + addAccountTransaction(repository, account, "Snake Other Snake", 0, 0); + addAccountTransaction(repository, account, "Sneaky Assassins Ranged Assassin", 0, 0); + addAccountTransaction(repository, account, "Sneaky Assassins Revealer", 0, 0); + addAccountTransaction(repository, account, "Super Spleef Archer", 0, 0); + addAccountTransaction(repository, account, "Super Spleef Brawler", 0, 0); + addAccountTransaction(repository, account, "Squid Shooter Squid Blaster", 0, 0); + addAccountTransaction(repository, account, "Squid Shooter Squid Sniper", 0, 0); + addAccountTransaction(repository, account, "Survival Games Archer", 0, 0); + addAccountTransaction(repository, account, "Survival Games Assassin", 0, 0); + addAccountTransaction(repository, account, "Survival Games Beastmaster", 0, 0); + addAccountTransaction(repository, account, "Survival Games Bomber", 0, 0); + addAccountTransaction(repository, account, "Survival Games Brawler", 0, 0); + addAccountTransaction(repository, account, "Survival Games Necromancer", 0, 0); + addAccountTransaction(repository, account, "Turf Wars Infiltrator", 0, 0); + addAccountTransaction(repository, account, "Turf Wars Shredder", 0, 0); + addAccountTransaction(repository, account, "Zombie Survival Survivor Archer", 0, 0); + addAccountTransaction(repository, account, "Zombie Survival Survivor Rogue", 0, 0); + + repository.CommitChanges(); + } + } + public string UpdateRank(RankUpdateToken token) { Rank rank = null; diff --git a/Website/LOC.Website.Common/Models/IAccountAdministrator.cs b/Website/LOC.Website.Common/Models/IAccountAdministrator.cs index 9f1dfccd5..e798162b6 100644 --- a/Website/LOC.Website.Common/Models/IAccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/IAccountAdministrator.cs @@ -21,6 +21,7 @@ void ApplySalesPackage(SalesPackage salesPackage, int accountId, decimal gross, decimal fee); Account Login(LoginRequestToken loginToken); void Logout(string name); + void ApplyKits(string name); PunishmentResponse Punish(PunishToken punish); PunishmentResponse RemovePunishment(RemovePunishmentToken ban); diff --git a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs index 6713bef16..820a8212a 100644 --- a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs +++ b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs @@ -82,6 +82,12 @@ _accountAdministrator.AddTask(token); } + [HttpPost] + public void ApplyKits(string name) + { + _accountAdministrator.ApplyKits(name); + } + [HttpPost] public void Logout(string name) { diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index 23627865d..5ef6315c7 100644 --- a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml +++ b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml @@ -1,12 +1,12 @@  + - @@ -19,14 +19,17 @@ - + + + + @@ -40,16 +43,17 @@ - + - + + @@ -58,8 +62,7 @@ - - + @@ -70,23 +73,22 @@ - + + - + - - - + @@ -94,7 +96,7 @@ - + @@ -102,41 +104,44 @@ - - + - + - + + + - + + - + + - + @@ -150,51 +155,45 @@ - - - - + - - - + + - - + - + - - + - - + + @@ -203,72 +202,75 @@ - - + + - + - + - + - - + - + + - + + - + - + - - + + - + - - + + - - + + - + + + @@ -281,17 +283,13 @@ - - + - - - @@ -305,25 +303,26 @@ - + + - + - + @@ -334,28 +333,30 @@ - - + - + + + - + + @@ -363,43 +364,42 @@ + - + + - + - + - - - - + + - - - + + @@ -410,31 +410,34 @@ - + - + + + + + + - - - + + - @@ -442,29 +445,28 @@ - + - - + - + - + @@ -472,66 +474,66 @@ - - + + - + - - - - + + + - + - - + - - + + - - + + - + - - - - - + + + + + - + + + @@ -542,40 +544,39 @@ - + - + - - - + - + + + - @@ -584,9 +585,8 @@ - - + @@ -597,42 +597,44 @@ - - - + - - + + + + - + - + - + + + @@ -645,23 +647,22 @@ + - + - - - + @@ -672,62 +673,63 @@ - + - + + + + + + - - - - - + + + - - - + - + - - + + - - + + - + - + @@ -735,66 +737,66 @@ - + - + - + - - + - + - - + - - + + - - + + - + - - - - - + + + + + - + + + @@ -805,40 +807,39 @@ - + - + - - - + - + + + - @@ -847,9 +848,8 @@ - - + @@ -860,29 +860,29 @@ - - - + - - + + + + @@ -891,11 +891,13 @@ - + - + + + @@ -908,23 +910,22 @@ + - + - - - + @@ -935,62 +936,63 @@ - + - + + + + + + - - - + - - - + - + - - + + - - + + - + - + @@ -998,58 +1000,56 @@ - + - + - + - - + - + - - + - - + + - - + + - + - - - - - + + + + + - + \ No newline at end of file diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index 8a659d60e7b77976795f40580fd30f0400c71794..8bfe187473081cf482bd444e3ab2a07dfeec48ba 100644 GIT binary patch delta 81 zcmZqpBh&ClW(5 gv^*uaQ|Ex7>g0v$!qW@XnFXdNNH8ibd&3q400 Date: Wed, 12 Nov 2014 19:21:12 -0800 Subject: [PATCH 6/6] Refactored some names in MiniPlugin Work on clans. --- .../me/chiss/Core/Scheduler/Scheduler.java | 2 +- .../Core/src/me/chiss/Core/Server/Server.java | 16 +- .../Core/Server/command/ListCommand.java | 2 +- .../src/me/chiss/Core/Vote/VoteManager.java | 2 +- .../Core/Weapon/Commands/WeaponCommand.java | 2 +- .../me/chiss/Core/Weapon/WeaponFactory.java | 2 +- .../src/mineplex/bungee/motd/MotdManager.java | 1 + .../src/mineplex/core/MiniPlugin.java | 19 +- .../core/account/CoreClientManager.java | 2 +- .../core/account/command/UpdateRank.java | 8 +- .../core/achievement/AchievementManager.java | 2 +- .../src/mineplex/core/chat/Chat.java | 12 +- .../core/cosmetic/ui/page/GadgetPage.java | 4 +- .../core/cosmetic/ui/page/PetTagPage.java | 2 +- .../src/mineplex/core/creature/Creature.java | 2 +- .../core/creature/command/HelpCommand.java | 2 +- .../core/creature/command/KillCommand.java | 4 +- .../core/creature/command/MobCommand.java | 6 +- .../core/disguise/DisguiseManager.java | 54 +- .../disguise/disguises/DisguisePlayer.java | 38 +- .../mineplex/core/friend/FriendManager.java | 16 +- .../core/friend/command/DeleteFriend.java | 2 +- .../mineplex/core/gadget/GadgetManager.java | 2 +- .../core/inventory/InventoryManager.java | 2 +- .../src/mineplex/core/map/Map.java | 2 +- .../core/message/Commands/AdminCommand.java | 4 +- .../message/Commands/MessageAdminCommand.java | 4 +- .../core/message/Commands/MessageCommand.java | 2 +- .../message/Commands/ResendAdminCommand.java | 6 +- .../core/message/Commands/ResendCommand.java | 4 +- .../mineplex/core/message/MessageManager.java | 10 +- .../src/mineplex/core/monitor/LagMeter.java | 10 +- .../src/mineplex/core/npc/NpcManager.java | 6 +- .../core/npc/command/ClearCommand.java | 2 +- .../core/npc/command/DeleteCommand.java | 2 +- .../core/npc/command/HomeCommand.java | 2 +- .../core/npc/command/RefreshCommand.java | 2 +- .../core/portal/Commands/SendCommand.java | 10 +- .../core/portal/Commands/ServerCommand.java | 10 +- .../src/mineplex/core/portal/Portal.java | 6 +- .../core/preferences/PreferencesManager.java | 2 +- .../src/mineplex/core/punish/Punish.java | 24 +- .../mineplex/core/punish/UI/PunishPage.java | 2 +- .../mineplex/core/report/ReportPlugin.java | 6 +- .../report/command/ReportCloseCommand.java | 2 +- .../core/report/command/ReportCommand.java | 4 +- .../report/command/ReportHandleCommand.java | 2 +- .../src/mineplex/core/spawn/Spawn.java | 6 +- .../src/mineplex/core/stats/StatsManager.java | 4 +- .../src/mineplex/core/teleport/Teleport.java | 2 +- .../teleport/command/TeleportCommand.java | 2 +- .../mineplex/core/updater/FileUpdater.java | 4 +- .../mineplex/game/clans/clans/ClanInfo.java | 469 +++++++++++++++ .../game/clans/clans/ClansManager.java | 53 ++ .../game/clans/clans/ClansUtility.java | 551 ++++++++++++++++++ .../clans/repository/ClanRepository.java | 23 + .../clans/clans/repository/ClanTerritory.java | 7 + .../repository/tokens/ClanAllianceToken.java | 7 + .../repository/tokens/ClanMemberToken.java | 7 + .../repository/tokens/ClanTerritoryToken.java | 10 + .../clans/repository/tokens/ClanToken.java | 17 + .../game/clans/fields}/Field.java | 4 +- .../game/clans/fields}/FieldBlock.java | 8 +- .../game/clans/fields}/FieldBlockData.java | 2 +- .../clans/fields}/FieldBlockLootData.java | 2 +- .../game/clans/fields}/FieldMonster.java | 18 +- .../game/clans/fields}/FieldMonsterInput.java | 2 +- .../game/clans/fields}/FieldOre.java | 6 +- .../game/clans/fields}/FieldOreData.java | 2 +- .../game/clans/fields}/UtilField.java | 2 +- .../fields}/commands/FieldBlockCommand.java | 16 +- .../fields}/commands/FieldMonsterCommand.java | 30 +- .../fields}/commands/FieldOreCommand.java | 6 +- .../fields/monsters}/FieldMonsterBase.java | 8 +- .../fields}/repository/FieldBlockToken.java | 2 +- .../fields}/repository/FieldMonsterToken.java | 2 +- .../fields}/repository/FieldOreToken.java | 2 +- .../fields}/repository/FieldRepository.java | 2 +- .../src/mineplex/hub/HubManager.java | 8 +- .../mineplex/hub/commands/NewsAddCommand.java | 8 +- .../hub/commands/NewsConfirmCommand.java | 6 +- .../hub/commands/NewsDeleteCommand.java | 8 +- .../hub/commands/NewsListCommand.java | 6 +- .../mineplex/hub/commands/NewsSetCommand.java | 10 +- .../hub/modules/AdminMountManager.java | 2 +- .../src/mineplex/hub/party/PartyManager.java | 2 +- .../src/mineplex/hub/poll/PollManager.java | 2 +- .../mineplex/hub/server/ServerManager.java | 12 +- .../game/core/combat/CombatManager.java | 2 +- .../password/CreatePasswordCommand.java | 24 + .../password/PasswordRepository.java | 76 +++ .../password/RemovePasswordCommand.java | 21 + .../salespackage/command/KitsCommand.java | 28 + .../salespackage/salespackages/ApplyKits.java | 20 + .../nautilus/game/arcade/ArcadeManager.java | 6 +- .../pvp/modules/Benefit/BenefitManager.java | 6 +- .../Benefit/Items/EnergizedPickaxe.java | 10 +- .../modules/Benefit/UI/BenefitShopPage.java | 2 +- .../nautilus/game/pvp/modules/Gameplay.java | 4 +- .../game/pvp/modules/ShopManager.java | 6 +- .../game/pvp/modules/clans/Clans.java | 10 +- .../game/pvp/modules/clans/ClansGame.java | 2 +- .../game/pvp/modules/clans/ClansTask.java | 34 +- .../pvp/modules/serverreset/ServerReset.java | 2 +- .../serverreset/ServerResetCommand.java | 4 +- .../game/pvp/worldevent/EventManager.java | 2 +- 106 files changed, 1652 insertions(+), 275 deletions(-) create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanTerritory.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanAllianceToken.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanMemberToken.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanTerritoryToken.java create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanToken.java rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/Field.java (90%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldBlock.java (97%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldBlockData.java (99%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldBlockLootData.java (96%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldMonster.java (89%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldMonsterInput.java (95%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldOre.java (97%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/FieldOreData.java (99%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/UtilField.java (88%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/commands/FieldBlockCommand.java (85%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/commands/FieldMonsterCommand.java (76%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/commands/FieldOreCommand.java (87%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field/Monsters => mineplex/game/clans/fields/monsters}/FieldMonsterBase.java (95%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/repository/FieldBlockToken.java (83%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/repository/FieldMonsterToken.java (81%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/repository/FieldOreToken.java (62%) rename Plugins/Mineplex.Game.Clans/src/{me/chiss/Core/Field => mineplex/game/clans/fields}/repository/FieldRepository.java (99%) create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/CreatePasswordCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordRepository.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/RemovePasswordCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/KitsCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/ApplyKits.java diff --git a/Plugins/Core/src/me/chiss/Core/Scheduler/Scheduler.java b/Plugins/Core/src/me/chiss/Core/Scheduler/Scheduler.java index e155aeedc..518b8920c 100644 --- a/Plugins/Core/src/me/chiss/Core/Scheduler/Scheduler.java +++ b/Plugins/Core/src/me/chiss/Core/Scheduler/Scheduler.java @@ -38,7 +38,7 @@ public class Scheduler extends MiniPlugin @Override public void AddCommands() { - AddCommand(new ForceDailyCommand(this)); + addCommand(new ForceDailyCommand(this)); } @EventHandler diff --git a/Plugins/Core/src/me/chiss/Core/Server/Server.java b/Plugins/Core/src/me/chiss/Core/Server/Server.java index 072971ded..767cdeb67 100644 --- a/Plugins/Core/src/me/chiss/Core/Server/Server.java +++ b/Plugins/Core/src/me/chiss/Core/Server/Server.java @@ -40,10 +40,10 @@ public class Server extends MiniPlugin @Override public void AddCommands() { - AddCommand(new BroadcastCommand(this)); - AddCommand(new ListCommand(this)); - AddCommand(new SpawnSetCommand(this)); - AddCommand(new WaterSpreadCommand(this)); + addCommand(new BroadcastCommand(this)); + addCommand(new ListCommand(this)); + addCommand(new SpawnSetCommand(this)); + addCommand(new WaterSpreadCommand(this)); } @EventHandler @@ -95,7 +95,7 @@ public class Server extends MiniPlugin for (Player cur : UtilServer.getPlayers()) cur.saveData(); - Log("Saved Clients to Disk. Took " + (System.currentTimeMillis()-epoch) + " milliseconds."); + log("Saved Clients to Disk. Took " + (System.currentTimeMillis()-epoch) + " milliseconds."); } public void saveWorlds() @@ -110,20 +110,20 @@ public class Server extends MiniPlugin F.time(UtilTime.convertString((System.currentTimeMillis()-epoch), 1, TimeUnit.FIT)) + "]."); - Log("Saved Worlds to Disk. Took " + (System.currentTimeMillis()-epoch) + " milliseconds."); + log("Saved Worlds to Disk. Took " + (System.currentTimeMillis()-epoch) + " milliseconds."); } public void reload() { UtilServer.broadcast(F.main(_moduleName, "Reloading Plugins...")); - Log("Reloading Plugins..."); + log("Reloading Plugins..."); UtilServer.getServer().dispatchCommand(UtilServer.getServer().getConsoleSender(), "reload"); } public void restart() { UtilServer.broadcast(F.main(_moduleName, "Restarting Server...")); - Log("Restarting Server..."); + log("Restarting Server..."); for (Player cur : UtilServer.getPlayers()) UtilPlayer.kick(cur, _moduleName, "Server Restarting"); diff --git a/Plugins/Core/src/me/chiss/Core/Server/command/ListCommand.java b/Plugins/Core/src/me/chiss/Core/Server/command/ListCommand.java index 4fd47a447..090eb41c7 100644 --- a/Plugins/Core/src/me/chiss/Core/Server/command/ListCommand.java +++ b/Plugins/Core/src/me/chiss/Core/Server/command/ListCommand.java @@ -20,7 +20,7 @@ public class ListCommand extends CommandBase @Override public void Execute(Player caller, String[] args) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Online Players:")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Listing Online Players:")); String staff = ""; String other = ""; diff --git a/Plugins/Core/src/me/chiss/Core/Vote/VoteManager.java b/Plugins/Core/src/me/chiss/Core/Vote/VoteManager.java index b485e7492..21d17bc8b 100644 --- a/Plugins/Core/src/me/chiss/Core/Vote/VoteManager.java +++ b/Plugins/Core/src/me/chiss/Core/Vote/VoteManager.java @@ -46,7 +46,7 @@ public class VoteManager extends MiniPlugin if (player == client.GetPlayer()) continue; - player.sendMessage(F.main(GetName(), ChatColor.YELLOW + event.GetPlayerName() + ChatColor.GRAY + " voted at bettermc.com/Vote for " + ChatColor.YELLOW + event.GetPointsReceived() + C.cGray + " points! ")); + player.sendMessage(F.main(getName(), ChatColor.YELLOW + event.GetPlayerName() + ChatColor.GRAY + " voted at bettermc.com/Vote for " + ChatColor.YELLOW + event.GetPointsReceived() + C.cGray + " points! ")); } client.GetPlayer().updateInventory(); diff --git a/Plugins/Core/src/me/chiss/Core/Weapon/Commands/WeaponCommand.java b/Plugins/Core/src/me/chiss/Core/Weapon/Commands/WeaponCommand.java index c8f306228..09fa023f8 100644 --- a/Plugins/Core/src/me/chiss/Core/Weapon/Commands/WeaponCommand.java +++ b/Plugins/Core/src/me/chiss/Core/Weapon/Commands/WeaponCommand.java @@ -22,7 +22,7 @@ public class WeaponCommand extends CommandBase { if (args == null || args.length == 0) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Weapons:")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Listing Weapons:")); for (IWeapon cur : Plugin.GetWeapons()) { diff --git a/Plugins/Core/src/me/chiss/Core/Weapon/WeaponFactory.java b/Plugins/Core/src/me/chiss/Core/Weapon/WeaponFactory.java index 648bd0f5b..6eef58862 100644 --- a/Plugins/Core/src/me/chiss/Core/Weapon/WeaponFactory.java +++ b/Plugins/Core/src/me/chiss/Core/Weapon/WeaponFactory.java @@ -40,7 +40,7 @@ public class WeaponFactory extends MiniPlugin implements IWeaponFactory @Override public void AddCommands() { - AddCommand(new WeaponCommand(this)); + addCommand(new WeaponCommand(this)); } private void PopulateWeapons() diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index 8c1f0fffe..5f8456aa7 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -2,6 +2,7 @@ package mineplex.bungee.motd; import java.util.concurrent.TimeUnit; +import net.md_5.bungee.api.event.PreLoginEvent; import net.md_5.bungee.api.event.ProxyPingEvent; import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Plugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java index f595fcbd0..6add4954e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java @@ -55,17 +55,17 @@ public abstract class MiniPlugin implements Listener public final void onEnable() { long epoch = System.currentTimeMillis(); - Log("Initializing..."); + log("Initializing..."); Enable(); AddCommands(); - Log("Enabled in " + UtilTime.convertString(System.currentTimeMillis() - epoch, 1, TimeUnit.FIT) + "."); + log("Enabled in " + UtilTime.convertString(System.currentTimeMillis() - epoch, 1, TimeUnit.FIT) + "."); } public final void onDisable() { Disable(); - Log("Disabled."); + log("Disabled."); } public void Enable() { } @@ -74,23 +74,28 @@ public abstract class MiniPlugin implements Listener public void AddCommands() { } - public final String GetName() + public final String getName() { return _moduleName; } - public final void AddCommand(ICommand command) + public final void addCommand(ICommand command) { CommandCenter.Instance.AddCommand(command); } - public final void RemoveCommand(ICommand command) + public final void removeCommand(ICommand command) { CommandCenter.Instance.RemoveCommand(command); } - protected void Log(String message) + protected void log(String message) { System.out.println(F.main(_moduleName, message)); } + + protected void runAsync(Runnable runnable) + { + _plugin.getServer().getScheduler().runTaskAsynchronously(_plugin, runnable); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java index 94034eee6..24a068105 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java @@ -68,7 +68,7 @@ public class CoreClientManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new UpdateRank(this)); + addCommand(new UpdateRank(this)); } public CoreClient Add(String name) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java index 5bee6a2b5..c46ed1cc1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java @@ -25,13 +25,13 @@ public class UpdateRank extends CommandBase { if (args == null) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "/" + AliasUsed + " joeschmo MODERATOR")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR")); } else { if (args.length == 0) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Player argument missing.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Player argument missing.")); return; } @@ -44,7 +44,7 @@ public class UpdateRank extends CommandBase } catch (Exception ex) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), ChatColor.RED + "" + ChatColor.BOLD + "Invalid rank!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Invalid rank!")); return; } @@ -90,7 +90,7 @@ public class UpdateRank extends CommandBase { public void run(Rank rank) { - caller.sendMessage(F.main(Plugin.GetName(), target + "'s rank has been updated to " + rank.Name + "!")); + caller.sendMessage(F.main(Plugin.getName(), target + "'s rank has been updated to " + rank.Name + "!")); } }, target, rank, true); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java index 26436e1c6..36dbb45ba 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java @@ -114,7 +114,7 @@ public class AchievementManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new StatsCommand(this)); + addCommand(new StatsCommand(this)); } public void openShop(Player player) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java index f291caf0e..4d335c95a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java @@ -82,8 +82,8 @@ public class Chat extends MiniPlugin @Override public void AddCommands() { - AddCommand(new SilenceCommand(this)); - AddCommand(new BroadcastCommand(this)); + addCommand(new SilenceCommand(this)); + addCommand(new BroadcastCommand(this)); } public void Silence(long duration, boolean inform) @@ -113,7 +113,7 @@ public class Chat extends MiniPlugin if (event.getMessage().toLowerCase().startsWith("/me") || event.getMessage().toLowerCase().startsWith("/bukkit")) { - event.getPlayer().sendMessage(F.main(GetName(), "No, you!")); + event.getPlayer().sendMessage(F.main(getName(), "No, you!")); event.setCancelled(true); } } @@ -123,7 +123,7 @@ public class Chat extends MiniPlugin { if (event.getMessage().equals("lag") || event.getMessage().equals("ping")) { - event.getPlayer().sendMessage(F.main(GetName(), "PONG!")); + event.getPlayer().sendMessage(F.main(getName(), "PONG!")); event.setCancelled(true); } } @@ -157,11 +157,11 @@ public class Chat extends MiniPlugin return false; if (_silenced == -1) - UtilPlayer.message(player, F.main(GetName(), "Chat is silenced permanently.")); + UtilPlayer.message(player, F.main(getName(), "Chat is silenced permanently.")); else UtilPlayer.message( player, - F.main(GetName(), + F.main(getName(), "Chat is silenced for " + F.time(UtilTime.MakeStr(_silenced - System.currentTimeMillis(), 1)) + ".")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 17e3907ef..f0d0976bc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -65,8 +65,8 @@ public class GadgetPage extends ShopPageBase { if (gadget instanceof MorphNotch) { - setItem(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Disabled " + gadget.GetName(), new String[] { "Sorry! Currently disabled until fix is made for 1.8 players!" }, 1, false, false)); - return; + //setItem(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Disabled " + gadget.GetName(), new String[] { "Sorry! Currently disabled until fix is made for 1.8 players!" }, 1, false, false)); + //return; } List itemLore = new ArrayList(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java index c46db6c7b..068fed02b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java @@ -67,7 +67,7 @@ public class PetTagPage extends ShopPageBase if (_tagName.length() > 16) { - UtilPlayer.message(Player, F.main(Plugin.GetName(), ChatColor.RED + "Pet name cannot be longer than 16 characters.")); + UtilPlayer.message(Player, F.main(Plugin.getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters.")); PlayDenySound(Player); Shop.OpenPageForPlayer(Player, new PetPage(Plugin, Shop, ClientManager, DonationManager, "Pets", Player)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java index 0459f9247..7cd2b0cfc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java @@ -43,7 +43,7 @@ public class Creature extends MiniPlugin @Override public void AddCommands() { - AddCommand(new MobCommand(this)); + addCommand(new MobCommand(this)); } public Entity SpawnEntity(Location location, EntityType entityType) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/HelpCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/HelpCommand.java index 6a7e25e34..ca06bbad5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/HelpCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/HelpCommand.java @@ -17,7 +17,7 @@ public class HelpCommand extends CommandBase @Override public void Execute(Player caller, String[] args) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Commands List;")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Commands List;")); UtilPlayer.message(caller, F.help("/mob", "List Entities", Rank.MODERATOR)); UtilPlayer.message(caller, F.help("/mob kill ", "Remove Entities of Type", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/mob (# baby lock angry s# )", "Create", Rank.ADMIN)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/KillCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/KillCommand.java index a040503f8..a4efed103 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/KillCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/KillCommand.java @@ -29,7 +29,7 @@ public class KillCommand extends CommandBase { if (args == null || args.length == 0) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Missing Entity Type Parameter.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Missing Entity Type Parameter.")); return; } @@ -68,6 +68,6 @@ public class KillCommand extends CommandBase if (type != null) target = UtilEnt.getName(type); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Killed " + target + ". " + count + " Removed.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Killed " + target + ". " + count + " Removed.")); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java index bd4c44946..d43ccccbf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java @@ -54,7 +54,7 @@ public class MobCommand extends MultiCommandBase } } - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Entities:")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Listing Entities:")); for (EntityType cur : entMap.keySet()) { UtilPlayer.message(caller, F.desc(UtilEnt.getName(cur), entMap.get(cur)+"")); @@ -69,7 +69,7 @@ public class MobCommand extends MultiCommandBase if (type == null) return; - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Spawning Creature(s);")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Spawning Creature(s);")); //Store Args HashSet argSet = new HashSet(); @@ -245,7 +245,7 @@ public class MobCommand extends MultiCommandBase UtilPlayer.message(caller, F.desc("Unhandled", arg)); //Inform - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Spawned " + count + " " + UtilEnt.getName(type) + ".")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Spawned " + count + " " + UtilEnt.getName(type) + ".")); } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 5711e3026..54560761b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -6,20 +6,12 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import net.minecraft.server.v1_7_R4.AttributeSnapshot; -import net.minecraft.server.v1_7_R4.PacketPlayOutAbilities; import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation; import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent; import net.minecraft.server.v1_7_R4.EntityPlayer; import net.minecraft.server.v1_7_R4.Packet; -import net.minecraft.server.v1_7_R4.PacketPlayOutBlockChange; -import net.minecraft.server.v1_7_R4.PacketPlayOutEntityHeadRotation; -import net.minecraft.server.v1_7_R4.PacketPlayOutEntityLook; -import net.minecraft.server.v1_7_R4.PacketPlayOutKeepAlive; -import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; -import net.minecraft.server.v1_7_R4.PacketPlayOutScoreboardObjective; -import net.minecraft.server.v1_7_R4.PacketPlayOutScoreboardScore; +import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; @@ -28,13 +20,9 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; -import net.minecraft.server.v1_7_R4.PacketPlayOutTileEntityData; import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; -import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateSign; -import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateTime; -import net.minecraft.server.v1_7_R4.PacketPlayOutWorldEvent; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; @@ -53,6 +41,7 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseBlock; import mineplex.core.disguise.disguises.DisguiseInsentient; +import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketHandler; import mineplex.core.packethandler.PacketVerifier; @@ -71,6 +60,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler private NautHashMap _addTempList = new NautHashMap(); private HashSet _delTempList = new HashSet(); private NautHashMap> _disguisePlayerMap = new NautHashMap>(); + private HashSet _blockedNames = new HashSet(); private boolean _handlingPacket = false; @@ -160,6 +150,14 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler _spawnPacketMap.put(disguise.GetEntityId(), disguise); _disguisePlayerMap.put(disguise, new HashSet()); + + if (disguise.GetEntity() instanceof Player && disguise instanceof DisguisePlayer) + { + if (!((Player)disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer)disguise).getName())) + { + _blockedNames.add(((Player)disguise.GetEntity()).getName()); + } + } reApplyDisguise(disguise); } @@ -182,9 +180,10 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); entityPlayer.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(entity.getEntityId())); - + if (entity instanceof Player) { + _blockedNames.remove(((Player)entity).getName()); player.hidePlayer((Player)entity); player.showPlayer((Player)entity); } @@ -245,6 +244,17 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler continue; EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); + + if (disguise instanceof DisguisePlayer) + { + entityPlayer.playerConnection.sendPacket(((DisguisePlayer)disguise).getNewInfoPacket(true)); + + if (disguise.GetEntity() instanceof EntityPlayer) + { + entityPlayer.playerConnection.sendPacket(((DisguisePlayer)disguise).getOldInfoPacket(false)); + } + } + entityPlayer.playerConnection.sendPacket(disguise.GetSpawnPacket()); for (Packet packet : armorPackets) @@ -384,7 +394,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler } public void handle(PacketInfo packetInfo) - { + { if (_handlingPacket) return; @@ -439,12 +449,24 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler Player owner = packetInfo.getPlayer(); final PacketVerifier packetVerifier = packetInfo.getVerifier(); - if (packet instanceof PacketPlayOutNamedEntitySpawn) + if (packet instanceof PacketPlayOutPlayerInfo) + { + if (_blockedNames.contains(((PacketPlayOutPlayerInfo)packet).username)) + { + packetInfo.setCancelled(true); + } + } + else if (packet instanceof PacketPlayOutNamedEntitySpawn) { int entityId = ((PacketPlayOutNamedEntitySpawn)packet).a; if (_spawnPacketMap.containsKey(entityId) && (_spawnPacketMap.get(entityId).Global || _disguisePlayerMap.get(_spawnPacketMap.get(entityId)).contains(owner))) { + if (_spawnPacketMap.get(entityId) instanceof DisguisePlayer) + { + handlePacket(((DisguisePlayer)_spawnPacketMap.get(entityId)).getNewInfoPacket(true), packetVerifier); + } + handlePacket(_spawnPacketMap.get(entityId).GetSpawnPacket(), packetVerifier); packetInfo.setCancelled(true); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java index 738df6891..b374e61f8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java @@ -1,10 +1,12 @@ package mineplex.core.disguise.disguises; -import org.spigotmc.ProtocolData; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.entity.Player; import net.minecraft.server.v1_7_R4.MathHelper; import net.minecraft.server.v1_7_R4.Packet; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo; import net.minecraft.util.com.mojang.authlib.GameProfile; public class DisguisePlayer extends DisguiseHuman @@ -34,6 +36,35 @@ public class DisguisePlayer extends DisguiseHuman _sneaking = sneaking; } + public Packet getOldInfoPacket(boolean add) + { + PacketPlayOutPlayerInfo playerInfo = new PacketPlayOutPlayerInfo(); + + if (Entity instanceof Player) + { + playerInfo.username = Entity.getName(); + playerInfo.action = add ? 0 : 4; + playerInfo.ping = 90; + playerInfo.player = ((CraftPlayer)(Player)Entity).getProfile(); + playerInfo.gamemode = 0; + } + + return playerInfo; + } + + public Packet getNewInfoPacket(boolean add) + { + PacketPlayOutPlayerInfo newDisguiseInfo = new PacketPlayOutPlayerInfo(); + newDisguiseInfo.username = _profile.getName(); + newDisguiseInfo.action = add ? 0 : 4; + newDisguiseInfo.ping = 90; + newDisguiseInfo.player = _profile; + newDisguiseInfo.gamemode = 0; + + + return newDisguiseInfo; + } + @Override public void UpdateDataWatcher() { @@ -62,4 +93,9 @@ public class DisguisePlayer extends DisguiseHuman return packet; } + + public String getName() + { + return _profile.getName(); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java index 87e56c607..92daeeea0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -51,8 +51,8 @@ public class FriendManager extends MiniClientPlugin @Override public void AddCommands() { - AddCommand(new AddFriend(this)); - AddCommand(new DeleteFriend(this)); + addCommand(new AddFriend(this)); + addCommand(new DeleteFriend(this)); } @Override @@ -124,17 +124,17 @@ public class FriendManager extends MiniClientPlugin } else if (status.Status == FriendStatusType.Denied) { - caller.sendMessage(F.main(GetName(), ChatColor.GREEN + name + ChatColor.GRAY + " has denied your friend request.")); + caller.sendMessage(F.main(getName(), ChatColor.GREEN + name + ChatColor.GRAY + " has denied your friend request.")); return; } else if (status.Status == FriendStatusType.Accepted) { - caller.sendMessage(F.main(GetName(), "You are already friends with " + ChatColor.GREEN + name)); + caller.sendMessage(F.main(getName(), "You are already friends with " + ChatColor.GREEN + name)); return; } else if (status.Status == FriendStatusType.Sent) { - caller.sendMessage(F.main(GetName(), ChatColor.GREEN + name + ChatColor.GRAY + " has yet to respond to your friend request.")); + caller.sendMessage(F.main(getName(), ChatColor.GREEN + name + ChatColor.GRAY + " has yet to respond to your friend request.")); return; } } @@ -195,9 +195,9 @@ public class FriendManager extends MiniClientPlugin public void run() { if (updateFinal) - caller.sendMessage(F.main(GetName(), "You and " + ChatColor.GREEN + name + ChatColor.GRAY + " are now friends!")); + caller.sendMessage(F.main(getName(), "You and " + ChatColor.GREEN + name + ChatColor.GRAY + " are now friends!")); else - caller.sendMessage(F.main(GetName(), "Added " + ChatColor.GREEN + name + ChatColor.GRAY + " to your friends list!")); + caller.sendMessage(F.main(getName(), "Added " + ChatColor.GREEN + name + ChatColor.GRAY + " to your friends list!")); } }); } @@ -253,7 +253,7 @@ public class FriendManager extends MiniClientPlugin } } - caller.sendMessage(F.main(GetName(), "Deleted " + ChatColor.GREEN + name + ChatColor.GRAY + " from your friends list!")); + caller.sendMessage(F.main(getName(), "Deleted " + ChatColor.GREEN + name + ChatColor.GRAY + " from your friends list!")); } }); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/command/DeleteFriend.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/command/DeleteFriend.java index 36fe4583e..cf1a38734 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/command/DeleteFriend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/command/DeleteFriend.java @@ -19,7 +19,7 @@ public class DeleteFriend extends CommandBase public void Execute(final Player caller, final String[] args) { if (args == null) - F.main(Plugin.GetName(), "You need to include a player's name."); + F.main(Plugin.getName(), "You need to include a player's name."); else { CommandCenter.GetClientManager().checkPlayerName(caller, args[0], new Callback() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index e1b286109..1f8781f39 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -112,7 +112,7 @@ public class GadgetManager extends MiniPlugin addGadget(new MorphBlock(this)); addGadget(new MorphEnderman(this)); addGadget(new MorphBat(this)); - //addGadget(new MorphNotch(this)); + addGadget(new MorphNotch(this)); addGadget(new MorphPumpkinKing(this)); addGadget(new MorphPig(this)); addGadget(new MorphCreeper(this)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java index 34fc34c8c..62a1c7fe3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java @@ -152,6 +152,6 @@ public class InventoryManager extends MiniClientPlugin @Override public void AddCommands() { - AddCommand(new GiveItemCommand(this)); + addCommand(new GiveItemCommand(this)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/map/Map.java b/Plugins/Mineplex.Core/src/mineplex/core/map/Map.java index 2854e3ede..c23e8a627 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/map/Map.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/map/Map.java @@ -36,7 +36,7 @@ public class Map extends MiniPlugin @Override public void AddCommands() { - AddCommand(new MapImage(this)); + addCommand(new MapImage(this)); } public ItemStack GetMap() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/AdminCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/AdminCommand.java index dc3917cdf..d141e4a6c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/AdminCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/AdminCommand.java @@ -29,7 +29,7 @@ public class AdminCommand extends CommandBase { if (args.length == 0) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Message argument missing.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Message argument missing.")); return; } @@ -56,7 +56,7 @@ public class AdminCommand extends CommandBase } if (!staff) - UtilPlayer.message(caller, F.main(Plugin.GetName(), "There are no Staff Members online.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "There are no Staff Members online.")); //Log XXX //Logger().logChat("Staff Chat", from, staff, message); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageAdminCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageAdminCommand.java index 6e2990a0c..1a871aa3f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageAdminCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageAdminCommand.java @@ -29,7 +29,7 @@ public class MessageAdminCommand extends CommandBase if (args.length == 0) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Player argument missing.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Player argument missing.")); return; } @@ -41,7 +41,7 @@ public class MessageAdminCommand extends CommandBase //Parse Message if (args.length < 2) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Message argument missing.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Message argument missing.")); return; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageCommand.java index e268096d7..ff9d8543d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/MessageCommand.java @@ -26,7 +26,7 @@ public class MessageCommand extends CommandBase { if (args.length == 0) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Player argument missing.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Player argument missing.")); return; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendAdminCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendAdminCommand.java index 3b7ce415b..07e7a3d75 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendAdminCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendAdminCommand.java @@ -30,21 +30,21 @@ public class ResendAdminCommand extends CommandBase //Get To if (Plugin.Get(caller).LastAdminTo == null) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "You have not admin messaged anyone recently.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "You have not admin messaged anyone recently.")); return; } Player to = UtilPlayer.searchOnline(caller, Plugin.Get(caller).LastAdminTo, false); if (to == null) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), F.name(Plugin.Get(caller).LastAdminTo) + " is no longer online.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), F.name(Plugin.Get(caller).LastAdminTo) + " is no longer online.")); return; } //Parse Message if (args.length < 1) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Message argument missing.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Message argument missing.")); return; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendCommand.java index eb1aedcac..b1a5d1047 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/Commands/ResendCommand.java @@ -27,14 +27,14 @@ public class ResendCommand extends CommandBase //Get To if (Plugin.Get(caller).LastTo == null) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "You have not messaged anyone recently.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "You have not messaged anyone recently.")); return; } Player to = UtilPlayer.searchOnline(caller, Plugin.Get(caller).LastTo, false); if (to == null) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), F.name(Plugin.Get(caller).LastTo) + " is no longer online.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), F.name(Plugin.Get(caller).LastTo) + " is no longer online.")); return; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java index 269962a36..f88ad5d5d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java @@ -78,14 +78,14 @@ public class MessageManager extends MiniClientPlugin public void AddCommands() { - AddCommand(new MessageCommand(this)); - AddCommand(new ResendCommand(this)); + addCommand(new MessageCommand(this)); + addCommand(new ResendCommand(this)); - AddCommand(new MessageAdminCommand(this)); - AddCommand(new ResendAdminCommand(this)); + addCommand(new MessageAdminCommand(this)); + addCommand(new ResendAdminCommand(this)); - AddCommand(new AdminCommand(this)); + addCommand(new AdminCommand(this)); } public void Help(Player caller, String message) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java index 8a745c64a..39361a43f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java @@ -106,10 +106,10 @@ public class LagMeter extends MiniPlugin player.sendMessage(" "); player.sendMessage(" "); player.sendMessage(" "); - player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Live-------" + ChatColor.YELLOW + String.format("%.00f", _ticksPerSecond))); - player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Avg--------" + ChatColor.YELLOW + String.format("%.00f", _ticksPerSecondAverage * 20))); - player.sendMessage(F.main(GetName(), ChatColor.YELLOW + "MEM")); - player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Free-------" + ChatColor.YELLOW + (Runtime.getRuntime().freeMemory() / 1048576) + "MB")); - player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Max--------" + ChatColor.YELLOW + (Runtime.getRuntime().maxMemory() / 1048576)) + "MB"); + player.sendMessage(F.main(getName(), ChatColor.GRAY + "Live-------" + ChatColor.YELLOW + String.format("%.00f", _ticksPerSecond))); + player.sendMessage(F.main(getName(), ChatColor.GRAY + "Avg--------" + ChatColor.YELLOW + String.format("%.00f", _ticksPerSecondAverage * 20))); + player.sendMessage(F.main(getName(), ChatColor.YELLOW + "MEM")); + player.sendMessage(F.main(getName(), ChatColor.GRAY + "Free-------" + ChatColor.YELLOW + (Runtime.getRuntime().freeMemory() / 1048576) + "MB")); + player.sendMessage(F.main(getName(), ChatColor.GRAY + "Max--------" + ChatColor.YELLOW + (Runtime.getRuntime().maxMemory() / 1048576)) + "MB"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java index cdd86d982..cab2e8195 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java @@ -132,7 +132,7 @@ public class NpcManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new NpcCommand(this)); + addCommand(new NpcCommand(this)); } public void help(Player caller, String message) @@ -236,9 +236,9 @@ public class NpcManager extends MiniPlugin try { if (deleteNpc(event.getRightClicked())) - event.getPlayer().sendMessage(F.main(GetName(), "Deleted npc.")); + event.getPlayer().sendMessage(F.main(getName(), "Deleted npc.")); else - event.getPlayer().sendMessage(F.main(GetName(), "Failed to delete npc. That one isn't in the list.")); + event.getPlayer().sendMessage(F.main(getName(), "Failed to delete npc. That one isn't in the list.")); } catch (SQLException e) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/ClearCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/ClearCommand.java index 57cb5d99d..ff1a59bbf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/ClearCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/ClearCommand.java @@ -28,7 +28,7 @@ public class ClearCommand extends CommandBase { Plugin.clearNpcs(true); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Cleared NPCs.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Cleared NPCs.")); } catch (SQLException e) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/DeleteCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/DeleteCommand.java index 8e5012d6a..4b7ab183b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/DeleteCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/DeleteCommand.java @@ -24,7 +24,7 @@ public class DeleteCommand extends CommandBase { Plugin.prepDeleteNpc(caller); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Now right click npc.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Now right click npc.")); } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java index c5da7ee50..957816f12 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java @@ -24,7 +24,7 @@ public class HomeCommand extends CommandBase { Plugin.teleportNpcsHome(); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Npcs teleported to home locations.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Npcs teleported to home locations.")); } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/RefreshCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/RefreshCommand.java index a789f8e3b..24eca9ed5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/RefreshCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/RefreshCommand.java @@ -29,7 +29,7 @@ public class RefreshCommand extends CommandBase Plugin.clearNpcs(false); Plugin.loadNpcs(); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Refreshed NPCs.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Refreshed NPCs.")); } catch (SQLException e) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java index 162e475e0..34750ae83 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java @@ -22,7 +22,7 @@ public class SendCommand extends CommandBase { if(args == null || args.length == 0) { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else if(args.length == 2) @@ -36,7 +36,7 @@ public class SendCommand extends CommandBase { if (!playerExists) { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cGray + "Player " + C.cGold + playerTarget + C.cGray + " does not exist!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cGray + "Player " + C.cGold + playerTarget + C.cGray + " does not exist!")); return; } @@ -46,13 +46,13 @@ public class SendCommand extends CommandBase { if (!serverExists) { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cGray + "Server " + C.cGold + serverTarget + C.cGray + " does not exist!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cGray + "Server " + C.cGold + serverTarget + C.cGray + " does not exist!")); return; } Portal.transferPlayer(playerTarget, serverTarget); - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cGray + "You have sent player: " + C.cGold + playerTarget + C.cGray + " to server: " + C.cGold + serverTarget + C.cGray + "!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cGray + "You have sent player: " + C.cGold + playerTarget + C.cGray + " to server: " + C.cGold + serverTarget + C.cGray + "!")); return; } }); @@ -61,7 +61,7 @@ public class SendCommand extends CommandBase } else { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java index 8f71b331d..32ac08afc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java @@ -26,7 +26,7 @@ public class ServerCommand extends CommandBase if (args == null || args.length == 0) { UtilPlayer.message(player, - F.main(Plugin.GetName(), C.cGray + "You are currently on server: " + C.cGold + serverName)); + F.main(Plugin.getName(), C.cGray + "You are currently on server: " + C.cGold + serverName)); return; } else if (args.length == 1) @@ -35,7 +35,7 @@ public class ServerCommand extends CommandBase { UtilPlayer.message( player, - F.main(Plugin.GetName(), "You are already on " + C.cGold + serverName + C.cGray + F.main(Plugin.getName(), "You are already on " + C.cGold + serverName + C.cGray + "!")); } else @@ -48,7 +48,7 @@ public class ServerCommand extends CommandBase { UtilPlayer.message( player, - F.main(Plugin.GetName(), "Server " + C.cGold + args[0] + F.main(Plugin.getName(), "Server " + C.cGold + args[0] + C.cGray + " does not exist!")); return; } @@ -93,7 +93,7 @@ public class ServerCommand extends CommandBase { UtilPlayer.message( player, - F.main(Plugin.GetName(), C.cRed + "You don't have permission to join " + C.cGold + args[0])); + F.main(Plugin.getName(), C.cRed + "You don't have permission to join " + C.cGold + args[0])); } } }); @@ -102,7 +102,7 @@ public class ServerCommand extends CommandBase else { UtilPlayer.message(player, - F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java index 0d526ab75..55e91c8f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java @@ -64,7 +64,7 @@ public class Portal extends MiniPlugin UtilPlayer .message( player, - F.main(GetName(), C.cGray + "You have been sent to server: " + C.cGold + serverName + F.main(getName(), C.cGray + "You have been sent to server: " + C.cGold + serverName + C.cGray + "!")); } @@ -140,7 +140,7 @@ public class Portal extends MiniPlugin public void AddCommands() { - AddCommand(new ServerCommand(this)); - AddCommand(new SendCommand(this)); + addCommand(new ServerCommand(this)); + addCommand(new SendCommand(this)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java index defec6261..c9e783eb4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java @@ -41,7 +41,7 @@ public class PreferencesManager extends MiniClientPlugin _repository = new PreferencesRepository(plugin, plugin.getConfig().getString("preferences.connectionurl")); _shop = new PreferencesShop(this, clientManager, donationManager); - AddCommand(new PreferencesCommand(this)); + addCommand(new PreferencesCommand(this)); } private void setupConfigValues() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java b/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java index 4c53b769f..478685f5d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java @@ -54,7 +54,7 @@ public class Punish extends MiniPlugin @Override public void AddCommands() { - AddCommand(new PunishCommand(this)); + addCommand(new PunishCommand(this)); } @EventHandler @@ -102,7 +102,7 @@ public class Punish extends MiniPlugin if (client != null && client.IsMuted()) { - event.getPlayer().sendMessage(F.main(GetName(), "Shh, you're muted because " + client.GetPunishment(PunishmentSentence.Mute).GetReason() + " by " + client.GetPunishment(PunishmentSentence.Mute).GetAdmin() + " for " + C.cGreen + UtilTime.convertString(client.GetPunishment(PunishmentSentence.Mute).GetRemaining(), 1, TimeUnit.FIT) + ".")); + event.getPlayer().sendMessage(F.main(getName(), "Shh, you're muted because " + client.GetPunishment(PunishmentSentence.Mute).GetReason() + " by " + client.GetPunishment(PunishmentSentence.Mute).GetAdmin() + " for " + C.cGreen + UtilTime.convertString(client.GetPunishment(PunishmentSentence.Mute).GetRemaining(), 1, TimeUnit.FIT) + ".")); event.setCancelled(true); } } @@ -114,7 +114,7 @@ public class Punish extends MiniPlugin if (client != null && client.IsMuted()) { - event.getPlayer().sendMessage(F.main(GetName(), "Shh, you're muted because " + client.GetPunishment(PunishmentSentence.Mute).GetReason() + " by " + client.GetPunishment(PunishmentSentence.Mute).GetAdmin() + " for " + C.cGreen + UtilTime.convertString(client.GetPunishment(PunishmentSentence.Mute).GetRemaining(), 1, TimeUnit.FIT) + ".")); + event.getPlayer().sendMessage(F.main(getName(), "Shh, you're muted because " + client.GetPunishment(PunishmentSentence.Mute).GetReason() + " by " + client.GetPunishment(PunishmentSentence.Mute).GetAdmin() + " for " + C.cGreen + UtilTime.convertString(client.GetPunishment(PunishmentSentence.Mute).GetRemaining(), 1, TimeUnit.FIT) + ".")); event.setMessage(" "); event.setCancelled(true); } @@ -146,16 +146,16 @@ public class Punish extends MiniPlugin if (banResult == PunishmentResponse.AccountDoesNotExist) { if (caller != null) - caller.sendMessage(F.main(GetName(), "Account with name " + F.elem(playerName) + " does not exist.")); + caller.sendMessage(F.main(getName(), "Account with name " + F.elem(playerName) + " does not exist.")); else - System.out.println(F.main(GetName(), "Account with name " + F.elem(playerName) + " does not exist.")); + System.out.println(F.main(getName(), "Account with name " + F.elem(playerName) + " does not exist.")); } else if (banResult == PunishmentResponse.InsufficientPrivileges) { if (caller != null) - caller.sendMessage(F.main(GetName(), "You have insufficient rights to punish " + F.elem(playerName) + ".")); + caller.sendMessage(F.main(getName(), "You have insufficient rights to punish " + F.elem(playerName) + ".")); else - System.out.println(F.main(GetName(), "You have insufficient rights to punish " + F.elem(playerName) + ".")); + System.out.println(F.main(getName(), "You have insufficient rights to punish " + F.elem(playerName) + ".")); } else if (banResult == PunishmentResponse.Punished) { @@ -164,7 +164,7 @@ public class Punish extends MiniPlugin if (sentence == PunishmentSentence.Ban) { if (caller == null) - System.out.println(F.main(GetName(), F.elem(caller == null ? "Mineplex Anti-Cheat" : caller.getName()) + " banned " + F.elem(playerName) + " because of " + F.elem(reason) + " for " + durationString + ".")); + System.out.println(F.main(getName(), F.elem(caller == null ? "Mineplex Anti-Cheat" : caller.getName()) + " banned " + F.elem(playerName) + " because of " + F.elem(reason) + " for " + durationString + ".")); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable() { @@ -181,19 +181,19 @@ public class Punish extends MiniPlugin } }); - informOfPunish(playerName, F.main(GetName(), caller == null ? "Mineplex Anti-Cheat" : caller.getName() + " banned " + playerName + " for " + durationString + ".")); + informOfPunish(playerName, F.main(getName(), caller == null ? "Mineplex Anti-Cheat" : caller.getName() + " banned " + playerName + " for " + durationString + ".")); } else { if (caller == null) - System.out.println(F.main(GetName(), F.elem(caller == null ? "Mineplex Anti-Cheat" : caller.getName()) + " muted " + F.elem(playerName) + " because of " + F.elem(reason) + " for " + + System.out.println(F.main(getName(), F.elem(caller == null ? "Mineplex Anti-Cheat" : caller.getName()) + " muted " + F.elem(playerName) + " because of " + F.elem(reason) + " for " + durationString + ".")); //Warning if (finalDuration == 0) - informOfPunish(playerName, F.main(GetName(), caller == null ? "Mineplex Anti-Cheat" : caller.getName() + " issued a friendly warning to " + playerName + ".")); + informOfPunish(playerName, F.main(getName(), caller == null ? "Mineplex Anti-Cheat" : caller.getName() + " issued a friendly warning to " + playerName + ".")); else - informOfPunish(playerName, F.main(GetName(), caller == null ? "Mineplex Anti-Cheat" : caller.getName() + " muted " + playerName + " for " + durationString + ".")); + informOfPunish(playerName, F.main(getName(), caller == null ? "Mineplex Anti-Cheat" : caller.getName() + " muted " + playerName + " for " + durationString + ".")); //Inform Player target = UtilPlayer.searchExact(playerName); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java index 3df200b7d..4ae6c4d69 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java @@ -483,7 +483,7 @@ public class PunishPage extends CraftInventoryCustom implements Listener if (punishResponse != PunishmentResponse.PunishmentRemoved) { - _player.sendMessage(F.main(_plugin.GetName(), "There was a problem removing the punishment.")); + _player.sendMessage(F.main(_plugin.getName(), "There was a problem removing the punishment.")); } else { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java index 5462203fa..c37a34aff 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java @@ -23,9 +23,9 @@ public class ReportPlugin extends MiniPlugin @Override public void AddCommands() { - AddCommand(new ReportCommand(this)); - AddCommand(new ReportHandleCommand(this)); - AddCommand(new ReportCloseCommand(this)); + addCommand(new ReportCommand(this)); + addCommand(new ReportHandleCommand(this)); + addCommand(new ReportCloseCommand(this)); //AddCommand(new ReportDebugCommand(this)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java index 49e232446..03ce14e9a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java @@ -25,7 +25,7 @@ public class ReportCloseCommand extends CommandBase { if(args == null || args.length < 2) { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCommand.java index f9cebd2aa..9faf41139 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCommand.java @@ -25,7 +25,7 @@ public class ReportCommand extends CommandBase { if(args == null || args.length < 2) { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else @@ -40,7 +40,7 @@ public class ReportCommand extends CommandBase } else { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cRed + "Unable to find player '" + UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Unable to find player '" + playerName + "'!")); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java index 099bbe14b..3b037a0a2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java @@ -25,7 +25,7 @@ public class ReportHandleCommand extends CommandBase { if(args == null || args.length < 1) { - UtilPlayer.message(player, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else diff --git a/Plugins/Mineplex.Core/src/mineplex/core/spawn/Spawn.java b/Plugins/Mineplex.Core/src/mineplex/core/spawn/Spawn.java index 491c982d9..3645b82fa 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/spawn/Spawn.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/spawn/Spawn.java @@ -38,7 +38,7 @@ public class Spawn extends MiniPlugin @Override public void AddCommands() { - AddCommand(new SpawnCommand(this)); + addCommand(new SpawnCommand(this)); } public Location getSpawn() @@ -67,7 +67,7 @@ public class Spawn extends MiniPlugin UtilPlayer.message(player, F.main(_moduleName, "You added a Spawn Node.")); //Log - Log("Added Spawn [" + UtilWorld.locToStr(loc) + "] by [" + player.getName() + "]."); + log("Added Spawn [" + UtilWorld.locToStr(loc) + "] by [" + player.getName() + "]."); } public void ClearSpawn(Player player) @@ -82,7 +82,7 @@ public class Spawn extends MiniPlugin UtilPlayer.message(player, F.main(_moduleName, "You cleared all Spawn Nodes.")); //Log - Log("Cleared Spawn [ALL] by [" + player.getName() + "]."); + log("Cleared Spawn [ALL] by [" + player.getName() + "]."); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java index a231b097b..8a776d29d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsManager.java @@ -182,7 +182,7 @@ public class StatsManager extends MiniClientPlugin @Override public void AddCommands() { - AddCommand(new TimeCommand(this)); - AddCommand(new GiveStatCommand(this)); + addCommand(new TimeCommand(this)); + addCommand(new GiveStatCommand(this)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java index 68d972a8c..493bd3381 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java @@ -41,7 +41,7 @@ public class Teleport extends MiniPlugin @Override public void AddCommands() { - AddCommand(new TeleportCommand(this)); + addCommand(new TeleportCommand(this)); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TeleportCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TeleportCommand.java index 0ab4e2ea6..27b3d7f6b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TeleportCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TeleportCommand.java @@ -44,7 +44,7 @@ public class TeleportCommand extends MultiCommandBase Plugin.playerToLoc(caller, args[0], args[1], args[2], args[3]); else { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Commands List:")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Commands List:")); UtilPlayer.message(caller, F.help("/tp ", "Teleport to Player", Rank.MODERATOR)); UtilPlayer.message(caller, F.help("/tp b(ack) (amount) (player)", "Undo Teleports", Rank.MODERATOR)); UtilPlayer.message(caller, F.help("/tp here ", "Teleport Player to Self", Rank.ADMIN)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java index be07e57a8..9ff7af863 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java @@ -136,7 +136,7 @@ public class FileUpdater extends MiniPlugin } catch (Exception ex) { - System.out.println(F.main(GetName(), "Error parsing jar md5's")); + System.out.println(F.main(getName(), "Error parsing jar md5's")); ex.printStackTrace(); } finally @@ -186,7 +186,7 @@ public class FileUpdater extends MiniPlugin } catch (Exception ex) { - System.out.println(F.main(GetName(), "Error parsing jar md5's")); + System.out.println(F.main(getName(), "Error parsing jar md5's")); ex.printStackTrace(); } finally diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java new file mode 100644 index 000000000..0eae99feb --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java @@ -0,0 +1,469 @@ +package mineplex.game.clans.clans; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedList; + +import mineplex.core.account.CoreClient; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilWorld; +import mineplex.core.common.util.UtilTime.TimeUnit; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.game.clans.clans.repository.tokens.ClanAllianceToken; +import mineplex.game.clans.clans.repository.tokens.ClanToken; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; + +public class ClanInfo +{ + public enum Role + { + LEADER(4), ADMIN(3), MEMBER(2), RECRUIT(1), NONE(0); + + private int i; + + private Role(int value) + { + this.i = value; + } + + public int toInt() + { + return i; + } + } + + private String _name = ""; + private String _desc = ""; + private Location _home = null; + + private boolean _admin = false; + + private long _dateCreated = 0; + private long _lastOnline = 0; + + private NautHashMap _allyMap = new NautHashMap(); + + // Loaded from Client + private NautHashMap _memberMap = new NautHashMap(); + private HashSet _claimSet = new HashSet(); + + // Temporary + private NautHashMap _inviteeMap = new NautHashMap(); + private NautHashMap _inviterMap = new NautHashMap(); + + private NautHashMap _requestMap = new NautHashMap(); + + public ClansManager Clans; + + public ClanInfo(ClansManager clans, ClanToken token) + { + Clans = clans; + + _name = token.Name; + _desc = token.Description; + + try + { + _home = UtilWorld.strToLoc(token.Home); + } + catch (Exception e) + { + + } + _admin = token.Admin; + + _dateCreated = token.DateCreated; + _lastOnline = token.LastOnline; + } + + public int getClaims() + { + return getClaimSet().size(); + } + + public int getClaimsMax() + { + if (ssAdmin()) + return 1000; + + return 2 + getMembers().size(); + } + + public int getAllies() + { + return getAllyMap().size(); + } + + public int getAlliesMax() + { + if (ssAdmin()) + return 1000; + + return Math.max(2, 9 - _memberMap.size()); + } + + public boolean isRequested(String clan) + { + if (!getRequestMap().containsKey(clan)) + return false; + + if (System.currentTimeMillis() > getRequestMap().get(clan) + (Clans.getInviteExpire() * 60000)) + return false; + + return true; + } + + public boolean isInvited(String player) + { + if (!getInviteeMap().containsKey(player)) + return false; + + if (System.currentTimeMillis() > getInviteeMap().get(player) + (Clans.getInviteExpire() * 60000)) + return false; + + return true; + } + + public boolean isMember(String clan) + { + return getMembers().containsKey(clan); + } + + public boolean isAlly(String other) + { + return getAllyMap().containsKey(other); + } + + public boolean isSelf(String other) + { + return this.getName().equals(other); + } + + public boolean isNeutral(String other) + { + return (!isAlly(other) && !isSelf(other)); + } + + public long getTimer() + { + int penalty = 0; + return System.currentTimeMillis() + (penalty * 1000); + } + + public boolean getTrust(String clan) + { + if (!getAllyMap().containsKey(clan)) + return false; + + return getAllyMap().get(clan); + } + + public LinkedList mDetails(String caller) + { + LinkedList stringList = new LinkedList(); + + stringList.add(F.main("Clans", C.mRel(C.relPC(caller, this), getName() + " Information;", true))); + // stringList.add(F.value("Desc", _desc)); + + // Age + stringList.add(F.value("Age", + UtilTime.convertString(System.currentTimeMillis() - _dateCreated, 1, TimeUnit.FIT))); + + // Home + if (C.relPC(caller, this) == ClanRelation.SELF) + stringList.add(F.value("Home", UtilWorld.locToStrClean(getHome()))); + + // Land + stringList.add(F.value("Territory", getClaims() + "/" + getClaimsMax())); + + // Ally String + String allySorted = ""; + HashSet allyUnsorted = new HashSet(); + + for (String allyName : getAllyMap().keySet()) + allyUnsorted.add(allyName); + + for (String cur : UtilAlg.sortKey(allyUnsorted)) + allySorted += C.mRel(C.relPC(caller, Clans.getClanMap().get(cur)), cur, false) + + ", "; + + stringList.add(F.value("Allies", allySorted)); + + // Members + String members = ""; + for (String cur : UtilAlg.sortKey(getMembers().keySet())) + { + String name = C.listValueOff + cur; + if (UtilPlayer.isOnline(cur)) + name = C.listValueOn + cur; + + if (getMembers().get(cur) == Role.LEADER) + members += C.listValue + "L." + name + C.mBody + ", "; + + if (getMembers().get(cur) == Role.ADMIN) + members += C.listValue + "A." + name + C.mBody + ", "; + + if (getMembers().get(cur) == Role.MEMBER) + members += C.listValue + "M." + name + C.mBody + ", "; + + if (getMembers().get(cur) == Role.RECRUIT) + members += C.listValue + "R." + name + C.mBody + ", "; + } + stringList.add(F.value("Members", members)); + + // Protected + stringList.add(F.value("TNT Protection", getProtected())); + + // Dominance + ClanInfo callerClan = Clans.CUtil().getClanByPlayer(caller); + if (callerClan != null) + if (this.isEnemy(callerClan.getName())) + stringList.add(F.value("Dominance", callerClan.getDominanceString(this))); + + return stringList; + } + + public LinkedList mTerritory() + { + LinkedList stringList = new LinkedList(); + + stringList.add(F.main("Clans", getName() + " Territory;")); + + for (String cur : getClaimSet()) + { + stringList.add(cur); + } + + return stringList; + } + + public void inform(String message, String ignore) + { + for (String cur : getMembers().keySet()) + { + if (ignore != null && cur.equals(ignore)) + continue; + + Player player = UtilPlayer.searchOnline(null, cur, false); + + if (player == null) + continue; + + UtilPlayer.message(player, F.main("Clans", message)); + player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f); + } + } + + public void chat(Player sender, String message, String filteredMessage) + { + for (String cur : getMembers().keySet()) + { + Player player = UtilPlayer.searchOnline(null, cur, false); + + if (player == null) + continue; + + CoreClient client = Clans.Clients().Get(player); + + if (client.Game().GetFilterChat()) + UtilPlayer.message(player, C.cAqua + sender.getName() + C.cDAqua + " " + filteredMessage); + else + UtilPlayer.message(player, C.cAqua + sender.getName() + C.cDAqua + " " + message); + } + } + + public void allyChat(ClanInfo senderClan, Player sender, String message, String filteredMessage) + { + for (String cur : getMembers().keySet()) + { + Player player = UtilPlayer.searchOnline(null, cur, false); + + if (player == null) + continue; + + CoreClient client = Clans.Clients().Get(player); + + // C.cDGreen + senderClan.GetName() + " " + + + if (client.Game().GetFilterChat()) + UtilPlayer.message(player, C.cDGreen + sender.getName() + C.cGreen + " " + filteredMessage); + else + UtilPlayer.message(player, C.cDGreen + sender.getName() + C.cGreen + " " + message); + } + } + + public String getName() + { + return _name; + } + + public String getDesc() + { + return _desc; + } + + public void setDesc(String desc) + { + _desc = desc; + } + + public NautHashMap getMembers() + { + return _memberMap; + } + + public HashSet getClaimSet() + { + return _claimSet; + } + + public Location getHome() + { + return _home; + } + + public void setHome(Location loc) + { + _home = loc; + } + + public boolean ssAdmin() + { + return _admin; + } + + public void setAdmin(boolean admin) + { + _admin = admin; + } + + public NautHashMap getInviterMap() + { + return _inviterMap; + } + + public NautHashMap getInviteeMap() + { + return _inviteeMap; + } + + public NautHashMap getAllyMap() + { + return _allyMap; + } + + public NautHashMap getRequestMap() + { + return _requestMap; + } + + public long getDateCreated() + { + return _dateCreated; + } + + public long getLastOnline() + { + return _lastOnline; + } + + public void setLastOnline(long lastOnline) + { + _lastOnline = lastOnline; + } + + public ClanToken GetToken() + { + // Update Members + _token.Members = new ArrayList(); + for (String name : getMembers().keySet()) + { + ClanMemberToken token = new ClanMemberToken(); + token.Name = name; + token.ClanRole = getMembers().get(name).toString(); + + _token.Members.add(token); + } + + // Update Territory + _token.Territories = new ArrayList(); + for (String chunk : getClaimSet()) + { + ClanTerritoryToken token = new ClanTerritoryToken(); + token.ClanName = _token.Name; + token.ClanId = _token.ClanId; + token.ServerName = Clans.GetServerName(); + token.Chunk = chunk; + + if (Clans.GetClaimMap().get(chunk) != null) + token.Safe = Clans.GetClaimMap().get(chunk).safe; + + _token.Territories.add(token); + } + + // Update Relations + _token.Alliances = new ArrayList(); + for (String clanName : getAllyMap().keySet()) + { + ClanInfo clan = Clans.getClan(clanName); + ClanAllianceToken token = new ClanAllianceToken(); + token.ClanId = clan.GetTokenUnupdated().ClanId; + token.ClanName = clan.GetTokenUnupdated().Name; + + if (getAllyMap().get(clanName)) + token.Trusted = true; + + _token.Alliances.add(token); + } + + return _token; + } + + public boolean isOnlineNow() + { + for (String cur : getMembers().keySet()) + if (UtilPlayer.isOnline(cur)) + return true; + + return false; + } + + public boolean isOnline() + { + for (String cur : getMembers().keySet()) + if (UtilPlayer.isOnline(cur)) + return true; + + return System.currentTimeMillis() - _lastOnline < Clans.GetOnlineTime(); + } + + public String getProtected() + { + for (String cur : getMembers().keySet()) + if (UtilPlayer.isOnline(cur)) + return C.cRed + "No - Clan Members are Online"; + + if (System.currentTimeMillis() - _lastOnline > Clans.GetOnlineTime()) + return C.cGreen + "Yes - Clan Members are Offline"; + + return C.cGold + + "No, " + + UtilTime.convertString(Clans.GetOnlineTime() - (System.currentTimeMillis() - _lastOnline), 1, + TimeUnit.FIT) + " to Protection"; + } + + public boolean isAdmin() + { + return _admin; + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java new file mode 100644 index 000000000..b61293a0e --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -0,0 +1,53 @@ +package mineplex.game.clans.clans; + +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.common.util.NautHashMap; +import mineplex.game.clans.clans.repository.ClanTerritory; + +public class ClansManager extends MiniPlugin +{ + private int _dominanceLimit = 16; + private int _inviteExpire = 2; + private int _nameMin = 3; + private int _nameMax = 10; + private long _reclaimTime = 1800000; + private long _onlineTime = 1200000; + + //Clans + private NautHashMap _clanMap = new NautHashMap(); + private NautHashMap _clanMemberMap = new NautHashMap(); + private NautHashMap _claimMap = new NautHashMap(); + private NautHashMap _unclaimMap = new NautHashMap(); + + public ClansManager(String moduleName, JavaPlugin plugin) + { + super(moduleName, plugin); + } + + public int getInviteExpire() + { + return _inviteExpire; + } + + public NautHashMap getClanMap() + { + return _clanMap; + } + + public NautHashMap getClanMemberMap() + { + return _clanMemberMap; + } + + public ClanInfo getClan(String clan) + { + return _clanMap.get(clan); + } + + public NautHashMap getClaimMap() + { + return _claimMap; + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java new file mode 100644 index 000000000..181898923 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java @@ -0,0 +1,551 @@ +package mineplex.game.clans.clans; + +import java.util.LinkedList; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Chunk; +import org.bukkit.Location; +import org.bukkit.entity.Player; + +import mineplex.core.account.CoreClient; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +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.game.clans.clans.repository.ClanTerritory; +import mineplex.game.clans.clans.repository.tokens.ClanTerritoryToken; + +public class ClansUtility +{ + private ClansManager Clans; + + public ClansUtility(ClansManager clans) + { + Clans = clans; + } + + public enum ClanRelation + { + SELF, + ALLY, + ALLY_TRUST, + NEUTRAL, + ENEMY, + PILLAGE, + ADMIN, + SAFE + } + + public ClanInfo searchClanPlayer(Player caller, String name, boolean inform) + { + //CLAN + LinkedList clanMatchList = new LinkedList(); + + for (ClanInfo cur : Clans.getClanMap().values()) + { + if (cur.getName().equalsIgnoreCase(name)) + return cur; + + if (cur.getName().toLowerCase().contains(name.toLowerCase())) + clanMatchList.add(cur); + } + + if (clanMatchList.size() == 1) + return clanMatchList.get(0); + + //No / Non-Unique + String clanMatchString = "None"; + if (clanMatchList.size() > 1) + { + for (ClanInfo cur : clanMatchList) + clanMatchString += cur.getName() + " "; + } + + //PLAYER + LinkedList playerMatchList = new LinkedList(); + + for (Entry clanMemberEntry : Clans.getClanMemberMap().entrySet()) + { + if (clanMemberEntry.getKey().equalsIgnoreCase(name)) + return clanMemberEntry.getValue(); + + if (clanMemberEntry.getKey().toLowerCase().contains(name.toLowerCase())) + playerMatchList.add(clanMemberEntry.getValue()); + } + + if (playerMatchList.size() == 1) + return playerMatchList.get(0); + + //No / Non-Unique + String playerMatchString = "None"; + if (playerMatchList.size() > 1) + { + for (ClanInfo cur : playerMatchList) + playerMatchString += cur.getName() + " "; + } + + if (inform) + { + UtilPlayer.message(caller, F.main("Clan Search", "" + + C.mCount + (clanMatchList.size() + playerMatchList.size()) + + C.mBody + " matches for [" + + C.mElem + name + + C.mBody + "]."), false); + + UtilPlayer.message(caller, F.desc("Matches via Clan", clanMatchString), false); + UtilPlayer.message(caller, F.desc("Matches via Player", playerMatchString), false);; + } + + return null; + } + + public ClanInfo searchClan(Player caller, String name, boolean inform) + { + LinkedList matchList = new LinkedList(); + + for (ClanInfo cur : Clans.getClanMap().values()) + { + if (cur.getName().equalsIgnoreCase(name)) + return cur; + + if (cur.getName().toLowerCase().contains(name.toLowerCase())) + matchList.add(cur); + } + + //No / Non-Unique + if (matchList.size() != 1) + { + if (!inform) + return null; + + //Inform + UtilPlayer.message(caller, F.main("Clan Search", "" + + C.mCount + matchList.size() + + C.mBody + " matches for [" + + C.mElem + name + + C.mBody + "]."), false); + + if (matchList.size() > 0) + { + String matchString = ""; + for (ClanInfo cur : matchList) + matchString += cur.getName() + " "; + + UtilPlayer.message(caller, F.main("Clan Search", "" + + C.mBody + " Matches [" + + C.mElem + matchString + + C.mBody + "]."), false); + } + + return null; + } + + return matchList.get(0); + } + + public ClanInfo getClanByClanName(String clan) + { + return Clans.getClan(clan); + } + + public ClanInfo getClanByPlayer(Player player) + { + return getClanByPlayer(player.getName()); + } + + public ClanInfo getClanByPlayer(String name) + { + if (!Clans.getClanMemberMap().containsKey(name)) + return null; + + return Clans.getClanMemberMap().get(name); + } + + public Role getRole(Player player) + { + try + { + return getClanByPlayer(player).getMembers().get(player.getName()); + } + catch (Exception e) + { + return Role.NONE; + } + } + + public boolean isSafe(Player player) + { + ClanInfo clan = getClanByPlayer(player); + + if (!UtilTime.elapsed(Clans.Clients().Get(player).Player().GetLastDamager(), 15000)) + return false; + + return isSafe(player.getLocation()); + } + + public boolean isSafe(Location loc) + { + if (!Clans.getClaimMap().containsKey(UtilWorld.chunkToStr(loc.getChunk()))) + return false; + + return Clans.getClaimMap().get(UtilWorld.chunkToStr(loc.getChunk())).Safe; + } + + public boolean isChunkHome(ClanInfo clan, Chunk chunk) + { + if (clan == null) + return false; + + if (clan.getHome() == null) + return false; + + return clan.getHome().getChunk().equals(chunk); + } + + public ClanTerritory getClaim(Location loc) + { + String chunk = UtilWorld.chunkToStr(loc.getChunk()); + return Clans.getClaimMap().get(chunk); + } + + public ClanTerritory getClaim(String chunk) + { + return Clans.getClaimMap().get(chunk); + } + + public ClanInfo getOwner(String chunk) + { + ClanTerritory claim = getClaim(chunk); + + if (claim == null) + return null; + + return getOwner(claim); + } + + public ClanInfo getOwner(Location loc) + { + ClanTerritory claim = getClaim(loc); + + if (claim != null) + return getOwner(claim); + + return null; + } + + public ClanInfo getOwner(ClanTerritory claim) + { + return getClanByClanName(claim.Owner); + } + + public String getOwnerString(Location loc) + { + ClanInfo owner = getOwner(loc); + + if (owner == null) + return "Wilderness"; + + return owner.getName(); + } + + public String getOwnerStringRel(Location loc, String player) + { + ClanRelation rel = relPT(player, UtilWorld.chunkToStr(loc.getChunk())); + return mRel(rel, getOwnerString(loc), true); + } + + public boolean isClaimed(Location loc) + { + String chunk = UtilWorld.chunkToStr(loc.getChunk()); + + return Clans.getClaimMap().containsKey(chunk); + } + + public boolean isAlliance(String player, Location loc) + { + if (!Clans.getClanMemberMap().containsKey(player)) + return false; + + if (!isClaimed(loc)) + return false; + + return getOwner(getClaim(loc)).isAlly(Clans.getClanMemberMap().get(player).getName()); + } + + public boolean isSelf(String player, Location loc) + { + if (!Clans.getClanMemberMap().containsKey(player)) + return false; + + if (!isClaimed(loc)) + return false; + + return getOwner(getClaim(loc)).isSelf(Clans.getClanMemberMap().get(player).getName()); + } + + public boolean isAdmin(Location loc) + { + if (!isClaimed(loc)) + return false; + + return getOwner(getClaim(loc)).isAdmin(); + } + + public boolean isSpecial(Location loc, String special) + { + if (!isClaimed(loc)) + return false; + + if (!isAdmin(loc)) + return false; + + return getOwner(getClaim(loc)).getName().toLowerCase().contains(special.toLowerCase()); + } + + public ClanRelation getAccess(Player player, Location loc) + { + //Observer Override + if (Clans.Observer().isObserver(player, false)) + { + if (Clans.Observer().isObserver(player, true)) + return ClanRelation.SELF; + else + return ClanRelation.NEUTRAL; + } + + ClanInfo owner = this.getOwner(loc); + ClanInfo clan = getClanByPlayer(player); + + if (owner == null) + return ClanRelation.SELF; + + if (owner.equals(Clans.CAdmin().getMimic(player, false))) + return ClanRelation.SELF; + + if (owner.equals(clan)) + return ClanRelation.SELF; + + if (clan != null) + if (owner.getTrust(clan.getName())) + return ClanRelation.ALLY_TRUST; + + if (clan != null) + if (owner.isAlly(clan.getName())) + return ClanRelation.ALLY; + + if (clan != null) + if (owner.isEnemy(clan.getName())) + return ClanRelation.ENEMY; + + return ClanRelation.NEUTRAL; + } + + //Player Player + public ClanRelation relPP(String pA, String pB) + { + return rel(getClanByPlayer(pA), getClanByPlayer(pB)); + } + + //Clan Clan + public ClanRelation relCC(String cA, String cB) + { + return rel(searchClan(null, cA, false), searchClan(null, cB, false)); + } + + //Territory Territory + public ClanRelation relTT(String tA, String tB) + { + return rel(getOwner(tA), getOwner(tB)); + } + + //Player Clan + public ClanRelation relPC(String pA, String cB) + { + return rel(getClanByPlayer(pA), searchClan(null, cB, false)); + } + + //Player Clan (Object) + public ClanRelation relPC(String pA, ClanInfo cB) + { + return rel(getClanByPlayer(pA), cB); + } + + //Player Territory + public ClanRelation relPT(String pA, String tB) + { + ClanTerritory claim = getClaim(tB); + if (claim != null) + if (claim.Safe) + return ClanRelation.SAFE; + + return rel(getClanByPlayer(pA), getOwner(tB)); + } + + //Clan Territory + public ClanRelation relCT(String cA, String tB) + { + ClanTerritory claim = getClaim(tB); + if (claim != null) + if (claim.Safe) + return ClanRelation.SAFE; + + return rel(searchClan(null, cA, false), getOwner(tB)); + } + + public ClanRelation rel(ClanInfo cA, ClanInfo cB) + { + if (cA == null || cB == null) + return ClanRelation.NEUTRAL; + + //Self + if (cA.isAdmin() || cB.isAdmin()) + return ClanRelation.ADMIN; + + if (cA.getName().equals(cB.getName())) + return ClanRelation.SELF; + + //Ally + if (cA.getTrust(cB.getName())) + return ClanRelation.ALLY_TRUST; + + if (cA.isAlly(cB.getName())) + return ClanRelation.ALLY; + + //Enemy + return ClanRelation.NEUTRAL; + } + + public ChatColor relChatColor(ClanRelation relation, boolean dark) + { + if (relation == ClanRelation.SAFE) return C.xAdmin; + if (relation == ClanRelation.ADMIN) return C.xAdmin; + + if (!dark) + { + if (relation == ClanRelation.SELF) return C.xSelf; + if (relation == ClanRelation.ALLY_TRUST) return C.xdAlly; + if (relation == ClanRelation.ALLY) return C.xAlly; + if (relation == ClanRelation.ENEMY) return C.xWar; + if (relation == ClanRelation.PILLAGE) return C.xPillage; + return C.xEnemy; + } + + if (relation == ClanRelation.SELF) return C.xdSelf; + if (relation == ClanRelation.ALLY_TRUST) return C.xAlly; + if (relation == ClanRelation.ALLY) return C.xdAlly; + if (relation == ClanRelation.ENEMY) return C.xdWar; + if (relation == ClanRelation.PILLAGE) return C.xdPillage; + return C.xdEnemy; + } + + public String relColor(ClanRelation relation, boolean dark) + { + if (relation == ClanRelation.SAFE) return C.xAdmin + "(" + C.xSafe + "SAFE" + C.xAdmin + ") "; + + return relChatColor(relation, dark) + ""; + } + + public String mRel(ClanRelation relation, String message, boolean dark) + { + return relColor(relation, dark) + message + C.mChat; + } + + public boolean playerSelf(String pA, String pB) + { + ClanInfo cA = getClanByPlayer(pA); + ClanInfo cB = getClanByPlayer(pB); + + if (cA == null || cB == null) + return false; + + return cA.isSelf(cB.getName()); + } + + public boolean playerAlly(String pA, String pB) + { + ClanInfo cA = getClanByPlayer(pA); + ClanInfo cB = getClanByPlayer(pB); + + if (cA == null || cB == null) + return false; + + return cA.isAlly(cB.getName()); + } + + public boolean playerEnemy(String pA, String pB) + { + ClanInfo cA = getClanByPlayer(pA); + ClanInfo cB = getClanByPlayer(pB); + + if (cA == null || cB == null) + return true; + + return !(cA.isAlly(cB.getName()) || cA.isSelf(cB.getName())); + } + + public boolean canHurt(Player damagee, Player damager) + { + if (damagee == null) + return false; + + if (isSafe(damagee)) + return false; + + if (damager == null) + return true; + + if (isSafe(damager)) + return false; + + ClanRelation rel = Clans.CUtil().relPP(damagee.getName(), damager.getName()); + + if (rel == ClanRelation.ALLY || rel == ClanRelation.ALLY_TRUST || rel == ClanRelation.SELF) + return false; + + return true; + } + + public void updateRelations(String name) + { + updateRelations(UtilPlayer.searchExact(name)); + } + + public void updateRelations(Player player) + { + if (player == null) + return; + + CoreClient client = Clans.Clients().Get(player); + + for (Player cur : UtilServer.getPlayers()) + { + //For Player + client.Clan().SetRelationship( + cur.getName(), relPP(cur.getName(), player.getName())); + + //For Other + Clans.Clients().Get(cur.getName()).Clan().SetRelationship( + player.getName(), relPP(player.getName(), cur.getName())); + + if (player.canSee(cur)) + { + player.hidePlayer(cur); + player.showPlayer(cur); + } + + if (cur.canSee(player)) + { + cur.hidePlayer(player); + cur.showPlayer(player); + } + } + } + + public boolean isBorderlands(Location loc) + { + return (Math.abs(loc.getX()) > 400 || Math.abs(loc.getZ()) > 400); + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java new file mode 100644 index 000000000..6b03f54ab --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java @@ -0,0 +1,23 @@ +package mineplex.game.clans.clans.repository; + +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.database.RepositoryBase; + +public class ClanRepository extends RepositoryBase +{ + public ClanRepository(JavaPlugin plugin) + { + super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh"); + } + + @Override + protected void initialize() + { + } + + @Override + protected void update() + { + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanTerritory.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanTerritory.java new file mode 100644 index 000000000..9db9852a1 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanTerritory.java @@ -0,0 +1,7 @@ +package mineplex.game.clans.clans.repository; + +public class ClanTerritory +{ + public boolean Safe; + public String Owner; +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanAllianceToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanAllianceToken.java new file mode 100644 index 000000000..fe4520969 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanAllianceToken.java @@ -0,0 +1,7 @@ +package mineplex.game.clans.clans.repository.tokens; + +public class ClanAllianceToken +{ + public String ClanName; + public boolean Trusted; +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanMemberToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanMemberToken.java new file mode 100644 index 000000000..3ff8fe52f --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanMemberToken.java @@ -0,0 +1,7 @@ +package mineplex.game.clans.clans.repository.tokens; + +public class ClanMemberToken +{ + public String Name; + public String ClanRole; +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanTerritoryToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanTerritoryToken.java new file mode 100644 index 000000000..5b7ca2108 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanTerritoryToken.java @@ -0,0 +1,10 @@ +package mineplex.game.clans.clans.repository.tokens; + +public class ClanTerritoryToken +{ + public String ClanName; + public int ClanId; + public String ServerName; + public String Chunk; + public boolean Safe; +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanToken.java new file mode 100644 index 000000000..99b18e668 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/tokens/ClanToken.java @@ -0,0 +1,17 @@ +package mineplex.game.clans.clans.repository.tokens; + +import java.util.List; + +public class ClanToken +{ + public String Name; + public String Description; + public String Home; + public boolean Admin; + public long DateCreated; + public long LastOnline; + + List Members; + List Territories; + List Alliances; +} diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/Field.java similarity index 90% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/Field.java index 05b34120f..19e08b7f2 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Field.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/Field.java @@ -1,11 +1,11 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import org.bukkit.plugin.java.JavaPlugin; -import me.chiss.Core.Field.repository.FieldRepository; import mineplex.core.MiniPlugin; import mineplex.core.creature.Creature; import mineplex.core.energy.Energy; +import mineplex.game.clans.fields.repository.FieldRepository; import mineplex.minecraft.game.core.condition.ConditionFactory; public class Field extends MiniPlugin diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlock.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlock.java similarity index 97% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlock.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlock.java index 726ddb4d9..d2a980f2a 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlock.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlock.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import java.util.HashMap; import java.util.HashSet; @@ -15,8 +15,6 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; -import me.chiss.Core.Field.repository.FieldBlockToken; -import me.chiss.Core.Field.repository.FieldRepository; import mineplex.core.MiniPlugin; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; @@ -28,6 +26,8 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.energy.Energy; +import mineplex.game.clans.fields.repository.FieldBlockToken; +import mineplex.game.clans.fields.repository.FieldRepository; import mineplex.minecraft.game.core.condition.ConditionFactory; public class FieldBlock extends MiniPlugin @@ -67,7 +67,7 @@ public class FieldBlock extends MiniPlugin { populateSettings(caller); - UtilPlayer.message(caller, F.main(GetName(), "Field Addition Settings;")); + UtilPlayer.message(caller, F.main(getName(), "Field Addition Settings;")); UtilPlayer.message(caller, F.desc("Title", _title.get(caller))); UtilPlayer.message(caller, F.desc("Stock", _stock.get(caller)+"")); UtilPlayer.message(caller, F.desc("Regen", _regen.get(caller)+"")); diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockData.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlockData.java similarity index 99% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockData.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlockData.java index 8fd91b4af..b81f8c853 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockData.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlockData.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import java.util.ArrayList; diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockLootData.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlockLootData.java similarity index 96% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockLootData.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlockLootData.java index e1c3b6796..3c906cf92 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldBlockLootData.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldBlockLootData.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilMath; diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldMonster.java similarity index 89% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldMonster.java index 417e3e353..5690bea14 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonster.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldMonster.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import java.util.HashSet; import java.util.WeakHashMap; @@ -17,9 +17,9 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilWorld; import mineplex.core.creature.Creature; -import me.chiss.Core.Field.Monsters.FieldMonsterBase; -import me.chiss.Core.Field.repository.FieldMonsterToken; -import me.chiss.Core.Field.repository.FieldRepository; +import mineplex.game.clans.fields.monsters.FieldMonsterBase; +import mineplex.game.clans.fields.repository.FieldMonsterToken; +import mineplex.game.clans.fields.repository.FieldRepository; public class FieldMonster extends MiniPlugin { @@ -44,7 +44,7 @@ public class FieldMonster extends MiniPlugin public void Help(Player caller) { - UtilPlayer.message(caller, F.main(GetName(), "Commands List;")); + UtilPlayer.message(caller, F.main(getName(), "Commands List;")); UtilPlayer.message(caller, F.help("/fm type ", "Set Monster Type", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/fm max <#>", "Set Monster Limit", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/fm rate ", "Set Monster Rate", Rank.ADMIN)); @@ -64,7 +64,7 @@ public class FieldMonster extends MiniPlugin if (input.type == null) { - UtilPlayer.message(caller, F.main(GetName(), "You have not set Monster Type.")); + UtilPlayer.message(caller, F.main(getName(), "You have not set Monster Type.")); return; } @@ -72,7 +72,7 @@ public class FieldMonster extends MiniPlugin { if (name.equalsIgnoreCase(pit.GetName())) { - UtilPlayer.message(caller, F.main(GetName(), "Monster Field with this name already exists.")); + UtilPlayer.message(caller, F.main(getName(), "Monster Field with this name already exists.")); return; } } @@ -80,7 +80,7 @@ public class FieldMonster extends MiniPlugin FieldMonsterBase pit = new FieldMonsterBase(this, name, _serverName, input.type, input.mobMax, input.mobRate, caller.getLocation(), input.radius, input.height); Add(pit, true); - UtilPlayer.message(caller, F.main(GetName(), "You created Monster Field.")); + UtilPlayer.message(caller, F.main(getName(), "You created Monster Field.")); pit.Display(caller); } @@ -106,7 +106,7 @@ public class FieldMonster extends MiniPlugin for (FieldMonsterBase pit : remove) Delete(pit, true); - UtilPlayer.message(caller, F.main(GetName(), "Deleted " + i + " Monster Field(s).")); + UtilPlayer.message(caller, F.main(getName(), "Deleted " + i + " Monster Field(s).")); } private void Delete(FieldMonsterBase pit, boolean repo) diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonsterInput.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldMonsterInput.java similarity index 95% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonsterInput.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldMonsterInput.java index d8227a054..ac3d0a60f 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldMonsterInput.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldMonsterInput.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOre.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldOre.java similarity index 97% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOre.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldOre.java index e6a510ff9..f4c4d122a 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOre.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldOre.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import java.util.ArrayList; import java.util.HashSet; @@ -14,8 +14,6 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; -import me.chiss.Core.Field.repository.FieldOreToken; -import me.chiss.Core.Field.repository.FieldRepository; import mineplex.core.MiniPlugin; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; @@ -28,6 +26,8 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.game.clans.fields.repository.FieldOreToken; +import mineplex.game.clans.fields.repository.FieldRepository; public class FieldOre extends MiniPlugin { diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOreData.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldOreData.java similarity index 99% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOreData.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldOreData.java index c7fa15213..7e5d9bd5e 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/FieldOreData.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/FieldOreData.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import java.util.HashSet; diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/UtilField.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/UtilField.java similarity index 88% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/UtilField.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/UtilField.java index a631b7b72..e2758e357 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/UtilField.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/UtilField.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field; +package mineplex.game.clans.fields; import mineplex.core.common.util.UtilServer; diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldBlockCommand.java similarity index 85% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldBlockCommand.java index 1b3fdbfff..aa6c16fd1 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldBlockCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldBlockCommand.java @@ -1,13 +1,13 @@ -package me.chiss.Core.Field.commands; +package mineplex.game.clans.fields.commands; import org.bukkit.entity.Player; -import me.chiss.Core.Field.FieldBlock; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.game.clans.fields.FieldBlock; public class FieldBlockCommand extends CommandBase { @@ -24,13 +24,13 @@ public class FieldBlockCommand extends CommandBase if (!Plugin.getActive().remove(caller.getName())) Plugin.getActive().add(caller.getName()); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Interact Active: " + F.tf(Plugin.getActive().contains(caller.getName())))); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Interact Active: " + F.tf(Plugin.getActive().contains(caller.getName())))); } else if (args[0].equalsIgnoreCase("load")) { Plugin.load(); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Reloaded Field Blocks from Database.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Reloaded Field Blocks from Database.")); } else if (args[0].equalsIgnoreCase("wipe")) @@ -65,7 +65,7 @@ public class FieldBlockCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Stock Max.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Stock Max.")); } } @@ -80,7 +80,7 @@ public class FieldBlockCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Stock Regeneration Time.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Stock Regeneration Time.")); } } @@ -99,7 +99,7 @@ public class FieldBlockCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Empty Block.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Empty Block.")); } } @@ -134,7 +134,7 @@ public class FieldBlockCommand extends CommandBase if (error) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Loot String.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Loot String.")); return; } diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldMonsterCommand.java similarity index 76% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldMonsterCommand.java index c313ebd79..93c6fd633 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldMonsterCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldMonsterCommand.java @@ -1,15 +1,15 @@ -package me.chiss.Core.Field.commands; +package mineplex.game.clans.fields.commands; import org.bukkit.entity.Player; -import me.chiss.Core.Field.FieldMonster; -import me.chiss.Core.Field.FieldMonsterInput; -import me.chiss.Core.Field.Monsters.FieldMonsterBase; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilPlayer; +import mineplex.game.clans.fields.FieldMonster; +import mineplex.game.clans.fields.FieldMonsterInput; +import mineplex.game.clans.fields.monsters.FieldMonsterBase; public class FieldMonsterCommand extends CommandBase { @@ -29,7 +29,7 @@ public class FieldMonsterCommand extends CommandBase if (args.length == 0) { Plugin.getInput().get(caller).Display(caller); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Type " + F.elem("/fm help") + " for commands.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Type " + F.elem("/fm help") + " for commands.")); } else if (args[0].equalsIgnoreCase("help")) @@ -47,7 +47,7 @@ public class FieldMonsterCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Monster Type.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Monster Type.")); } } @@ -62,7 +62,7 @@ public class FieldMonsterCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Monster Max.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Monster Max.")); } } @@ -77,7 +77,7 @@ public class FieldMonsterCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Monster Rate.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Monster Rate.")); } } @@ -92,7 +92,7 @@ public class FieldMonsterCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Area Radius.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Area Radius.")); } } @@ -107,7 +107,7 @@ public class FieldMonsterCommand extends CommandBase } catch (Exception e) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Area Height.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Area Height.")); } } @@ -115,7 +115,7 @@ public class FieldMonsterCommand extends CommandBase { if (args.length < 2) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Missing Monster Field Name.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Missing Monster Field Name.")); } else { @@ -127,7 +127,7 @@ public class FieldMonsterCommand extends CommandBase { if (args.length < 2) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Missing Monster Field Name.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Missing Monster Field Name.")); } else { @@ -137,7 +137,7 @@ public class FieldMonsterCommand extends CommandBase else if (args[0].equalsIgnoreCase("list")) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Monster Fields;")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Listing Monster Fields;")); for (FieldMonsterBase pit : Plugin.getPits()) pit.Display(caller); @@ -145,7 +145,7 @@ public class FieldMonsterCommand extends CommandBase else if (args[0].equalsIgnoreCase("info")) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Listing Monster Fields;")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Listing Monster Fields;")); for (FieldMonsterBase pit : Plugin.getPits()) pit.Display(caller); @@ -164,7 +164,7 @@ public class FieldMonsterCommand extends CommandBase else { - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Invalid Command.")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Invalid Command.")); } } } diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldOreCommand.java similarity index 87% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldOreCommand.java index 9a129fa97..b231a57d8 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/commands/FieldOreCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/commands/FieldOreCommand.java @@ -1,12 +1,12 @@ -package me.chiss.Core.Field.commands; +package mineplex.game.clans.fields.commands; import org.bukkit.entity.Player; -import me.chiss.Core.Field.FieldOre; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.game.clans.fields.FieldOre; public class FieldOreCommand extends CommandBase { @@ -29,7 +29,7 @@ public class FieldOreCommand extends CommandBase if (!Plugin.getActivePlayers().remove(caller.getName())) Plugin.getActivePlayers().add(caller.getName()); - UtilPlayer.message(caller, F.main(Plugin.GetName(), "Interact Active: " + F.tf(Plugin.getActivePlayers().contains(caller.getName())))); + UtilPlayer.message(caller, F.main(Plugin.getName(), "Interact Active: " + F.tf(Plugin.getActivePlayers().contains(caller.getName())))); } else if (args[0].equalsIgnoreCase("help")) diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/monsters/FieldMonsterBase.java similarity index 95% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/monsters/FieldMonsterBase.java index 3ec4965ba..d9ba62a23 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/Monsters/FieldMonsterBase.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/monsters/FieldMonsterBase.java @@ -1,12 +1,9 @@ -package me.chiss.Core.Field.Monsters; +package mineplex.game.clans.fields.monsters; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import me.chiss.Core.Field.FieldMonster; -import me.chiss.Core.Field.UtilField; -import me.chiss.Core.Field.repository.FieldMonsterToken; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.util.F; @@ -15,6 +12,9 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; +import mineplex.game.clans.fields.FieldMonster; +import mineplex.game.clans.fields.UtilField; +import mineplex.game.clans.fields.repository.FieldMonsterToken; import net.minecraft.server.v1_7_R4.EntityCreature; import net.minecraft.server.v1_7_R4.Navigation; diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldBlockToken.java similarity index 83% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldBlockToken.java index 5e14a9575..4185a6080 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldBlockToken.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldBlockToken.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field.repository; +package mineplex.game.clans.fields.repository; public class FieldBlockToken { diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldMonsterToken.java similarity index 81% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldMonsterToken.java index 4af6f408a..e85ba1e16 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldMonsterToken.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldMonsterToken.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field.repository; +package mineplex.game.clans.fields.repository; public class FieldMonsterToken { diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldOreToken.java similarity index 62% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldOreToken.java index ca8724762..9ad5dc8ed 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldOreToken.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldOreToken.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field.repository; +package mineplex.game.clans.fields.repository; public class FieldOreToken { diff --git a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java similarity index 99% rename from Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java index 55d8e538f..4fc3aa9ca 100644 --- a/Plugins/Mineplex.Game.Clans/src/me/chiss/Core/Field/repository/FieldRepository.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java @@ -1,4 +1,4 @@ -package me.chiss.Core.Field.repository; +package mineplex.game.clans.fields.repository; import java.sql.ResultSet; import java.sql.SQLException; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index e149227b0..1968f68c8 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -183,7 +183,7 @@ public class HubManager extends MiniClientPlugin _visibilityManager = new VisibilityManager(this); _forcefieldManager = new ForcefieldManager(this); - AddCommand(new ForcefieldRadius(_forcefieldManager)); + addCommand(new ForcefieldRadius(_forcefieldManager)); _statsManager = new StatsManager(plugin); _achievementManager = new AchievementManager(_statsManager, _clientManager, _donationManager); @@ -329,9 +329,9 @@ public class HubManager extends MiniClientPlugin @Override public void AddCommands() { - AddCommand(new GadgetToggle(this)); - AddCommand(new NewsCommand(this)); - AddCommand(new GameModeCommand(this)); + addCommand(new GadgetToggle(this)); + addCommand(new NewsCommand(this)); + addCommand(new GameModeCommand(this)); } @EventHandler(priority = EventPriority.HIGHEST) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java index 455218794..79a1c8de2 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java @@ -23,7 +23,7 @@ public class NewsAddCommand extends CommandBase { if (args == null || args.length == 0 || args.length > 128) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else @@ -40,7 +40,7 @@ public class NewsAddCommand extends CommandBase // Check for 256 character length for MySQL! if (newsEntry.length() > 256) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "The specified news entry is too long [> 256 characters]!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "The specified news entry is too long [> 256 characters]!")); return; } @@ -57,11 +57,11 @@ public class NewsAddCommand extends CommandBase } newsEntry = newsEntry.substring(0, newsEntry.length() - 1); - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cGray + "The news entry: " + C.cGold + newsEntry + C.cGray + " has been added to the database!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "The news entry: " + C.cGold + newsEntry + C.cGray + " has been added to the database!")); } else { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "There was an error adding the news entry to the database!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "There was an error adding the news entry to the database!")); } } }); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsConfirmCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsConfirmCommand.java index 337da8a8c..42dbe5159 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsConfirmCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsConfirmCommand.java @@ -22,7 +22,7 @@ public class NewsConfirmCommand extends CommandBase { if (args == null || args.length == 0 || args.length > 1) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else @@ -34,11 +34,11 @@ public class NewsConfirmCommand extends CommandBase } catch (Exception exception) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "The specified news position is invalid!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "The specified news position is invalid!")); return; } - UtilServer.getServer().dispatchCommand(UtilServer.getServer().getConsoleSender(), "tellraw " + caller.getName() + " {\"text\":\"" + Plugin.GetName() + "> \", color:blue, \"extra\":[{\"text\":\"[CONFIRM] \", color:green, \"clickEvent\":{\"action\":\"run_command\",\"value\":\"/news delete " + newsPosition + "\"}, \"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Are you absolutely sure???\"}}, {\"text\":\"News Entry " + newsPosition + "\", color:gold}, {\"text\":\" deletion?\", color:gray}]}"); + UtilServer.getServer().dispatchCommand(UtilServer.getServer().getConsoleSender(), "tellraw " + caller.getName() + " {\"text\":\"" + Plugin.getName() + "> \", color:blue, \"extra\":[{\"text\":\"[CONFIRM] \", color:green, \"clickEvent\":{\"action\":\"run_command\",\"value\":\"/news delete " + newsPosition + "\"}, \"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Are you absolutely sure???\"}}, {\"text\":\"News Entry " + newsPosition + "\", color:gold}, {\"text\":\" deletion?\", color:gray}]}"); return; } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java index 039de916f..0c5e600ed 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java @@ -23,7 +23,7 @@ public class NewsDeleteCommand extends CommandBase { if (args == null || args.length == 0 || args.length > 1) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else @@ -36,7 +36,7 @@ public class NewsDeleteCommand extends CommandBase } catch (Exception exception) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "The specified news position is invalid!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "The specified news position is invalid!")); return; } newsMang.DeleteNewsEntry(newsPosition, new Callback() @@ -45,11 +45,11 @@ public class NewsDeleteCommand extends CommandBase { if (success) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cGray + "The news entry at position " + C.cGold + newsPosition + C.cGray + " has been deleted!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "The news entry at position " + C.cGold + newsPosition + C.cGray + " has been deleted!")); } else { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "There was an error deleting the news entry; likely the specified news position was invalid!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "There was an error deleting the news entry; likely the specified news position was invalid!")); } } }); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java index cc53857ab..e3ca7c240 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java @@ -29,7 +29,7 @@ public class NewsListCommand extends CommandBase { final NewsManager newsMang = Plugin.GetNewsManager(); - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cGray + "Current server news messages:")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "Current server news messages:")); newsMang.RetriveNewsEntries(new Callback>() { @@ -49,7 +49,7 @@ public class NewsListCommand extends CommandBase for (int i = 0; i < newsStrings.length; i++) { - UtilServer.getServer().dispatchCommand(UtilServer.getServer().getConsoleSender(), "tellraw " + caller.getName() + " {\"text\":\"" + Plugin.GetName() + "> \", color:blue, \"extra\":[{\"text\":\"[DELETE] \", color:red, \"clickEvent\":{\"action\":\"run_command\",\"value\":\"/news ¢¤₦₣¡₨₥ " + (i + 1) + "\"}, \"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Deletes News Entry " + (i + 1) + " : " + newsStrings[i] + "\"}}, {\"text\":\"News " + (i + 1) + "\", color:gold}, {\"text\":\" : \", color:gray}, {\"text\":\"" + newsStrings[i] + "\", color:white}]}"); + UtilServer.getServer().dispatchCommand(UtilServer.getServer().getConsoleSender(), "tellraw " + caller.getName() + " {\"text\":\"" + Plugin.getName() + "> \", color:blue, \"extra\":[{\"text\":\"[DELETE] \", color:red, \"clickEvent\":{\"action\":\"run_command\",\"value\":\"/news ¢¤₦₣¡₨₥ " + (i + 1) + "\"}, \"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Deletes News Entry " + (i + 1) + " : " + newsStrings[i] + "\"}}, {\"text\":\"News " + (i + 1) + "\", color:gold}, {\"text\":\" : \", color:gray}, {\"text\":\"" + newsStrings[i] + "\", color:white}]}"); } } }); @@ -59,7 +59,7 @@ public class NewsListCommand extends CommandBase } else { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java index ea34f8cd5..d91e346f8 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java @@ -23,7 +23,7 @@ public class NewsSetCommand extends CommandBase { if (args == null || args.length < 2 || args.length > 128) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "Your arguments are inappropriate for this command!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); return; } else @@ -41,7 +41,7 @@ public class NewsSetCommand extends CommandBase // Check for 256 character length for MySQL! if (newsEntry.length() > 256) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "The specified news entry is too long [> 256 characters]!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "The specified news entry is too long [> 256 characters]!")); return; } @@ -51,7 +51,7 @@ public class NewsSetCommand extends CommandBase } catch (Exception exception) { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "The specified news position is invalid!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "The specified news position is invalid!")); return; } newsMang.SetNewsEntry(newsEntry, newsPosition, new Callback() @@ -67,11 +67,11 @@ public class NewsSetCommand extends CommandBase } newsEntry = newsEntry.substring(0, newsEntry.length() - 1); - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cGray + "The news entry at position " + C.cGold + newsPosition + C.cGray + " has been updated to: " + C.cGold + newsEntry + C.cGray + "!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "The news entry at position " + C.cGold + newsPosition + C.cGray + " has been updated to: " + C.cGold + newsEntry + C.cGray + "!")); } else { - UtilPlayer.message(caller, F.main(Plugin.GetName(), C.cRed + "There was an error updating the news entry; likely the specified news position was invalid!")); + UtilPlayer.message(caller, F.main(Plugin.getName(), C.cRed + "There was an error updating the news entry; likely the specified news position was invalid!")); } } }); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java index 0cac2bf42..1917dbb95 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java @@ -39,7 +39,7 @@ public class AdminMountManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new HorseSpawn(this)); + addCommand(new HorseSpawn(this)); } @EventHandler diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/party/PartyManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/party/PartyManager.java index eeaeed546..2b4e0ec0d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/party/PartyManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/party/PartyManager.java @@ -36,7 +36,7 @@ public class PartyManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new PartyCommand(this)); + addCommand(new PartyCommand(this)); } public CoreClientManager GetClients() diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java index 6aaa8c18e..a52e8b6f7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java @@ -220,6 +220,6 @@ public class PollManager extends MiniClientPlugin @Override public void AddCommands() { - AddCommand(new PollCommand(this)); + addCommand(new PollCommand(this)); } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index efa24c2d7..005ada843 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -539,33 +539,33 @@ public class ServerManager extends MiniPlugin public void ListServerNpcs(Player caller) { - UtilPlayer.message(caller, F.main(GetName(), "Listing Server Npcs:")); + UtilPlayer.message(caller, F.main(getName(), "Listing Server Npcs:")); for (String serverNpc : _serverKeyInfoMap.keySet()) { - UtilPlayer.message(caller, F.main(GetName(), C.cYellow + serverNpc)); + UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc)); } } public void ListServers(Player caller, String serverNpcName) { - UtilPlayer.message(caller, F.main(GetName(), "Listing Servers for '" + serverNpcName + "':")); + UtilPlayer.message(caller, F.main(getName(), "Listing Servers for '" + serverNpcName + "':")); for (ServerInfo serverNpc : _serverKeyInfoMap.get(serverNpcName)) { - UtilPlayer.message(caller, F.main(GetName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + serverNpc.MOTD + " " + serverNpc.CurrentPlayers + "/" + serverNpc.MaxPlayers)); + UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + serverNpc.MOTD + " " + serverNpc.CurrentPlayers + "/" + serverNpc.MaxPlayers)); } } public void ListOfflineServers(Player caller) { - UtilPlayer.message(caller, F.main(GetName(), "Listing Offline Servers:")); + UtilPlayer.message(caller, F.main(getName(), "Listing Offline Servers:")); for (ServerInfo serverNpc : _serverInfoMap.values()) { if (serverNpc.MOTD.equalsIgnoreCase(ChatColor.DARK_RED + "OFFLINE")) { - UtilPlayer.message(caller, F.main(GetName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + F.time(UtilTime.convertString(System.currentTimeMillis() - _serverUpdate.get(serverNpc.Name), 0, TimeUnit.FIT)))); + UtilPlayer.message(caller, F.main(getName(), C.cYellow + serverNpc.Name + C.cWhite + " - " + F.time(UtilTime.convertString(System.currentTimeMillis() - _serverUpdate.get(serverNpc.Name), 0, TimeUnit.FIT)))); } } } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java index ef5fd3b0e..d8492b753 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java @@ -580,6 +580,6 @@ public class CombatManager extends MiniPlugin } } - player.sendMessage(F.main(GetName(), nameBuilder.toString())); + player.sendMessage(F.main(getName(), nameBuilder.toString())); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/CreatePasswordCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/CreatePasswordCommand.java new file mode 100644 index 000000000..19f3086ad --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/CreatePasswordCommand.java @@ -0,0 +1,24 @@ +package mineplex.staffServer.password; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; + +public class CreatePasswordCommand extends CommandBase +{ + public CreatePasswordCommand(Password plugin) + { + super(plugin, Rank.ADMIN, "createpassword"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args != null && args.length == 1) + { + resetCommandCharge(caller); + Plugin.createPassword(caller, args[0]); + } + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordRepository.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordRepository.java new file mode 100644 index 000000000..796bde45d --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordRepository.java @@ -0,0 +1,76 @@ +package mineplex.staffServer.password; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.database.RepositoryBase; +import mineplex.core.database.ResultSetCallable; +import mineplex.core.database.column.ColumnVarChar; + +public class PasswordRepository extends RepositoryBase +{ + private static String CREATE_SERVER_PASSWORD_TABLE = "CREATE TABLE IF NOT EXISTS serverPassword (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), password VARCHAR(100), PRIMARY KEY (id));"; + private static String RETRIEVE_SERVER_PASSWORD = "SELECT password FROM serverPassword WHERE server = ?;"; + private static String CREATE_SERVER_PASSWORD = "INSERT INTO serverPassword (server, password) VALUES(?, ?);"; + private static String UPDATE_SERVER_PASSWORD = "UPDATE serverPassword SET password = ? WHERE server = ?;"; + private static String REMOVE_SERVER_PASSWORD = "DELETE FROM serverPassword WHERE server = ?;"; + + private String _serverName; + + public PasswordRepository(JavaPlugin plugin, String serverName) + { + super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh"); + + _serverName = serverName; + } + + @Override + protected void initialize() + { + executeUpdate(CREATE_SERVER_PASSWORD_TABLE); + } + + @Override + protected void update() + { + } + + public String retrievePassword() + { + final List passwords = new ArrayList(); + + executeQuery(RETRIEVE_SERVER_PASSWORD, new ResultSetCallable() + { + @Override + public void processResultSet(ResultSet resultSet) throws SQLException + { + while (resultSet.next()) + { + passwords.add(resultSet.getString(1)); + } + } + + }, new ColumnVarChar("serverName", 100, _serverName)); + + return passwords.size() > 0 ? passwords.get(0) : null; + } + + public void updatePassword(String password) + { + executeUpdate(UPDATE_SERVER_PASSWORD, new ColumnVarChar("password", 100, password), new ColumnVarChar("serverName", 100, _serverName)); + } + + public void removePassword() + { + executeUpdate(REMOVE_SERVER_PASSWORD, new ColumnVarChar("serverName", 100, _serverName)); + } + + public void createPassword(String password) + { + executeUpdate(CREATE_SERVER_PASSWORD, new ColumnVarChar("serverName", 100, _serverName), new ColumnVarChar("password", 100, password)); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/RemovePasswordCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/RemovePasswordCommand.java new file mode 100644 index 000000000..029489189 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/RemovePasswordCommand.java @@ -0,0 +1,21 @@ +package mineplex.staffServer.password; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; + +public class RemovePasswordCommand extends CommandBase +{ + public RemovePasswordCommand(Password plugin) + { + super(plugin, Rank.ADMIN, "removepassword"); + } + + @Override + public void Execute(Player caller, String[] args) + { + resetCommandCharge(caller); + Plugin.removePassword(caller); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/KitsCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/KitsCommand.java new file mode 100644 index 000000000..e6f771976 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/KitsCommand.java @@ -0,0 +1,28 @@ +package mineplex.staffServer.salespackage.command; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.staffServer.salespackage.SalesPackageManager; + +public class KitsCommand extends CommandBase +{ + public KitsCommand(SalesPackageManager plugin) + { + super(plugin, Rank.MODERATOR, "kits"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args == null || args.length != 1) + return; + + String playerName = args[0]; + + Plugin.getDonationManager().applyKits(playerName); + caller.sendMessage(F.main(Plugin.getName(), "Unlocked kits for " + playerName + "'s account!")); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/ApplyKits.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/ApplyKits.java new file mode 100644 index 000000000..7591036b6 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/ApplyKits.java @@ -0,0 +1,20 @@ +package mineplex.staffServer.salespackage.salespackages; + +import mineplex.staffServer.salespackage.SalesPackageManager; + +import org.bukkit.entity.Player; + +public class ApplyKits extends SalesPackageBase +{ + public ApplyKits(SalesPackageManager manager) + { + super(manager, "Apply Kits"); + } + + public void displayToAgent(Player agent, String playerName) + { + addButton(agent, "/sales kits " + playerName, "Apply Kit Unlocks."); + agent.sendMessage(" "); + addBackButton(agent, playerName); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index a052d4d6e..add6d903a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -278,9 +278,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation @Override public void AddCommands() { - AddCommand(new GameCommand(this)); - AddCommand(new WriteCommand(this)); - AddCommand(new YoutubeCommand(this)); + addCommand(new GameCommand(this)); + addCommand(new WriteCommand(this)); + addCommand(new YoutubeCommand(this)); } public GameServerConfig GetServerConfig() diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/BenefitManager.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/BenefitManager.java index b5ecfe685..e7da3c657 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/BenefitManager.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/BenefitManager.java @@ -60,7 +60,7 @@ public class BenefitManager extends MiniPlugin for (BenefitItem item : _itemMap.values()) { BenefitItemToken itemToken = new BenefitItemToken(); - itemToken.Name = item.GetName(); + itemToken.Name = item.getName(); itemToken.Material = item.GetDisplayMaterial().toString(); itemToken.SalesPackage = new GameSalesPackageToken(); @@ -78,11 +78,11 @@ public class BenefitManager extends MiniPlugin private void AddBenefitItem(BenefitItem benefitItem, boolean addToOwnerList) { - _itemMap.put(benefitItem.GetName(), benefitItem); + _itemMap.put(benefitItem.getName(), benefitItem); if (addToOwnerList) { - _itemPlayerMap.put(benefitItem.GetName(), new ArrayList()); + _itemPlayerMap.put(benefitItem.getName(), new ArrayList()); } } diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/Items/EnergizedPickaxe.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/Items/EnergizedPickaxe.java index 42ded9e14..37b1d2a1d 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/Items/EnergizedPickaxe.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/Items/EnergizedPickaxe.java @@ -47,12 +47,12 @@ public class EnergizedPickaxe extends BenefitItem { Player player = event.getPlayer(); - if (event.getItem() != null && event.getItem().getType() == Material.DIAMOND_PICKAXE && Plugin.PlayerOwnsMe(GetName(), player)) + if (event.getItem() != null && event.getItem().getType() == Material.DIAMOND_PICKAXE && Plugin.PlayerOwnsMe(getName(), player)) { if ((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) && !_active.contains(player.getName())) { _active.add(player.getName()); - player.sendMessage(F.main(GetName(), GetName() + " activated.")); + player.sendMessage(F.main(getName(), getName() + " activated.")); return; } } @@ -105,10 +105,10 @@ public class EnergizedPickaxe extends BenefitItem if (_active.contains(player.getName())) { - if (!_energy.use(player, Plugin.GetName(), 12, true, false)) + if (!_energy.use(player, Plugin.getName(), 12, true, false)) { _active.remove(player.getName()); - player.sendMessage(F.main(GetName(), GetName() + " deactivated.")); + player.sendMessage(F.main(getName(), getName() + " deactivated.")); event.setCancelled(true); return; } @@ -133,6 +133,6 @@ public class EnergizedPickaxe extends BenefitItem private void Deactivate(Player player) { _active.remove(player.getName()); - player.sendMessage(F.main(GetName(), GetName() + " deactivated.")); + player.sendMessage(F.main(getName(), getName() + " deactivated.")); } } diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/UI/BenefitShopPage.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/UI/BenefitShopPage.java index 6cb92700b..852df53b2 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/UI/BenefitShopPage.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Benefit/UI/BenefitShopPage.java @@ -76,7 +76,7 @@ public class BenefitShopPage extends ShopPageBase itemLore.addAll(Arrays.asList(item.GetDescription())); ShopItem shopItem = new ShopItem(item.GetDisplayMaterial(), - (byte) 0, item.GetName(), + (byte) 0, item.getName(), itemLore.toArray(new String[itemLore.size()]), 1, locked, false); diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Gameplay.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Gameplay.java index e46ca4254..6d9daa43a 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Gameplay.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/Gameplay.java @@ -692,10 +692,10 @@ public class Gameplay extends AModule if (log.GetKiller() != null) { //Inform - UtilPlayer.message(UtilPlayer.searchExact(log.GetKiller().GetName()), F.main("Death", "You stole " + F.count((lose) + " Coins") + " from " + F.name(player.getName()) + ".")); + UtilPlayer.message(UtilPlayer.searchExact(log.GetKiller().getName()), F.main("Death", "You stole " + F.count((lose) + " Coins") + " from " + F.name(player.getName()) + ".")); //Inform - UtilPlayer.message(player, F.main("Death", "You lost " + F.count((lose) + " Coins") + " to " + F.name(log.GetKiller().GetName()) + ".")); + UtilPlayer.message(player, F.main("Death", "You lost " + F.count((lose) + " Coins") + " to " + F.name(log.GetKiller().getName()) + ".")); } else { diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java index c9fc24ce3..b31a40ae0 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java @@ -63,9 +63,9 @@ public class ShopManager extends MiniPlugin @Override public void commands() { - AddCommand("bank"); - AddCommand("coins"); - AddCommand("balance"); + addCommand("bank"); + addCommand("coins"); + addCommand("balance"); } @Override diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/Clans.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/Clans.java index 71cf94390..b50ebab14 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/Clans.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/Clans.java @@ -65,12 +65,12 @@ public class Clans extends AModule implements IRelation, IChat, INameColorer private boolean _powerEnabled = false; //Clans - private HashMap _clanMap = new HashMap(); - private HashMap _clanMemberMap = new HashMap(); - private HashMap _claimMap = new HashMap(); - private HashMap _unclaimMap = new HashMap(); + private HashMap _clanMap = new HashMap(); + private HashMap _clanMemberMap = new HashMap(); + private HashMap _claimMap = new HashMap(); + private HashMap _unclaimMap = new HashMap(); - private HashMap _clanOutpostMap = new HashMap(); + private HashMap _clanOutpostMap = new HashMap(); //Clans Modules private ClansAdmin _clansAdmin; diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansGame.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansGame.java index 17fbea6f2..c0df1767a 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansGame.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansGame.java @@ -263,7 +263,7 @@ public class ClansGame } else { - ClansClan killerClan = Clans.CUtil().getClanByPlayer(event.GetLog().GetKiller().GetName()); + ClansClan killerClan = Clans.CUtil().getClanByPlayer(event.GetLog().GetKiller().getName()); if (killerClan == null) return; diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansTask.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansTask.java index ecf37d936..2c001d27d 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansTask.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/clans/ClansTask.java @@ -60,7 +60,7 @@ public class ClansTask Clans.CUtil().updateRelations(cur); //Log - Clans.Log("Deleted [" + clan.GetName() + "]."); + Clans.log("Deleted [" + clan.GetName() + "]."); } public ClansClan create(String creator, String name, boolean admin) @@ -91,7 +91,7 @@ public class ClansTask Clans.CUtil().updateRelations(creator); //Log - Clans.Log("[" + clan.GetName() + "] with Admin [" + admin + "] created by [" + creator + "]."); + Clans.log("[" + clan.GetName() + "] with Admin [" + admin + "] created by [" + creator + "]."); return clan; } @@ -121,7 +121,7 @@ public class ClansTask Clans.CUtil().updateRelations(player); //Log - Clans.Log("Added [" + player + "] to [" + clan.GetName() + "]."); + Clans.log("Added [" + player + "] to [" + clan.GetName() + "]."); } public void leave(ClansClan clan, String player) @@ -145,7 +145,7 @@ public class ClansTask Clans.CUtil().updateRelations(player); //Log - Clans.Log("Removed [" + player + "] from [" + clan.GetName() + "]."); + Clans.log("Removed [" + player + "] from [" + clan.GetName() + "]."); } public void role(ClansClan clan, String player, Role role) @@ -157,7 +157,7 @@ public class ClansTask Clans.CRepo().EditClan(clan.GetToken()); //Log - Clans.Log("Removed [" + player + "] from [" + clan.GetName() + "]."); + Clans.log("Removed [" + player + "] from [" + clan.GetName() + "]."); } public void invite(ClansClan clan, String player, String inviter) @@ -166,7 +166,7 @@ public class ClansTask clan.GetInviterMap().put(player, inviter); //Log - Clans.Log("Invited [" + player + "] to [" + clan.GetName() + "] by [" + inviter + "]."); + Clans.log("Invited [" + player + "] to [" + clan.GetName() + "] by [" + inviter + "]."); } public void requestAlly(ClansClan clan, ClansClan target, String player) @@ -174,7 +174,7 @@ public class ClansTask clan.GetRequestMap().put(target.GetName(), System.currentTimeMillis()); //Log - Clans.Log("Alliance Request to [" + target.GetName() + "] from [" + clan.GetName() + "] by [" + player + "]."); + Clans.log("Alliance Request to [" + target.GetName() + "] from [" + clan.GetName() + "] by [" + player + "]."); } public void ally(ClansClan cA, ClansClan cB, String player) @@ -200,7 +200,7 @@ public class ClansTask Clans.CUtil().updateRelations(cur); //Log - Clans.Log("Added Ally for [" + cB.GetName() + "] and [" + cA.GetName() + "] by [" + player + "]."); + Clans.log("Added Ally for [" + cB.GetName() + "] and [" + cA.GetName() + "] by [" + player + "]."); } public boolean trust(ClansClan cA, ClansClan cB, String player) @@ -226,7 +226,7 @@ public class ClansTask Clans.CUtil().updateRelations(cur); //Log - Clans.Log("Gave Trust [" + trust + "] to [" + cB.GetName() + "] for [" + cA.GetName() + "] by [" + player + "]."); + Clans.log("Gave Trust [" + trust + "] to [" + cB.GetName() + "] for [" + cA.GetName() + "] by [" + player + "]."); return trust; } @@ -259,7 +259,7 @@ public class ClansTask Clans.CUtil().updateRelations(cur); //Log - Clans.Log("Added Neutral between [" + cA.GetName() + "] and [" + cB.GetName() + "] by [" + player + "]."); + Clans.log("Added Neutral between [" + cA.GetName() + "] and [" + cB.GetName() + "] by [" + player + "]."); } public void enemy(ClansWar war, String player) @@ -279,7 +279,7 @@ public class ClansTask Clans.CUtil().updateRelations(cur); //Log - Clans.Log("Added Invasion between [" + war.GetClanA().GetName() + "] and [" + war.GetClanB().GetName() + "] by [" + player + "]."); + Clans.log("Added Invasion between [" + war.GetClanA().GetName() + "] and [" + war.GetClanB().GetName() + "] by [" + player + "]."); } @@ -318,7 +318,7 @@ public class ClansTask } //Log - Clans.Log("Added Claim for [" + name + "] at [" + chunk + "] by [" + player + "]."); + Clans.log("Added Claim for [" + name + "] at [" + chunk + "] by [" + player + "]."); return true; } @@ -329,7 +329,7 @@ public class ClansTask if (claim == null) { - Clans.Log("Unclaiming NULL Chunk Failed."); + Clans.log("Unclaiming NULL Chunk Failed."); return false; } @@ -337,7 +337,7 @@ public class ClansTask if (clan == null) { - Clans.Log("Unclaiming from NULL Clan Failed."); + Clans.log("Unclaiming from NULL Clan Failed."); return false; } @@ -351,7 +351,7 @@ public class ClansTask Clans.GetUnclaimMap().put(chunk, System.currentTimeMillis()); //Log - Clans.Log("Removed Claim for [" + clan.GetName() + "] at [" + chunk + "] by [" + player + "]."); + Clans.log("Removed Claim for [" + clan.GetName() + "] at [" + chunk + "] by [" + player + "]."); return true; } @@ -365,7 +365,7 @@ public class ClansTask Clans.CRepo().EditClan(clan.GetToken()); //Log - Clans.Log("Set Home for [" + clan.GetName() + "] to " + UtilWorld.locToStrClean(loc) + " by [" + player + "]."); + Clans.log("Set Home for [" + clan.GetName() + "] to " + UtilWorld.locToStrClean(loc) + " by [" + player + "]."); } public void safe(ClansTerritory claim, String player) @@ -377,7 +377,7 @@ public class ClansTask Clans.CRepo().EditClan(Clans.getClan(claim.getOwner()).GetToken()); //Log - Clans.Log("Safe Zone at [" + claim.chunk + "] set to [" + claim.safe + "] by [" + player + "]."); + Clans.log("Safe Zone at [" + claim.chunk + "] set to [" + claim.safe + "] by [" + player + "]."); } public void pillage(ClansClan cA, ClansClan cB, boolean start) diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerReset.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerReset.java index 17f0eaccc..014e37412 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerReset.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerReset.java @@ -17,7 +17,7 @@ public class ServerReset extends MiniPlugin public void AddCommands() { - AddCommand(new ServerResetCommand(this)); + addCommand(new ServerResetCommand(this)); } public ServerResetRepository GetRepository() diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerResetCommand.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerResetCommand.java index 71a7268f4..8356e8fd6 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerResetCommand.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/serverreset/ServerResetCommand.java @@ -22,8 +22,8 @@ public class ServerResetCommand extends CommandBase public void Execute(Player caller, String[] args) { ClearEconomy(); - System.out.println(F.main(Plugin.GetName(), caller.getName() + " cleared Economy.")); - caller.sendMessage(F.main(Plugin.GetName(), "Cleared Economy.")); + System.out.println(F.main(Plugin.getName(), caller.getName() + " cleared Economy.")); + caller.sendMessage(F.main(Plugin.getName(), "Cleared Economy.")); ClearNpcs(); } diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java index 536968000..ee0a35eff 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java @@ -43,7 +43,7 @@ public class EventManager extends MiniPlugin @Override public void AddCommands() { - AddCommand(new EventCommand(this)); + addCommand(new EventCommand(this)); } @EventHandler