Skip to content

Commit

Permalink
Update BlockFormListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli authored Jul 17, 2023
1 parent dc5d571 commit 6effe01
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ public final class BlockFormListener extends Queue implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
protected void onBlockForm(BlockFormEvent event) {
// random form, snow/ice
World world = event.getBlock().getWorld();
BlockState newState = event.getNewState();
Block block = event.getBlock();
String player = Lookup.whoPlacedCache(block);
if (Config.getConfig(world).LIQUID_TRACKING && (newState.getType().equals(Material.OBSIDIAN) || newState.getType().equals(Material.COBBLESTONE) || event.getBlock().getType().name().endsWith("_CONCRETE_POWDER"))) {
World world = block.getWorld();
BlockState newState = event.getNewState();
boolean log = false;
if (Config.getConfig(world).LIQUID_TRACKING && (newState.getType().equals(Material.OBSIDIAN) || newState.getType().equals(Material.COBBLESTONE) || block.getType().name().endsWith("_CONCRETE_POWDER"))) {
String player = Lookup.whoPlacedCache(block);
int wid = Util.getWorldId(world.getName());
if (!(player.length() > 0)) {
int x = block.getX();
Expand Down Expand Up @@ -58,7 +59,7 @@ protected void onBlockForm(BlockFormEvent event) {
}
}
if (player.length() > 0) {
boolean log = true;
log = true;
/*
if (newState.getType().equals(Material.COBBLESTONE)) {
log = false;
Expand All @@ -78,7 +79,7 @@ protected void onBlockForm(BlockFormEvent event) {
}
}
}
if (player.length() == 0 && Config.getConfig(world).UNKNOWN_LOGGING) {
if (!log && Config.getConfig(world).UNKNOWN_LOGGING && Lookup.whoPlacedCache(block).length() == 0){
Queue.queueBlockPlace("#unknown", block.getLocation().getBlock().getState(), block.getType(), block.getState(), newState.getType(), -1, 0, newState.getBlockData().getAsString());
}
}
Expand Down

0 comments on commit 6effe01

Please sign in to comment.