Skip to content

Commit

Permalink
Don't reload all block shape caches on early init (mod compat)
Browse files Browse the repository at this point in the history
Fixed #245
  • Loading branch information
FlorianMichael committed Sep 18, 2023
1 parent fe5cdf2 commit 93bfa6a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ public static void init() {
// Reloads some clientside stuff when the protocol version changes
ChangeProtocolVersionCallback.EVENT.register(protocolVersion -> {
// Reloads all bounding boxes
for (Block block : RELOADABLE_BLOCKS) {
block.getDefaultState().initShapeCache();
if (MinecraftClient.getInstance() != null && MinecraftClient.getInstance().player != null) { // Make sure that the game is loaded when reloading the cache
for (Block block : RELOADABLE_BLOCKS) {
block.getDefaultState().initShapeCache();
}
}

// Calculates the current chat limit, since it changes depending on the protocol version
Expand Down

0 comments on commit 93bfa6a

Please sign in to comment.