Merge remote-tracking branch 'origin/1.16' into 1.18
This commit is contained in:
commit
70a2a2194f
|
|
@ -95,6 +95,11 @@ allprojects {
|
|||
url 'https://maven.terraformersmc.com/releases'
|
||||
}
|
||||
}
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-Werror"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure(subprojects.findAll {it.name == "common" || it.name == "forge" || it.name == "fabric"}) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ import org.spongepowered.asm.mixin.Overwrite;
|
|||
@Mixin(Minecraft.class)
|
||||
@ClientOnlyMixin
|
||||
public class MinecraftMixin {
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason avoid exception stacktrace being printed in dev
|
||||
*/
|
||||
@Overwrite
|
||||
private UserApiService createUserApiService(YggdrasilAuthenticationService yggdrasilAuthenticationService, GameConfig arg) {
|
||||
return UserApiService.OFFLINE;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class StateHolderMixin {
|
|||
}
|
||||
});
|
||||
|
||||
@Redirect(method = "codec", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;dispatch(Ljava/lang/String;Ljava/util/function/Function;Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;"))
|
||||
@Redirect(method = "codec", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;dispatch(Ljava/lang/String;Ljava/util/function/Function;Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;", remap = false))
|
||||
private static <O, S extends StateHolder<O, S>> Codec<S> obtainCodec(Codec<O> codec, String typeKey, Function<S, O> type, Function<O, ? extends Codec<S>> codecFn, Codec<O> codecMethodArg, Function<O, S> stateSupplier) {
|
||||
return codec.dispatch(typeKey, type, block -> {
|
||||
if(block instanceof Block) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import java.lang.reflect.Type;
|
|||
public class BlockElementFaceDeserializerMixin {
|
||||
|
||||
@Redirect(method = "deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/client/renderer/block/model/BlockElementFace;",
|
||||
at = @At(value = "INVOKE", target = "Lcom/google/gson/JsonDeserializationContext;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;)Ljava/lang/Object;", ordinal = 0))
|
||||
at = @At(value = "INVOKE", target = "Lcom/google/gson/JsonDeserializationContext;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;)Ljava/lang/Object;", ordinal = 0, remap = false))
|
||||
private Object skipUvsForInitialLoad(JsonDeserializationContext context, JsonElement element, Type type) {
|
||||
return UVController.useDummyUv.get() ? UVController.dummyUv : context.deserialize(element, type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public abstract class ItemModelShaperMixin {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Get the stored location for that item and meta, and get the model
|
||||
* from that location from the model manager.
|
||||
**/
|
||||
|
|
@ -58,6 +59,7 @@ public abstract class ItemModelShaperMixin {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Don't get all models during init (with dynamic loading, that would
|
||||
* generate them all). Just store location instead.
|
||||
**/
|
||||
|
|
@ -67,6 +69,7 @@ public abstract class ItemModelShaperMixin {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Disable cache rebuilding (with dynamic loading, that would generate
|
||||
* all models).
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.function.Function;
|
|||
@RequiresMod("ae2")
|
||||
@ClientOnlyMixin
|
||||
public class RegistrationMixin {
|
||||
@Shadow @Final private static Map<String, Function<BakedModel, BakedModel>> CUSTOMIZERS;
|
||||
@Shadow(remap = false) @Final private static Map<String, Function<BakedModel, BakedModel>> CUSTOMIZERS;
|
||||
|
||||
@Inject(method = "init", at = @At("TAIL"), remap = false)
|
||||
private static void doRegisterDynBake(CallbackInfo ci) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class MappedRegistryMixin {
|
|||
*/
|
||||
@Redirect(
|
||||
method = "registerMapping(ILnet/minecraft/resources/ResourceKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;Z)Lnet/minecraft/core/Holder;",
|
||||
at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/objects/ObjectList;size(I)V")
|
||||
at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/objects/ObjectList;size(I)V", remap = false)
|
||||
)
|
||||
private void setSizeSmart(ObjectList<?> list, int size) {
|
||||
if(list instanceof ObjectArrayList && size > list.size()) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public abstract class BiomeMixin {
|
|||
* @return
|
||||
*/
|
||||
@Overwrite
|
||||
public final float getTemperature(BlockPos pos) {
|
||||
private float getTemperature(BlockPos pos) {
|
||||
return this.getHeightAdjustedTemperature(pos);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.function.BiConsumer;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class DirectStorageBiMap<K, V> implements BiMap<K, V> {
|
||||
private final Function<V, K> keyGetter;
|
||||
private final BiConsumer<V, K> keySetter;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"modernfix.jei_load": "Loading JEI, this may take a while",
|
||||
"modernfix.no_lazydfu": "LazyDFU is not installed. If Minecraft needs to update game data from an older version, there may be noticeable lag.",
|
||||
"modernfix.no_ferritecore": "FerriteCore is not installed. Memory usage will be very high.",
|
||||
"modernfix.connectedness_dynresources": "Connectedness and ModernFix's dynamic resources option are not compatible. Remove Connectedness or disable dynamic resources in the ModernFix config.",
|
||||
"modernfix.connectedness_dynresoruces": "Connectedness and ModernFix's dynamic resources option are not compatible. Remove Connectedness or disable dynamic resources in the ModernFix config.",
|
||||
"modernfix.perf_mod_warning": "It is recommended to install the mods, but the warning(s) can be disabled in the ModernFix config.",
|
||||
"modernfix.config": "ModernFix mixin config",
|
||||
"modernfix.config.done_restart": "Done (restart required)",
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class SuggestionsBuilderMixin {
|
|||
@Unique
|
||||
private static final int MAX_SUGGESTIONS = 10000;
|
||||
|
||||
@Shadow @Final @Mutable
|
||||
@Shadow(remap = false) @Final @Mutable
|
||||
private List<Suggestion> result;
|
||||
|
||||
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"), require = 0)
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ import java.util.Set;
|
|||
public abstract class ModNioResourcePackMixin implements ICachingResourcePack {
|
||||
@Shadow public abstract Set<String> getNamespaces(PackType type);
|
||||
|
||||
@Shadow @Final private List<Path> basePaths;
|
||||
@Shadow @Final private ModMetadata modInfo;
|
||||
@Shadow(remap = false) @Final private List<Path> basePaths;
|
||||
@Shadow(remap = false) @Final private ModMetadata modInfo;
|
||||
private PackResourcesCacheEngine cacheEngine;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
@Mixin(ObjectModificationManager.class)
|
||||
@RequiresMod("blueprint")
|
||||
public abstract class ObjectModificationManagerMixin extends SimpleJsonResourceReloadListener {
|
||||
@Shadow protected SelectionSpace selectionSpace;
|
||||
@Shadow(remap = false) protected SelectionSpace selectionSpace;
|
||||
|
||||
public ObjectModificationManagerMixin(Gson gson, String string) {
|
||||
super(gson, string);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||
@ClientOnlyMixin
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class ResourceUtilMixin {
|
||||
@Shadow @Final @Mutable
|
||||
@Shadow(remap = false) @Final @Mutable
|
||||
private static Map metadataCache;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
|
||||
@Mixin(LevelStorageSource.class)
|
||||
public class LevelStorageSourceMixin {
|
||||
@Inject(method = "readWorldGenSettings", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;parse(Lcom/mojang/serialization/Dynamic;)Lcom/mojang/serialization/DataResult;"))
|
||||
@Inject(method = "readWorldGenSettings", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;parse(Lcom/mojang/serialization/Dynamic;)Lcom/mojang/serialization/DataResult;", remap = false))
|
||||
private static <T> void freezeRegistriesBeforeParsing(Dynamic<T> nbt, DataFixer fixer, int version, CallbackInfoReturnable<Pair<WorldGenSettings, Lifecycle>> cir) {
|
||||
DynamicOps<T> var10 = nbt.getOps();
|
||||
if (var10 instanceof RegistryOps<T> ops) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
@Mixin(GameData.class)
|
||||
public class GameDataMixin {
|
||||
|
||||
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/registries/ForgeRegistry;dump(Lnet/minecraft/resources/ResourceLocation;)V"))
|
||||
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/registries/ForgeRegistry;dump(Lnet/minecraft/resources/ResourceLocation;)V", remap = false))
|
||||
private static void noDump(ForgeRegistry<?> reg, ResourceLocation id) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.Map;
|
|||
@Mixin(net.minecraftforge.client.ItemModelMesherForge.class)
|
||||
@ClientOnlyMixin
|
||||
public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
|
||||
@Shadow @Final @Mutable private Map<IRegistryDelegate<Item>, ModelResourceLocation> locations;
|
||||
@Shadow(remap = false) @Final @Mutable private Map<IRegistryDelegate<Item>, ModelResourceLocation> locations;
|
||||
|
||||
private Map<IRegistryDelegate<Item>, ModelResourceLocation> overrideLocations;
|
||||
|
||||
|
|
@ -48,6 +48,7 @@ public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Get the stored location for that item and meta, and get the model
|
||||
* from that location from the model manager.
|
||||
**/
|
||||
|
|
@ -59,6 +60,7 @@ public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Don't get all models during init (with dynamic loading, that would
|
||||
* generate them all). Just store location instead.
|
||||
**/
|
||||
|
|
@ -69,6 +71,7 @@ public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Disable cache rebuilding (with dynamic loading, that would generate
|
||||
* all models).
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
|||
|
||||
@Shadow public abstract UnbakedModel getModel(ResourceLocation modelLocation);
|
||||
|
||||
@Shadow @Nullable public abstract BakedModel bake(ResourceLocation arg, ModelState arg2, Function<Material, TextureAtlasSprite> sprites);
|
||||
@Shadow(remap = false) @Nullable public abstract BakedModel bake(ResourceLocation arg, ModelState arg2, Function<Material, TextureAtlasSprite> sprites);
|
||||
|
||||
@Shadow @Final private static Logger LOGGER;
|
||||
@Shadow @org.jetbrains.annotations.Nullable public abstract BakedModel bake(ResourceLocation location, ModelState transform);
|
||||
|
|
|
|||
|
|
@ -35,21 +35,25 @@ import java.util.function.Predicate;
|
|||
@ClientOnlyMixin
|
||||
public abstract class CTMPackReloadListenerMixin implements ModernFixClientIntegration {
|
||||
/* caches the original render checks */
|
||||
@Shadow @Final private static Map<IRegistryDelegate<Block>, Predicate<RenderType>> blockRenderChecks;
|
||||
@Shadow(remap = false) @Final private static Map<IRegistryDelegate<Block>, Predicate<RenderType>> blockRenderChecks;
|
||||
|
||||
private static Map<IRegistryDelegate<Block>, Predicate<RenderType>> renderCheckOverrides = new ConcurrentHashMap<>();
|
||||
|
||||
private static Predicate<RenderType> DEFAULT_PREDICATE = type -> type == RenderType.solid();
|
||||
|
||||
@Shadow protected abstract Predicate<RenderType> getLayerCheck(BlockState state, BakedModel model);
|
||||
@Shadow(remap = false) protected abstract Predicate<RenderType> getLayerCheck(BlockState state, BakedModel model);
|
||||
|
||||
@Shadow protected abstract Predicate<RenderType> getExistingRenderCheck(Block block);
|
||||
@Shadow(remap = false) protected abstract Predicate<RenderType> getExistingRenderCheck(Block block);
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void onInit(CallbackInfo ci) {
|
||||
ModernFixClient.CLIENT_INTEGRATIONS.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason handle layer changes dynamically
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
private void refreshLayerHacks() {
|
||||
renderCheckOverrides.clear();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import java.util.*;
|
|||
@ClientOnlyMixin
|
||||
public abstract class TextureMetadataHandlerMixin implements ModernFixClientIntegration {
|
||||
|
||||
@Shadow @Nonnull protected abstract BakedModel wrap(ResourceLocation loc, UnbakedModel model, BakedModel object, ForgeModelBakery loader) throws IOException;
|
||||
@Shadow(remap = false) @Nonnull protected abstract BakedModel wrap(ResourceLocation loc, UnbakedModel model, BakedModel object, ForgeModelBakery loader) throws IOException;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void subscribeDynamic(CallbackInfo ci) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
@RequiresMod("refinedstorage")
|
||||
@ClientOnlyMixin
|
||||
public class ClientSetupMixin {
|
||||
@Shadow @Final private static BakedModelOverrideRegistry BAKED_MODEL_OVERRIDE_REGISTRY;
|
||||
@Shadow(remap = false) @Final private static BakedModelOverrideRegistry BAKED_MODEL_OVERRIDE_REGISTRY;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void addDynamicListener(CallbackInfo ci) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.stream.Stream;
|
|||
@RequiresMod("supermartijn642corelib")
|
||||
@ClientOnlyMixin
|
||||
public class ClientRegistrationHandlerMixin {
|
||||
@Shadow @Final private List<Pair<Supplier<Stream<ResourceLocation>>, Function<BakedModel, BakedModel>>> modelOverwrites;
|
||||
@Shadow(remap = false) @Final private List<Pair<Supplier<Stream<ResourceLocation>>, Function<BakedModel, BakedModel>>> modelOverwrites;
|
||||
|
||||
private Map<ResourceLocation, Function<BakedModel, BakedModel>> modelOverwritesByLocation = new Object2ObjectOpenHashMap<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.function.Predicate;
|
|||
public abstract class ModFileResourcePackMixin implements ICachingResourcePack {
|
||||
@Shadow public abstract Set<String> getNamespaces(PackType type);
|
||||
|
||||
@Shadow protected abstract Path resolve(String... paths);
|
||||
@Shadow(remap = false) protected abstract Path resolve(String... paths);
|
||||
|
||||
private PackResourcesCacheEngine cacheEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ import java.util.Set;
|
|||
@Mixin(ForgeRegistry.Snapshot.class)
|
||||
@IgnoreOutsideDev
|
||||
public class ForgeRegistrySnapshotMixin {
|
||||
@Shadow @Final @Mutable public Map<ResourceLocation, Integer> ids;
|
||||
@Shadow(remap = false) @Final @Mutable public Map<ResourceLocation, Integer> ids;
|
||||
|
||||
@Shadow @Final @Mutable public Set<ResourceLocation> dummied;
|
||||
@Shadow(remap = false) @Final @Mutable public Set<ResourceLocation> dummied;
|
||||
|
||||
/**
|
||||
* The only good reason to use tree maps here is to keep the order the same. But we are tracking IDs
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user