mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-08 07:36:42 +02:00
Fix startup errors
This commit is contained in:
@@ -12,6 +12,8 @@ public interface IPlugin extends Plugin {
|
|||||||
|
|
||||||
int scheduleSyncDelayedTask(final Runnable run);
|
int scheduleSyncDelayedTask(final Runnable run);
|
||||||
|
|
||||||
|
int scheduleAsyncDelayedTask(final Runnable run, final long delay);
|
||||||
|
|
||||||
int scheduleSyncDelayedTask(final Runnable run, final long delay);
|
int scheduleSyncDelayedTask(final Runnable run, final long delay);
|
||||||
|
|
||||||
int scheduleSyncRepeatingTask(final Runnable run, final long delay, final long period);
|
int scheduleSyncRepeatingTask(final Runnable run, final long delay, final long period);
|
||||||
|
@@ -129,6 +129,12 @@ public class BukkitPlugin extends JavaPlugin implements IPlugin
|
|||||||
return getServer().getScheduler().scheduleSyncDelayedTask(this, run);
|
return getServer().getScheduler().scheduleSyncDelayedTask(this, run);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int scheduleAsyncDelayedTask(final Runnable run, final long delay)
|
||||||
|
{
|
||||||
|
return getServer().getScheduler().scheduleAsyncDelayedTask(this, run, delay);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int scheduleSyncDelayedTask(final Runnable run, final long delay)
|
public int scheduleSyncDelayedTask(final Runnable run, final long delay)
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,11 @@
|
|||||||
package net.ess3.metrics;
|
package net.ess3.metrics;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import lombok.Cleanup;
|
||||||
import net.ess3.api.IEssentials;
|
import net.ess3.api.IEssentials;
|
||||||
|
import net.ess3.api.ISettings;
|
||||||
|
import net.ess3.api.IUser;
|
||||||
|
import net.ess3.permissions.Permissions;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@@ -24,14 +29,18 @@ public class MetricsListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||||
{
|
{
|
||||||
/*final IUser player = ess.getUserMap().getUser(event.getPlayer());
|
final IUser player = ess.getUserMap().getUser(event.getPlayer());
|
||||||
if (ess.getSettings().isMetricsEnabled() == false && (player.isAuthorized("essentials.essentials") || player.isAuthorized("bukkit.broadcast.admin")))
|
@Cleanup
|
||||||
|
ISettings settings = ess.getSettings();
|
||||||
|
settings.acquireReadLock();
|
||||||
|
if (settings.getData().getGeneral().getMetricsEnabled() == null && (Permissions.ESSENTIALS.isAuthorized(event.getPlayer()) || event.getPlayer().hasPermission("bukkit.broadcast.admin")))
|
||||||
{
|
{
|
||||||
player.sendMessage("PluginMetrics collects minimal statistic data, starting in about 5 minutes.");
|
player.sendMessage("PluginMetrics collects minimal statistic data, starting in about 5 minutes.");
|
||||||
player.sendMessage("To opt out, run /essentials opt-out");
|
player.sendMessage("To opt out, run /essentials opt-out");
|
||||||
ess.getLogger().log(Level.INFO, "[Metrics] Admin join - Starting 5 minute opt-out period.");
|
ess.getLogger().log(Level.INFO, "[Metrics] Admin join - Starting 5 minute opt-out period.");
|
||||||
ess.getSettings().setMetricsEnabled(true);
|
settings.acquireWriteLock();
|
||||||
ess.getScheduler().scheduleAsyncDelayedTask(ess, starter, 5 * 1200);
|
settings.getData().getGeneral().setMetricsEnabled(true);
|
||||||
}*/
|
ess.getPlugin().scheduleAsyncDelayedTask(starter, 5 * 1200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -43,11 +43,11 @@ public class MetricsStarter implements Runnable
|
|||||||
settings.acquireReadLock();
|
settings.acquireReadLock();
|
||||||
if (!metrics.isOptOut())
|
if (!metrics.isOptOut())
|
||||||
{
|
{
|
||||||
if (settings.getData().getGeneral().isMetricsEnabled())
|
if (settings.getData().getGeneral().getMetricsEnabled() == true)
|
||||||
{
|
{
|
||||||
start = true;
|
start = true;
|
||||||
}
|
}
|
||||||
else
|
else if (settings.getData().getGeneral().getMetricsEnabled() == null)
|
||||||
{
|
{
|
||||||
ess.getLogger().info("This plugin collects minimal statistic data and sends it to http://metrics.essentials3.net.");
|
ess.getLogger().info("This plugin collects minimal statistic data and sends it to http://metrics.essentials3.net.");
|
||||||
ess.getLogger().info("You can opt out by running /essentials opt-out");
|
ess.getLogger().info("You can opt out by running /essentials opt-out");
|
||||||
|
@@ -25,6 +25,7 @@ public enum Permissions implements IPermission
|
|||||||
DELHOME_OTHERS,
|
DELHOME_OTHERS,
|
||||||
ECO_LOAN(PermissionDefault.FALSE),
|
ECO_LOAN(PermissionDefault.FALSE),
|
||||||
ENDERCHEST_OTHERS,
|
ENDERCHEST_OTHERS,
|
||||||
|
ESSENTIALS,
|
||||||
EXP_GIVE,
|
EXP_GIVE,
|
||||||
EXP_GIVE_OTHERS,
|
EXP_GIVE_OTHERS,
|
||||||
EXP_SET,
|
EXP_SET,
|
||||||
|
@@ -77,5 +77,5 @@ public class General implements StorageObject
|
|||||||
{
|
{
|
||||||
return loginAttackDelay * 1000;
|
return loginAttackDelay * 1000;
|
||||||
}
|
}
|
||||||
public boolean metricsEnabled = true;
|
public Boolean metricsEnabled = null;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name: Essentials
|
name: Essentials
|
||||||
main: net.ess3.Essentials
|
main: com.earth2me.essentials.Essentials
|
||||||
version: 2.9
|
version: 2.9
|
||||||
website: http://tiny.cc/EssentialsWiki
|
website: http://tiny.cc/EssentialsWiki
|
||||||
description: Compatibility plugin for older plugins
|
description: Compatibility plugin for older plugins
|
||||||
|
@@ -167,6 +167,9 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
LOGGER.log(Level.SEVERE, _("geoIpUrlEmpty"));
|
LOGGER.log(Level.SEVERE, _("geoIpUrlEmpty"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!databaseFile.getAbsoluteFile().getParentFile().exists()) {
|
||||||
|
databaseFile.getAbsoluteFile().getParentFile().mkdirs();
|
||||||
|
}
|
||||||
InputStream input = null;
|
InputStream input = null;
|
||||||
OutputStream output = null;
|
OutputStream output = null;
|
||||||
try
|
try
|
||||||
|
@@ -4,6 +4,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import static net.ess3.I18n._;
|
import static net.ess3.I18n._;
|
||||||
import net.ess3.api.IEssentials;
|
import net.ess3.api.IEssentials;
|
||||||
|
import net.ess3.bukkit.BukkitPlugin;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ public class EssentialsConnect
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
|
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
|
||||||
}
|
}
|
||||||
ess = (IEssentials)essPlugin;
|
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
||||||
protect = (IProtect)essProtect;
|
protect = (IProtect)essProtect;
|
||||||
protect.setSettings(new ProtectHolder(ess));
|
protect.setSettings(new ProtectHolder(ess));
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,6 @@
|
|||||||
<include>jivesoftware:smack</include>
|
<include>jivesoftware:smack</include>
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
<minimizeJar>true</minimizeJar>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
Reference in New Issue
Block a user