Don't check block type twice

This also prevents it from getting it multiple types which would result in a chunk data query too...
This commit is contained in:
Phoenix616 2023-03-01 18:03:34 +01:00
parent 4de1f1e8c5
commit 7d92cb820d
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
1 changed files with 2 additions and 4 deletions

View File

@ -66,10 +66,6 @@ public class BlockPlace implements Listener {
public static void onHopperDropperPlace(BlockPlaceEvent event) {
Block placed = event.getBlockPlaced();
if (placed.getType() != Material.HOPPER && placed.getType() != Material.DROPPER) {
return;
}
List<BlockFace> searchDirections = new ArrayList<>();
switch (placed.getType()) {
case HOPPER:
@ -79,6 +75,8 @@ public class BlockPlace implements Listener {
case DROPPER:
searchDirections.add(((Directional) placed.getBlockData()).getFacing());
break;
default:
return;
}
for (BlockFace face : searchDirections) {