mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 11:10:04 +01:00
Changed stackableMaterials field to an EnumSet for better performance. Likewise, the getStackableMaterials() method had to have it's return type changed.
This commit is contained in:
parent
a3ee51d1d8
commit
4dfe31db16
@ -141,7 +141,7 @@ public class Interact implements Listener {
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (stackableManager != null
|
||||
&& stackableManager.getStackableMaterials().contains(event.getMaterial())
|
||||
&& stackableManager.isStackableMaterial(event.getMaterial())
|
||||
&& event.getClickedBlock().getType() == event.getMaterial()
|
||||
&& !player.isSneaking() && islandManager.hasPermission(player, block.getLocation(), "Place")
|
||||
&& (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Stackable.RequirePermission") || player.hasPermission("fabledskyblock.stackable"))) {
|
||||
|
@ -15,7 +15,7 @@ public class StackableManager {
|
||||
//ToDO: Should pobably be a GUI for this
|
||||
|
||||
private final SkyBlock skyblock;
|
||||
private List<Material> stackableMaterials = new ArrayList<>();
|
||||
private Set<Material> stackableMaterials = EnumSet.noneOf(Material.class);
|
||||
private Map<Location, Stackable> stacks = new HashMap<>();
|
||||
|
||||
public StackableManager(SkyBlock skyblock) {
|
||||
@ -66,8 +66,8 @@ public class StackableManager {
|
||||
stackableMaterials.clear();
|
||||
}
|
||||
|
||||
public List<Material> getStackableMaterials() {
|
||||
return Collections.unmodifiableList(stackableMaterials);
|
||||
public Set<Material> getStackableMaterials() {
|
||||
return Collections.unmodifiableSet(stackableMaterials);
|
||||
}
|
||||
|
||||
public boolean isStackableMaterial(Material material) {
|
||||
|
Loading…
Reference in New Issue
Block a user