mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Fix EntityWiper not registering dropped items (#76)
* Fix EntityWiper not registering dropped items * Remove unused import
This commit is contained in:
parent
553767454d
commit
7a45734baf
@ -6,6 +6,8 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Getter;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -32,12 +34,15 @@ import org.bukkit.entity.EnderPearl;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class EntityWiper extends FreedomService
|
||||
{
|
||||
|
||||
@Getter
|
||||
private boolean enabled;
|
||||
public static final long ENTITY_WIPE_RATE = 5 * 20L;
|
||||
public static final long ITEM_DESPAWN_RATE = 20L * 20L;
|
||||
public static final int CHUNK_ENTITY_MAX = 20;
|
||||
@ -196,4 +201,13 @@ public class EntityWiper extends FreedomService
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDrop(PlayerDropItemEvent event)
|
||||
{
|
||||
enabled = ConfigEntry.AUTO_ENTITY_WIPE.getBoolean();
|
||||
if (enabled)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user