Merge remote-tracking branch 'origin/1.21.1' into 1.21.4

This commit is contained in:
embeddedt 2025-01-24 22:02:57 -05:00
commit 026f0a56bf
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 11 additions and 1 deletions

View File

@ -30,8 +30,15 @@ public abstract class PalettedContainerMixin<T> {
} }
} }
if(empty && storArray.length > 0) { if(empty && storArray.length > 0) {
T value;
/* it means the chunk is oversized and wasting memory, take the ID out of the palette and recreate a smaller chunk */ /* it means the chunk is oversized and wasting memory, take the ID out of the palette and recreate a smaller chunk */
T value = this.data.palette().valueFor(0); try {
value = this.data.palette().valueFor(0);
} catch (RuntimeException e) {
// Some mods/servers seem to generate buggy palettes. This is not our fault (the game will likely crash later),
// but we catch it here to avoid receiving bug reports for an issue we didn't cause.
return;
}
this.data = this.createOrReuseData(null, 0); this.data = this.createOrReuseData(null, 0);
this.data.palette().idFor(value); this.data.palette().idFor(value);
} }

View File

@ -3,9 +3,12 @@ package org.embeddedt.modernfix.duck;
import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.client.resources.model.UnbakedModel; import net.minecraft.client.resources.model.UnbakedModel;
import java.util.concurrent.locks.ReentrantLock;
public interface IExtendedModelBakery { public interface IExtendedModelBakery {
void mfix$tick(); void mfix$tick();
void mfix$finishLoading(); void mfix$finishLoading();
UnbakedModel mfix$loadUnbakedModelDynamic(ModelResourceLocation location); UnbakedModel mfix$loadUnbakedModelDynamic(ModelResourceLocation location);
UnbakedModel mfix$getMissingModel(); UnbakedModel mfix$getMissingModel();
ReentrantLock mfix$getLock();
} }