Skip to content

Commit

Permalink
Fix crash when players are created with a null world
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jul 24, 2022
1 parent 1e7076a commit 99a8216
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
------------------------------------------------------
Version 0.8.2
------------------------------------------------------
**Fixes**
- Fixed a random crash caused by fake players existing or something

------------------------------------------------------
Version 0.8.1
------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
org.gradle.jvmargs = -Xmx5G

mod_name = Automatone
mod_version = 0.8.1
mod_version = 0.8.2
maven_group = io.github.ladysnake

minecraft_version=1.19
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/baritone/Baritone.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class Baritone implements IBaritone {
private final BaritoneCommandManager commandManager;

private final IEntityContext playerContext;
private final WorldProvider worldProvider;

private final @Nullable ClientPathingBehaviour clientPathingBehaviour;

Expand Down Expand Up @@ -116,7 +115,6 @@ public Baritone(LivingEntity player) {
this.pathingControlManager.registerProcess(farmProcess = new FarmProcess(this));
}

this.worldProvider = (WorldProvider) IWorldProvider.KEY.get(player.world);
this.commandManager = new BaritoneCommandManager(this);
this.execControlProcess = DefaultCommands.controlCommands.registerProcess(this);
this.clientPathingBehaviour = player.world.isClient ? new ClientPathingBehaviour(player) : null;
Expand Down Expand Up @@ -194,7 +192,7 @@ public PathingBehavior getPathingBehavior() {

@Override
public WorldProvider getWorldProvider() {
return this.worldProvider;
return (WorldProvider) IWorldProvider.KEY.get(this.getPlayerContext().world());
}

@Override
Expand Down

0 comments on commit 99a8216

Please sign in to comment.