mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-02-18 20:31:41 +01:00
Fix memory leak
This commit is contained in:
parent
f4a7eaac7a
commit
efde51034d
@ -116,6 +116,7 @@ public class UltimateStacker extends SongodaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onPluginEnable() {
|
public void onPluginEnable() {
|
||||||
// Run Songoda Updater
|
// Run Songoda Updater
|
||||||
|
Async.start();
|
||||||
SongodaCore.registerPlugin(this, 16, CompatibleMaterial.IRON_INGOT);
|
SongodaCore.registerPlugin(this, 16, CompatibleMaterial.IRON_INGOT);
|
||||||
// Setup Config
|
// Setup Config
|
||||||
Settings.setupConfig();
|
Settings.setupConfig();
|
||||||
|
@ -130,9 +130,9 @@ public class EntityStack extends ColdEntityStack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
|
plugin.getEntityStackManager().removeStack(event.getEntity());
|
||||||
if (killed.getKiller() == null) return;
|
if (killed.getKiller() == null) return;
|
||||||
plugin.addExp(killed.getKiller(), this);
|
plugin.addExp(killed.getKiller(), this);
|
||||||
plugin.getEntityStackManager().removeStack(event.getEntity());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleSingleStackDeath(LivingEntity killed, List<Drop> drops, int droppedExp, EntityDeathEvent event) {
|
private void handleSingleStackDeath(LivingEntity killed, List<Drop> drops, int droppedExp, EntityDeathEvent event) {
|
||||||
|
@ -5,7 +5,11 @@ import java.util.concurrent.Executors;
|
|||||||
|
|
||||||
public class Async {
|
public class Async {
|
||||||
|
|
||||||
private static ExecutorService executor = Executors.newFixedThreadPool(10);
|
private static ExecutorService executor;
|
||||||
|
|
||||||
|
public static void start() {
|
||||||
|
executor = Executors.newFixedThreadPool(5);
|
||||||
|
}
|
||||||
|
|
||||||
public static void run(Runnable runnable) {
|
public static void run(Runnable runnable) {
|
||||||
executor.execute(runnable);
|
executor.execute(runnable);
|
||||||
|
Loading…
Reference in New Issue
Block a user