Add beta whitelist to GemHunters and remove missing debug references

This commit is contained in:
cnr 2017-02-23 23:48:24 -06:00
parent fb70c93f91
commit eed784da04
11 changed files with 25 additions and 32 deletions

View File

@ -12,7 +12,6 @@ import com.google.common.collect.ImmutableSet;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.bonuses.BonusManager;
import mineplex.core.common.Rank;
import mineplex.core.powerplayclub.PowerPlayClubRepository;
@ -44,11 +43,11 @@ public class BetaWhitelist extends MiniPlugin
private final CoreClientManager _clientManager;
private final PowerPlayClubRepository _powerPlayClubRepository;
public BetaWhitelist(BonusManager manager)
public BetaWhitelist(CoreClientManager clientManager, PowerPlayClubRepository powerPlayRepository)
{
super("Beta Whitelist");
_clientManager = manager.getClientManager();
_powerPlayClubRepository = manager.getPowerPlayClubRepository();
_clientManager = clientManager;
_powerPlayClubRepository = powerPlayRepository;
}
@EventHandler

View File

@ -1,6 +1,6 @@
package mineplex.gemhunters;
import static mineplex.core.Managers.require;
import net.minecraft.server.v1_8_R3.MinecraftServer;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
@ -12,6 +12,7 @@ import mineplex.core.FoodDupeFix;
import mineplex.core.TimingsFix;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.beta.BetaWhitelist;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.boosters.BoosterManager;
import mineplex.core.chat.Chat;
@ -44,6 +45,7 @@ import mineplex.core.packethandler.PacketHandler;
import mineplex.core.party.PartyManager;
import mineplex.core.pet.PetManager;
import mineplex.core.portal.Portal;
import mineplex.core.powerplayclub.PowerPlayClubRepository;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.projectile.ProjectileManager;
import mineplex.core.punish.Punish;
@ -61,7 +63,6 @@ import mineplex.gemhunters.bounties.BountyModule;
import mineplex.gemhunters.chat.ChatModule;
import mineplex.gemhunters.death.DeathModule;
import mineplex.gemhunters.death.npc.NPCManager;
import mineplex.gemhunters.debug.DebugModule;
import mineplex.gemhunters.economy.CashOutModule;
import mineplex.gemhunters.economy.EconomyModule;
import mineplex.gemhunters.loot.InventoryModule;
@ -81,7 +82,8 @@ import mineplex.gemhunters.worldevent.WorldEventModule;
import mineplex.minecraft.game.core.combat.CombatManager;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.DamageManager;
import net.minecraft.server.v1_8_R3.MinecraftServer;
import static mineplex.core.Managers.require;
/**
* Gem Hunters main class <br>
@ -245,7 +247,7 @@ public class GemHunters extends JavaPlugin
// Though if any other module needs one of these it will be generated in
// order, however they are all here just for good measure.s
require(BetaModule.class);
require(DebugModule.class);
//require(DebugModule.class);
require(BountyModule.class);
require(CashOutModule.class);
require(ChatModule.class);
@ -284,6 +286,9 @@ public class GemHunters extends JavaPlugin
// Turn off the server's debugging
MinecraftServer.getServer().getPropertyManager().setProperty("debug", false);
SpigotConfig.debug = false;
// beta whitelist
new BetaWhitelist(clientManager, new PowerPlayClubRepository(this, clientManager, donationManager));
}
@Override

View File

@ -23,7 +23,6 @@ import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.gemhunters.death.event.PlayerCustomRespawnEvent;
import mineplex.gemhunters.debug.DebugModule;
@ReflectivelyCreateMiniPlugin
public class InventoryModule extends MiniPlugin
@ -119,9 +118,9 @@ public class InventoryModule extends MiniPlugin
int end = Math.min(inv.getSize(), start + slots);
int delta = end - start;
DebugModule.getInstance().d("start=" + start);
DebugModule.getInstance().d("end=" + end);
DebugModule.getInstance().d("delta=" + delta);
//DebugModule.getInstance().d("start=" + start);
//DebugModule.getInstance().d("end=" + end);
//DebugModule.getInstance().d("delta=" + delta);
for (int i = start; i < end; i++)
{

View File

@ -35,11 +35,9 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.google.GoogleSheetsManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.gemhunters.debug.DebugModule;
import mineplex.gemhunters.economy.EconomyModule;
import mineplex.gemhunters.economy.PlayerCashOutCompleteEvent;
import mineplex.gemhunters.loot.command.SpawnChestCommand;
@ -321,7 +319,7 @@ public class LootModule extends MiniPlugin
return;
}
DebugModule.getInstance().d("Spawned at " + UtilWorld.blockToStrClean(block) + " with key=" + key + " and index=" + index + " and max=" + spawned + "/" + max);
//DebugModule.getInstance().d("Spawned at " + UtilWorld.blockToStrClean(block) + " with key=" + key + " and index=" + index + " and max=" + spawned + "/" + max);
_spawnedChest.add(new SpawnedChest(chestToPlace, properties, index));
block.setType(properties.getBlockMaterial());
}

View File

@ -5,7 +5,6 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.Managers;
import mineplex.core.common.util.Callback;
import mineplex.core.inventory.InventoryManager;
import mineplex.gemhunters.debug.DebugModule;
public class LootChestReward extends LootItemReward
{
@ -39,7 +38,7 @@ public class LootChestReward extends LootItemReward
@Override
public void run(Boolean success)
{
DebugModule.getInstance().d("Success= " + success);
//DebugModule.getInstance().d("Success= " + success);
}
}, _player, _chestName + " Chest", _amount);
}

View File

@ -6,7 +6,6 @@ import mineplex.core.Managers;
import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.donation.DonationManager;
import mineplex.core.donation.Donor;
import mineplex.gemhunters.debug.DebugModule;
public class LootGadgetReward extends LootItemReward
{
@ -36,12 +35,12 @@ public class LootGadgetReward extends LootItemReward
if (donor.ownsUnknownSalesPackage(_gadget))
{
DebugModule.getInstance().d("Shard duplicate");
//DebugModule.getInstance().d("Shard duplicate");
donor.addBalance(GlobalCurrency.TREASURE_SHARD, (int) (500 + Math.random() * 1000));
}
else
{
DebugModule.getInstance().d("Adding gadget");
//DebugModule.getInstance().d("Adding gadget");
donor.addOwnedUnknownSalesPackage(_gadget);
}
}

View File

@ -10,7 +10,6 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.gemhunters.debug.DebugModule;
public abstract class LootItemReward
{
@ -69,7 +68,7 @@ public abstract class LootItemReward
public final void success()
{
DebugModule.getInstance().d("Success");
//DebugModule.getInstance().d("Success");
onSuccessful();
}

View File

@ -4,7 +4,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.F;
import mineplex.gemhunters.debug.DebugModule;
import mineplex.gemhunters.loot.event.PlayerChestOpenEvent;
import mineplex.gemhunters.quest.Quest;
@ -35,7 +34,7 @@ public class ChestOpenerQuest extends Quest
@EventHandler
public void chestOpen(PlayerChestOpenEvent event)
{
DebugModule.getInstance().d(event.getEventName());
//DebugModule.getInstance().d(event.getEventName());
Player player = event.getPlayer();
if (!isActive(player))

View File

@ -17,12 +17,10 @@ import mineplex.core.ReflectivelyCreateMiniPlugin;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.google.GoogleSheetsManager;
import mineplex.core.google.SheetObjectDeserialiser;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.gemhunters.debug.DebugModule;
import mineplex.gemhunters.loot.deserialisers.LootItemDeserialiser;
import mineplex.gemhunters.safezone.SafezoneModule;
import mineplex.gemhunters.shop.deserialisers.VillagerPropertiesDeserialiser;
@ -220,7 +218,7 @@ public class ShopModule extends MiniPlugin
usedIndexes.add(index);
DebugModule.getInstance().d("Trader at " + UtilWorld.locToStrClean(randomLocation) + " with key=" + key + " and index=" + index + " and max=" + spawned + "/" + max);
//DebugModule.getInstance().d("Trader at " + UtilWorld.locToStrClean(randomLocation) + " with key=" + key + " and index=" + index + " and max=" + spawned + "/" + max);
_npcs.add(new TraderNPC(_plugin, randomLocation, Villager.class, NAMES[UtilMath.r(NAMES.length)], _safezone.isInSafeZone(randomLocation), properties, getRandomItemSet(_trades.get(key))));
}
}

View File

@ -22,7 +22,6 @@ import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.gemhunters.debug.DebugModule;
public class UndergroundMobs implements Listener
{
@ -67,7 +66,7 @@ public class UndergroundMobs implements Listener
}
}
DebugModule.getInstance().d("Spawning mobs " + _entities.size());
//DebugModule.getInstance().d("Spawning mobs " + _entities.size());
for (int i = 0; i < 10; i++)
{

View File

@ -34,7 +34,6 @@ import org.bukkit.inventory.BrewerInventory;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.UtilWorld;
import mineplex.gemhunters.debug.DebugModule;
public class WorldListeners implements Listener
{
@ -173,7 +172,7 @@ public class WorldListeners implements Listener
{
Player player = (Player) event.getEntity();
DebugModule.getInstance().d(player.getName() + " hunger " + player.getFoodLevel() + " -> " + event.getFoodLevel());
//DebugModule.getInstance().d(player.getName() + " hunger " + player.getFoodLevel() + " -> " + event.getFoodLevel());
// Some witchcraft from the arcade, seems to make hunger not ridiculous.
player.setSaturation(3.8F);
}
@ -183,7 +182,7 @@ public class WorldListeners implements Listener
{
if (event.toWeatherState())
{
DebugModule.getInstance().d("Cancelling a weather change");
//DebugModule.getInstance().d("Cancelling a weather change");
event.setCancelled(true);
event.getWorld().setStorm(false);
}