Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Duct tape Bizarre nullpointerexception that shouldn't happen, will ne…
Browse files Browse the repository at this point in the history
…ed to investigate later as this may cause problems elsewhere.
  • Loading branch information
TacoTechnica committed Sep 19, 2021
1 parent 90e16a7 commit 9821925
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/java/adris/altoclef/tasks/DefaultGoToDimensionTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,10 @@ private Task goToNetherFromOverworldTask(AltoClef mod) {
setDebugState("Going to nether portal");
return new EnterNetherPortalTask(Dimension.NETHER);
}
switch (mod.getModSettings().getOverworldToNetherBehaviour()) {
case BUILD_PORTAL_VANILLA:
return new ConstructNetherPortalBucketTask();
case GO_TO_HOME_BASE:
return new GetToBlockTask(mod.getModSettings().getHomeBasePosition());
}
setDebugState("Overworld->Nether Behaviour " + mod.getModSettings().getOverworldToNetherBehaviour() + " is NOT IMPLEMENTED YET!");
return null;
return switch (mod.getModSettings().getOverworldToNetherBehaviour()) {
case BUILD_PORTAL_VANILLA -> new ConstructNetherPortalBucketTask();
case GO_TO_HOME_BASE -> new GetToBlockTask(mod.getModSettings().getHomeBasePosition());
};
}

private Task goToEndTask(AltoClef mod) {
Expand All @@ -133,7 +129,7 @@ private Task goToEndTask(AltoClef mod) {
private boolean netherPortalIsClose(AltoClef mod) {
if (mod.getBlockTracker().anyFound(Blocks.NETHER_PORTAL)) {
BlockPos closest = mod.getBlockTracker().getNearestTracking(mod.getPlayer().getPos(), Blocks.NETHER_PORTAL);
return closest.isWithinDistance(mod.getPlayer().getPos(), 2000);
return closest != null && closest.isWithinDistance(mod.getPlayer().getPos(), 2000);
}
return false;
}
Expand Down

0 comments on commit 9821925

Please sign in to comment.