mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
[CI skip] Merge pull request #1175 from AlexLander123/fixes
Fixed NullPointerException when using Pickaxe of the Seeker
This commit is contained in:
commit
b76a7a3e24
@ -27,7 +27,7 @@ public class PickaxeOfTheSeeker extends SimpleSlimefunItem<ItemInteractionHandle
|
|||||||
for (int x = -4; x <= 4; x++) {
|
for (int x = -4; x <= 4; x++) {
|
||||||
for (int y = -4; y <= 4; y++) {
|
for (int y = -4; y <= 4; y++) {
|
||||||
for (int z = -4; z <= 4; z++) {
|
for (int z = -4; z <= 4; z++) {
|
||||||
if (p.getLocation().getBlock().getRelative(x, y, z).getType().toString().endsWith("_ORE") && closest == null || p.getLocation().distance(closest.getLocation()) < p.getLocation().distance(p.getLocation().getBlock().getRelative(x, y, z).getLocation())) {
|
if (p.getLocation().getBlock().getRelative(x, y, z).getType().toString().endsWith("_ORE") && (closest == null || p.getLocation().distanceSquared(closest.getLocation()) > p.getLocation().distanceSquared(p.getLocation().getBlock().getRelative(x, y, z).getLocation()))) {
|
||||||
closest = p.getLocation().getBlock().getRelative(x, y, z);
|
closest = p.getLocation().getBlock().getRelative(x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user