Skip to content

Commit c672948

Browse files
committed
Merge 1.20 into 1.20.2
2 parents d8263c5 + 3fb3bb3 commit c672948

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/bugfix/chunk_deadlock/ServerChunkCacheMixin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ private void bailIfServerDead(int chunkX, int chunkZ, ChunkStatus requiredStatus
5555
}
5656
if(debugDeadServerAccess)
5757
ModernFix.LOGGER.warn("Async loading of a chunk was requested, this might not be desirable", new Exception());
58-
else
59-
ModernFix.LOGGER.warn("Suspicious async chunkload, pass -Dmodernfix.debugBadChunkloading=true for more details");
6058
try {
6159
resultingChunk = future.get(10, TimeUnit.SECONDS);
6260
if(resultingChunk.left().isPresent()) {

forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/dynamic_resources/ModelBakerImplMixin.java

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
44
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
55
import net.minecraft.client.resources.model.*;
6-
import net.minecraft.core.registries.BuiltInRegistries;
76
import net.minecraft.resources.ResourceLocation;
8-
import net.minecraft.world.level.block.Block;
9-
import net.minecraft.world.level.block.state.BlockState;
10-
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
117
import org.embeddedt.modernfix.ModernFix;
128
import org.embeddedt.modernfix.ModernFixClient;
139
import org.embeddedt.modernfix.api.entrypoint.ModernFixClientIntegration;
@@ -20,10 +16,6 @@
2016
import org.spongepowered.asm.mixin.injection.Inject;
2117
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2218

23-
import java.lang.invoke.MethodHandle;
24-
import java.lang.invoke.MethodHandles;
25-
import java.util.Objects;
26-
import java.util.Optional;
2719
import java.util.function.Function;
2820

2921
@Mixin(value = ModelBakery.ModelBakerImpl.class, priority = 600)
@@ -35,17 +27,6 @@ public abstract class ModelBakerImplMixin implements IModelBakerImpl {
3527

3628
@Shadow @Final private Function<Material, TextureAtlasSprite> modelTextureGetter;
3729

38-
private static final MethodHandle blockStateLoaderHandle;
39-
static {
40-
try {
41-
blockStateLoaderHandle = MethodHandles.lookup().unreflect(
42-
ObfuscationReflectionHelper.findMethod(ModelBakery.class, "m_119263_", BlockState.class)
43-
);
44-
} catch(ReflectiveOperationException e) {
45-
throw new RuntimeException(e);
46-
}
47-
}
48-
4930
@Override
5031
public void mfix$ignoreCache() {
5132
mfix$ignoreCache = true;
@@ -69,20 +50,7 @@ private void obtainModel(ResourceLocation arg, CallbackInfoReturnable<UnbakedMod
6950
if(arg instanceof ModelResourceLocation && arg != ModelBakery.MISSING_MODEL_LOCATION) {
7051
// synchronized because we use topLevelModels
7152
synchronized (this.field_40571) {
72-
/* to emulate vanilla model loading, treat as top-level */
73-
Optional<Block> blockOpt = Objects.equals(((ModelResourceLocation)arg).getVariant(), "inventory") ? Optional.empty() : BuiltInRegistries.BLOCK.getOptional(new ResourceLocation(arg.getNamespace(), arg.getPath()));
74-
if(blockOpt.isPresent()) {
75-
/* load via lambda for mods that expect blockstate to get loaded */
76-
for(BlockState state : extendedBakery.getBlockStatesForMRL(blockOpt.get().getStateDefinition(), (ModelResourceLocation)arg)) {
77-
try {
78-
blockStateLoaderHandle.invokeExact(this.field_40571, state);
79-
} catch(Throwable e) {
80-
ModernFix.LOGGER.error("Error loading model", e);
81-
}
82-
}
83-
} else {
84-
this.field_40571.loadTopLevel((ModelResourceLocation)arg);
85-
}
53+
this.field_40571.loadTopLevel((ModelResourceLocation)arg);
8654
cir.setReturnValue(this.field_40571.topLevelModels.getOrDefault(arg, extendedBakery.mfix$getUnbakedMissingModel()));
8755
// avoid leaks
8856
this.field_40571.topLevelModels.clear();

0 commit comments

Comments
 (0)