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