Update clans to new preferences. Remove debug messages.
This commit is contained in:
parent
bbe44e7d75
commit
c9d14dc522
@ -17,10 +17,8 @@ import mineplex.core.stats.StatsManager;
|
||||
import mineplex.core.status.ServerStatusManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -54,8 +52,6 @@ public class TreasureManager extends MiniPlugin
|
||||
|
||||
World world = Bukkit.getWorlds().get(0);
|
||||
|
||||
System.out.println("Treausre Manager Setting the fuck up biotches");
|
||||
|
||||
_treasureLocations = new ArrayList<>();
|
||||
{
|
||||
Block chestBlock = world.getBlockAt(-31, 73, -11);
|
||||
@ -87,39 +83,23 @@ public class TreasureManager extends MiniPlugin
|
||||
|
||||
for (TreasureLocation treasureLocation : _treasureLocations)
|
||||
{
|
||||
System.out.println(treasureLocation.toString());
|
||||
_plugin.getServer().getPluginManager().registerEvents(treasureLocation, _plugin);
|
||||
}
|
||||
}
|
||||
|
||||
private Block[] setup(Block chestBlock)
|
||||
{
|
||||
System.out.println("Setting up blocks for " + chestBlock.getX() + ", " + chestBlock.getY() + ", " + chestBlock.getZ());
|
||||
List<Location> locations = Lists.newArrayList();
|
||||
boolean has = false;
|
||||
for(int x = chestBlock.getX() -3; x <= chestBlock.getX(); x++)
|
||||
{
|
||||
for(int z = chestBlock.getZ() - 3; z <= chestBlock.getZ(); z++)
|
||||
{
|
||||
Location location = new Location(chestBlock.getWorld(), x, chestBlock.getY(), z);
|
||||
if(location.getBlock().getRelative(BlockFace.DOWN) == null || location.getBlock().getRelative(BlockFace.DOWN).getType() != Material.SMOOTH_BRICK)
|
||||
{
|
||||
has = false;
|
||||
continue;
|
||||
}
|
||||
if(has)
|
||||
{
|
||||
has = false;
|
||||
continue;
|
||||
} else
|
||||
{
|
||||
has = true;
|
||||
}
|
||||
locations.add(location);
|
||||
}
|
||||
}
|
||||
List<Location> locations = Lists.newArrayList(new Location(chestBlock.getWorld(), chestBlock.getX() + 3, chestBlock.getY(), chestBlock.getZ() - 1),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() + 3, chestBlock.getY(), chestBlock.getZ() + 1),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() - 3, chestBlock.getY(), chestBlock.getZ() - 1),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() - 3, chestBlock.getY(), chestBlock.getZ() + 1),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() - 1, chestBlock.getY(), chestBlock.getZ() + 3),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() + 1, chestBlock.getY(), chestBlock.getZ() - 3),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() + 1, chestBlock.getY(), chestBlock.getZ() + 3),
|
||||
new Location(chestBlock.getWorld(), chestBlock.getX() - 1, chestBlock.getY(), chestBlock.getZ() - 3));
|
||||
|
||||
Block[] blocks = new Block[locations.size()];
|
||||
for(int i = 0; i < blocks.length; i++)
|
||||
for (int i = 0; i < blocks.length; i++)
|
||||
{
|
||||
blocks[i] = locations.get(i).getBlock();
|
||||
}
|
||||
@ -141,7 +121,7 @@ public class TreasureManager extends MiniPlugin
|
||||
{
|
||||
_statsManager.incrementStat(player, "Global.Treasure." + treasureType.getStatName(), 1);
|
||||
}
|
||||
|
||||
|
||||
public void addTreasureLocation(TreasureLocation loc)
|
||||
{
|
||||
_treasureLocations.add(loc);
|
||||
@ -152,7 +132,7 @@ public class TreasureManager extends MiniPlugin
|
||||
{
|
||||
return _rewardManager.getRewards(player, pool, rewardType);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasItemsToGivePlayer(RewardPool.Type pool, Player player)
|
||||
{
|
||||
return _rewardManager.hasItemsToGivePlayer(pool, player);
|
||||
@ -165,10 +145,14 @@ public class TreasureManager extends MiniPlugin
|
||||
Treasure treasure = treasureLocation.getCurrentTreasure();
|
||||
|
||||
if (treasure == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (treasure.getPlayer().equals(player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1,28 +1,20 @@
|
||||
package mineplex.game.clans;
|
||||
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.antihack.AntiHackGuardian;
|
||||
import mineplex.core.creature.Creature;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.CustomTagFix;
|
||||
import mineplex.core.FoodDupeFix;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.antihack.AntiHackGuardian;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.chat.Chat;
|
||||
import mineplex.core.command.CommandCenter;
|
||||
import mineplex.core.common.MinecraftVersion;
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.events.ServerShutdownEvent;
|
||||
import mineplex.core.creature.Creature;
|
||||
import mineplex.core.delayedtask.DelayedTask;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.explosion.Explosion;
|
||||
@ -61,6 +53,12 @@ import mineplex.game.clans.shop.pvp.PvpShop;
|
||||
import mineplex.game.clans.spawn.travel.TravelShop;
|
||||
import mineplex.game.clans.world.WorldManager;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import static mineplex.core.Managers.require;
|
||||
|
||||
@ -109,7 +107,7 @@ public class Clans extends JavaPlugin
|
||||
|
||||
PacketHandler packetHandler = require(PacketHandler.class);
|
||||
IncognitoManager incognito = new IncognitoManager(this, _clientManager, packetHandler);
|
||||
PreferencesManager preferenceManager = new PreferencesManager(this, incognito, _clientManager, _donationManager);
|
||||
PreferencesManager preferenceManager = new PreferencesManager(this, incognito, _clientManager);
|
||||
|
||||
incognito.setPreferencesManager(preferenceManager);
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
package mineplex.game.clans.clans;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.preferences.Preference;
|
||||
import mineplex.core.preferences.PreferencesManager;
|
||||
import mineplex.game.clans.clans.event.ClanTipEvent;
|
||||
import mineplex.game.clans.clans.event.PlayerClaimTerritoryEvent;
|
||||
import mineplex.game.clans.clans.event.PlayerEnterTerritoryEvent;
|
||||
import mineplex.game.clans.clans.event.PlayerUnClaimTerritoryEvent;
|
||||
import net.minecraft.server.v1_8_R3.EnumDirection;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class ClanTips extends MiniPlugin
|
||||
{
|
||||
@ -44,7 +44,7 @@ public class ClanTips extends MiniPlugin
|
||||
final Player player = event.getPlayer();
|
||||
final String newTerritory = event.getNewTerritory();
|
||||
|
||||
if (_preferences.Get(player).ClanTips)
|
||||
if (_preferences.get(player).isActive(Preference.CLAN_TIPS))
|
||||
{
|
||||
if (newTerritory.equals("Fields"))
|
||||
{
|
||||
@ -113,7 +113,7 @@ public class ClanTips extends MiniPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_preferences.Get(player).ClanTips && !tip._ignorePreferences)
|
||||
if (!_preferences.get(player).isActive(Preference.CLAN_TIPS) && !tip._ignorePreferences)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package mineplex.clanshub;
|
||||
|
||||
import mineplex.core.CustomTagFix;
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.PacketsInteractionFix;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
@ -37,7 +36,6 @@ import mineplex.core.poll.PollManager;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.preferences.PreferencesManager;
|
||||
import mineplex.core.profileCache.ProfileCacheManager;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
import mineplex.core.punish.Punish;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.resourcepack.ResourcePackManager;
|
||||
@ -55,7 +53,6 @@ import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -104,7 +101,7 @@ public class ClansHub extends JavaPlugin
|
||||
PacketHandler packetHandler = require(PacketHandler.class);
|
||||
DisguiseManager disguiseManager = require(DisguiseManager.class);
|
||||
IncognitoManager incognito = new IncognitoManager(this, clientManager, packetHandler);
|
||||
PreferencesManager preferenceManager = new PreferencesManager(this, incognito, clientManager, donationManager);
|
||||
PreferencesManager preferenceManager = new PreferencesManager(this, incognito, clientManager);
|
||||
|
||||
incognito.setPreferencesManager(preferenceManager);
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
package mineplex.clanshub;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.F;
|
||||
@ -10,16 +8,18 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.preferences.Preference;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Manager for player forcefields
|
||||
*/
|
||||
@ -44,7 +44,7 @@ public class ForcefieldManager extends MiniPlugin
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (Manager.getPreferences().Get(player).HubForcefield && (Manager.GetClients().Get(player).GetRank().has(Rank.ADMIN) || Manager.GetClients().Get(player).GetRank() == Rank.JNR_DEV || Manager.GetClients().Get(player).GetRank() == Rank.YOUTUBE || Manager.GetClients().Get(player).GetRank() == Rank.TWITCH || Manager.GetClients().Get(player).GetRank() == Rank.YOUTUBE_SMALL))
|
||||
if (Manager.getPreferences().get(player).isActive(Preference.FORCE_FIELD) && (Manager.GetClients().Get(player).GetRank().has(Rank.ADMIN) || Manager.GetClients().Get(player).GetRank() == Rank.JNR_DEV || Manager.GetClients().Get(player).GetRank() == Rank.YOUTUBE || Manager.GetClients().Get(player).GetRank() == Rank.TWITCH || Manager.GetClients().Get(player).GetRank() == Rank.YOUTUBE_SMALL))
|
||||
{
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
|
@ -1,19 +1,19 @@
|
||||
package mineplex.clanshub;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.preferences.Preference;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Manager for Hub Visibility of players
|
||||
*/
|
||||
@ -65,7 +65,7 @@ public class HubVisibilityManager extends MiniPlugin
|
||||
{
|
||||
Rank rank = Manager.GetClients().Get(player).GetRank();
|
||||
boolean hideMe = UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 ||
|
||||
(Manager.getPreferences().Get(player).Invisibility && (rank.has(Rank.MODERATOR) || rank == Rank.YOUTUBE || rank == Rank.TWITCH)) ||
|
||||
(Manager.getPreferences().get(player).isActive(Preference.INVISIBILITY) && (rank.has(Rank.MODERATOR) || rank == Rank.YOUTUBE || rank == Rank.TWITCH)) ||
|
||||
_hiddenPlayers.contains(player);
|
||||
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
@ -77,7 +77,7 @@ public class HubVisibilityManager extends MiniPlugin
|
||||
if (Manager.GetClients().Get(other).GetRank().has(Rank.MODERATOR))
|
||||
localHideMe = false;
|
||||
|
||||
if (localHideMe || !Manager.getPreferences().Get(other).ShowPlayers)
|
||||
if (localHideMe || !Manager.getPreferences().get(other).isActive(Preference.SHOW_PLAYERS))
|
||||
{
|
||||
VisibilityManager.Instance.setVisibility(player, false, other);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class ButtonPrefs implements GuiItem
|
||||
@Override
|
||||
public void click(ClickType clickType)
|
||||
{
|
||||
_profile.getPrefManager().openShop(_player);
|
||||
_profile.getPrefManager().openMenu(_player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user