Skip to content

Commit 95ffcb3

Browse files
committed
Merge remote-tracking branch 'origin/1.21.1' into 1.21.4
2 parents 717d2f6 + 960c394 commit 95ffcb3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/compact_bit_storage/PalettedContainerMixin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ private void validateData(FriendlyByteBuf buffer, CallbackInfo ci, int i) {
3030
}
3131
}
3232
if(empty && storArray.length > 0) {
33+
T value;
3334
/* it means the chunk is oversized and wasting memory, take the ID out of the palette and recreate a smaller chunk */
34-
T value = this.data.palette().valueFor(0);
35+
try {
36+
value = this.data.palette().valueFor(0);
37+
} catch (RuntimeException e) {
38+
// Some mods/servers seem to generate buggy palettes. This is not our fault (the game will likely crash later),
39+
// but we catch it here to avoid receiving bug reports for an issue we didn't cause.
40+
return;
41+
}
3542
this.data = this.createOrReuseData(null, 0);
3643
this.data.palette().idFor(value);
3744
}

common/src/main/java/org/embeddedt/modernfix/duck/IExtendedModelBakery.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
import net.minecraft.client.resources.model.ModelResourceLocation;
44
import net.minecraft.client.resources.model.UnbakedModel;
55

6+
import java.util.concurrent.locks.ReentrantLock;
7+
68
public interface IExtendedModelBakery {
79
void mfix$tick();
810
void mfix$finishLoading();
911
UnbakedModel mfix$loadUnbakedModelDynamic(ModelResourceLocation location);
1012
UnbakedModel mfix$getMissingModel();
13+
ReentrantLock mfix$getLock();
1114
}

0 commit comments

Comments
 (0)