1.13 gen perms

This commit is contained in:
Brianna O'Keefe 2019-02-17 09:24:19 -05:00
parent 9a990a7d03
commit 6e3dae4a3a

View File

@ -413,20 +413,22 @@ public class Block implements Listener {
if (!LocationUtil.isLocationAtLocationRadius(all.getLocation(),
island.getLocation(world, IslandEnvironment.Island), island.getRadius())) continue;
int i = generatorManager.getGeneratorStorage().size() - 1;
Generator generator = generatorManager.getGeneratorStorage().get(i);
List<Generator> generators = new ArrayList<>(generatorManager.getGenerators());
Collections.reverse(generators);
for (Generator generator : generators) {
if (generator.isPermission()) {
if (!all.hasPermission(generator.getPermission())
&& !all.hasPermission("fabledskyblock.generator.*")
&& !all.hasPermission("fabledskyblock.*")) {
continue;
if (generator.isPermission()) {
if (!all.hasPermission(generator.getPermission())
&& !all.hasPermission("fabledskyblock.generator.*")
&& !all.hasPermission("fabledskyblock.*")) {
continue;
}
}
}
event.setCancelled(true);
generatorManager.generateBlock(generator, block);
return;
event.setCancelled(true);
generatorManager.generateBlock(generator, block);
return;
}
}
}
}