Signed-off-by: Etzelia <etzelia@hotmail.com>
bugs
Etzelia 2020-08-01 15:07:44 -05:00
parent e400508e99
commit 71c1c824cf
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
1 changed files with 3 additions and 3 deletions

View File

@ -61,11 +61,11 @@ public class OreAlertListener implements Listener {
@EventHandler @EventHandler
public void onBlockPlace(BlockPlaceEvent event) { public void onBlockPlace(BlockPlaceEvent event) {
this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> {
if (isMaterialTrcked(event.getBlock().getType())) cache.add(event.getBlock().getLocation()); if (isMaterialTracked(event.getBlock().getType())) cache.add(event.getBlock().getLocation());
}); });
} }
private boolean isMaterialTrcked(Material material) { private boolean isMaterialTracked(Material material) {
for (String s: this.plugin.getConfig().getConfigurationSection("ore.blocks").getKeys(false)) { for (String s: this.plugin.getConfig().getConfigurationSection("ore.blocks").getKeys(false)) {
if (Lang.getMaterialKey(material).equals(s)) { if (Lang.getMaterialKey(material).equals(s)) {
return true; return true;
@ -80,7 +80,7 @@ public class OreAlertListener implements Listener {
if (event != null) { if (event != null) {
if (cache.contains(event.getLocation())) continue; if (cache.contains(event.getLocation())) continue;
cache.add(event.getLocation()); cache.add(event.getLocation());
if (isMaterialTrcked(event.getMaterial())) { if (isMaterialTracked(event.getMaterial())) {
addStrike(event); addStrike(event);
if (event.isParent()) { if (event.isParent()) {
check(event); check(event);