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:
parent
4de1f1e8c5
commit
7d92cb820d
|
@ -66,10 +66,6 @@ public class BlockPlace implements Listener {
|
||||||
public static void onHopperDropperPlace(BlockPlaceEvent event) {
|
public static void onHopperDropperPlace(BlockPlaceEvent event) {
|
||||||
Block placed = event.getBlockPlaced();
|
Block placed = event.getBlockPlaced();
|
||||||
|
|
||||||
if (placed.getType() != Material.HOPPER && placed.getType() != Material.DROPPER) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<BlockFace> searchDirections = new ArrayList<>();
|
List<BlockFace> searchDirections = new ArrayList<>();
|
||||||
switch (placed.getType()) {
|
switch (placed.getType()) {
|
||||||
case HOPPER:
|
case HOPPER:
|
||||||
|
@ -79,6 +75,8 @@ public class BlockPlace implements Listener {
|
||||||
case DROPPER:
|
case DROPPER:
|
||||||
searchDirections.add(((Directional) placed.getBlockData()).getFacing());
|
searchDirections.add(((Directional) placed.getBlockData()).getFacing());
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BlockFace face : searchDirections) {
|
for (BlockFace face : searchDirections) {
|
||||||
|
|
Loading…
Reference in New Issue