Only schedule the updater task once

This commit is contained in:
Dan Mulloy 2018-06-10 11:53:59 -04:00 committed by Alexander Meech
parent 51443ebd46
commit f8fce22d06
10 changed files with 18 additions and 25 deletions

View File

@ -9,18 +9,9 @@ public abstract class DisguiseHuman extends DisguiseLiving
{ {
super(disguiseType, entity); super(disguiseType, entity);
byte skin = 0; DataWatcher.a(10, (byte) 127, EntityHuman.META_SKIN, (byte) 127);
skin |= (1 << 0); //Enable Cape
skin |= (1 << 1); //Enable Jacket
skin |= (1 << 2); //Enable Left Sleeve
skin |= (1 << 3); //Enable Right Sleeve
skin |= (1 << 4); //Enable Left Pants
skin |= (1 << 5); //Enable Right Pants
skin |= (1 << 6); //Enable Hat
DataWatcher.a(10, (byte) skin, EntityHuman.META_SKIN, (byte) skin);
DataWatcher.a(16, (byte) 1, EntityHuman.META_CAPE, (byte) 1); DataWatcher.a(16, (byte) 1, EntityHuman.META_CAPE, (byte) 1);
DataWatcher.a(17, Float.valueOf(0.0F), EntityHuman.META_SCALED_HEALTH, 0f); DataWatcher.a(17, 0F, EntityHuman.META_SCALED_HEALTH, 0F);
DataWatcher.a(18, Integer.valueOf(0), EntityHuman.META_SCORE, 0); DataWatcher.a(18, 0, EntityHuman.META_SCORE, 0);
} }
} }

View File

@ -1,16 +1,18 @@
package mineplex.core.updater; package mineplex.core.updater;
import mineplex.core.MiniPlugin;
import mineplex.core.ReflectivelyCreateMiniPlugin;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class Updater implements Runnable @ReflectivelyCreateMiniPlugin
public class Updater extends MiniPlugin implements Runnable
{ {
private JavaPlugin _plugin; private Updater()
{
super("Updater Task");
public Updater(JavaPlugin plugin)
{
_plugin = plugin;
_plugin.getServer().getScheduler().scheduleSyncRepeatingTask(_plugin, this, 0L, 1L); _plugin.getServer().getScheduler().scheduleSyncRepeatingTask(_plugin, this, 0L, 1L);
} }

View File

@ -31,7 +31,7 @@ public class EnjinTranslator extends JavaPlugin
//Main Modules //Main Modules
new Enjin(this, clientManager, donationManager, new InventoryManager(this, clientManager)); new Enjin(this, clientManager, donationManager, new InventoryManager(this, clientManager));
new Updater(this); require(Updater.class);
} }
public String GetWebServerAddress() public String GetWebServerAddress()

View File

@ -208,7 +208,7 @@ public class Clans extends JavaPlugin
} }
//Updates //Updates
new Updater(this); require(Updater.class);
MinecraftServer.getServer().getPropertyManager().setProperty("debug", false); MinecraftServer.getServer().getPropertyManager().setProperty("debug", false);
SpigotConfig.debug = false; SpigotConfig.debug = false;

View File

@ -176,7 +176,7 @@ public class ClansHub extends JavaPlugin
Teleport teleport = new Teleport(this, clientManager); Teleport teleport = new Teleport(this, clientManager);
//Updates //Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); require(Updater.class);
require(TrackManager.class); require(TrackManager.class);
require(Titles.class); require(Titles.class);

View File

@ -198,7 +198,7 @@ public class Hub extends JavaPlugin implements IRelation
new VelocityFix(this); new VelocityFix(this);
//Updates //Updates
new Updater(this); require(Updater.class);
require(Titles.class); require(Titles.class);
require(TwoFactorAuth.class); require(TwoFactorAuth.class);

View File

@ -84,7 +84,7 @@ public class StaffServer extends JavaPlugin
new CustomerSupport(this, clientManager, donationManager, powerPlayRepo, inventoryManager, bonusRepository); new CustomerSupport(this, clientManager, donationManager, powerPlayRepo, inventoryManager, bonusRepository);
//Updates //Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); require(Updater.class);
MinecraftServer.getServer().getPropertyManager().setProperty("debug", false); MinecraftServer.getServer().getPropertyManager().setProperty("debug", false);
SpigotConfig.debug = false; SpigotConfig.debug = false;

View File

@ -231,7 +231,7 @@ public class Arcade extends JavaPlugin
require(SoundNotifier.class); require(SoundNotifier.class);
//Updates //Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); require(Updater.class);
MinecraftServer.getServer().getPropertyManager().setProperty("debug", false); MinecraftServer.getServer().getPropertyManager().setProperty("debug", false);
SpigotConfig.debug = false; SpigotConfig.debug = false;

View File

@ -147,7 +147,7 @@ public class Hub extends JavaPlugin
new SimpleChatManager(this, _clientManager, achievementManager); new SimpleChatManager(this, _clientManager, achievementManager);
// Updates // Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); require(Updater.class);
MinecraftServer.getServer().getPropertyManager().setProperty("debug", false); MinecraftServer.getServer().getPropertyManager().setProperty("debug", false);
SpigotConfig.debug = false; SpigotConfig.debug = false;

View File

@ -298,7 +298,7 @@ public class GemHunters extends JavaPlugin
new Leaderboards(); new Leaderboards();
// UpdateEvent!!! // UpdateEvent!!!
new Updater(this); require(Updater.class);
// Disable spigot's item merging // Disable spigot's item merging
for (World world : getServer().getWorlds()) for (World world : getServer().getWorlds())