Merge remote-tracking branch 'origin/1.16' into 1.18
This commit is contained in:
commit
1a25984e88
|
|
@ -237,6 +237,15 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
|||
pack instanceof FilePackResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a copy of the top-level model list and stream that to avoid CMEs if the getMaterials call triggers a model
|
||||
* load.
|
||||
*/
|
||||
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Ljava/util/Collection;stream()Ljava/util/stream/Stream;", ordinal = 0))
|
||||
private Stream<?> getModelStream(Collection<?> modelCollection) {
|
||||
return new ArrayList<>(modelCollection).stream();
|
||||
}
|
||||
|
||||
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Ljava/util/stream/Stream;collect(Ljava/util/stream/Collector;)Ljava/lang/Object;", ordinal = 0))
|
||||
private Object collectExtraTextures(Stream<Material> instance, Collector<?, ?, ?> arCollector) {
|
||||
Set<Material> materialsSet = new ObjectOpenHashSet<>(instance.collect(Collectors.toSet()));
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ import java.util.*;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/* high priority so that our injectors are added before other mods' */
|
||||
@Mixin(value = ModelBakery.class, priority = 600)
|
||||
|
|
@ -162,6 +163,15 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a copy of the top-level model list and stream that to avoid CMEs if the getMaterials call triggers a model
|
||||
* load.
|
||||
*/
|
||||
@Redirect(method = "processLoading", at = @At(value = "INVOKE", target = "Ljava/util/Collection;stream()Ljava/util/stream/Stream;", ordinal = 0), remap = false)
|
||||
private Stream<?> getModelStream(Collection<?> modelCollection) {
|
||||
return new ArrayList<>(modelCollection).stream();
|
||||
}
|
||||
|
||||
@Redirect(method = "processLoading", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/ForgeHooksClient;gatherFluidTextures(Ljava/util/Set;)V", remap = false), remap = false)
|
||||
private void gatherModelTextures(Set<Material> materialSet) {
|
||||
ForgeHooksClient.gatherFluidTextures(materialSet);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user