fix strange issue when exiting and entering the same world
This commit is contained in:
parent
aca487f97e
commit
c0bc7b5ecd
@ -39,6 +39,7 @@ import baritone.api.event.events.*;
|
|||||||
import baritone.api.event.events.type.EventState;
|
import baritone.api.event.events.type.EventState;
|
||||||
import baritone.api.event.listener.IGameEventListener;
|
import baritone.api.event.listener.IGameEventListener;
|
||||||
import baritone.chunk.WorldProvider;
|
import baritone.chunk.WorldProvider;
|
||||||
|
import baritone.utils.BlockStateInterface;
|
||||||
import baritone.utils.Helper;
|
import baritone.utils.Helper;
|
||||||
import baritone.utils.InputOverrideHandler;
|
import baritone.utils.InputOverrideHandler;
|
||||||
import baritone.utils.interfaces.Toggleable;
|
import baritone.utils.interfaces.Toggleable;
|
||||||
@ -133,6 +134,8 @@ public final class GameEventHandler implements IGameEventListener, Helper {
|
|||||||
public final void onWorldEvent(WorldEvent event) {
|
public final void onWorldEvent(WorldEvent event) {
|
||||||
WorldProvider cache = WorldProvider.INSTANCE;
|
WorldProvider cache = WorldProvider.INSTANCE;
|
||||||
|
|
||||||
|
BlockStateInterface.clearCachedChunk();
|
||||||
|
|
||||||
switch (event.getState()) {
|
switch (event.getState()) {
|
||||||
case PRE:
|
case PRE:
|
||||||
break;
|
break;
|
||||||
|
@ -66,6 +66,10 @@ public class BlockStateInterface implements Helper {
|
|||||||
return Blocks.AIR.getDefaultState();
|
return Blocks.AIR.getDefaultState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearCachedChunk() {
|
||||||
|
prev = null;
|
||||||
|
}
|
||||||
|
|
||||||
public static Block getBlock(BlockPos pos) {
|
public static Block getBlock(BlockPos pos) {
|
||||||
return get(pos).getBlock();
|
return get(pos).getBlock();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user