Clean up warnings
This commit is contained in:
parent
b5b46888af
commit
d1c9be8900
|
|
@ -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"}) {
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class MappedRegistryMixin {
|
|||
*/
|
||||
@Redirect(
|
||||
method = "registerMapping(ILnet/minecraft/resources/ResourceKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;Z)Ljava/lang/Object;",
|
||||
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()) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ import java.util.Set;
|
|||
public abstract class ModNioResourcePackMixin implements ICachingResourcePack {
|
||||
@Shadow public abstract Set<String> getNamespaces(PackType type);
|
||||
|
||||
@Shadow @Final private Path basePath;
|
||||
@Shadow(remap = false) @Final private Path basePath;
|
||||
private PackResourcesCacheEngine cacheEngine;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
@Inject(method = "<init>", at = @At("RETURN"), remap = false)
|
||||
private void cacheResources(CallbackInfo ci) {
|
||||
invalidateCache();
|
||||
PackResourcesCacheEngine.track(this);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class WindowMixin {
|
|||
* Grab the original width/height from the window and inject them into our state variables.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/loading/progress/EarlyProgressVisualization;handOffWindow(Ljava/util/function/IntSupplier;Ljava/util/function/IntSupplier;Ljava/util/function/Supplier;Ljava/util/function/LongSupplier;)J"), require = 0)
|
||||
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/loading/progress/EarlyProgressVisualization;handOffWindow(Ljava/util/function/IntSupplier;Ljava/util/function/IntSupplier;Ljava/util/function/Supplier;Ljava/util/function/LongSupplier;)J", remap = false), require = 0)
|
||||
private long performHandoff(EarlyProgressVisualization instance, IntSupplier width, IntSupplier height, Supplier<String> title, LongSupplier monitor, WindowEventHandler arg, ScreenManager arg2, DisplayData arg3) {
|
||||
Object visualizer = getEarlyProgressVisualizer();
|
||||
if(visualizer != null && defaultDisplayData(arg3)) {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
public abstract class StarLightEngineMixin {
|
||||
@Shadow protected abstract LevelChunkSection getChunkSection(int chunkX, int chunkY, int chunkZ);
|
||||
|
||||
@Shadow @Final protected int minSection;
|
||||
@Shadow(remap = false) @Final protected int minSection;
|
||||
|
||||
@Inject(method = "handleEmptySectionChanges(Lnet/minecraft/world/level/chunk/LightChunkGetter;Lnet/minecraft/world/level/chunk/ChunkAccess;[Ljava/lang/Boolean;Z)[Z",
|
||||
at = @At(value = "INVOKE", target = "Lca/spottedleaf/starlight/common/light/StarLightEngine;setEmptinessMapCache(II[Z)V",
|
||||
shift = At.Shift.AFTER))
|
||||
shift = At.Shift.AFTER, remap = false))
|
||||
private void lazyInitMapIfNeeded(LightChunkGetter lightAccess, ChunkAccess chunk, Boolean[] emptinessChanges, boolean unlit, CallbackInfoReturnable<int[]> cir) {
|
||||
final int chunkX = chunk.getPos().x;
|
||||
final int chunkZ = chunk.getPos().z;
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ 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<>();
|
||||
|
||||
|
|
@ -50,6 +50,10 @@ public abstract class CTMPackReloadListenerMixin implements ModernFixClientInteg
|
|||
ModernFixClient.CLIENT_INTEGRATIONS.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason handle layer changes dynamically
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
private void refreshLayerHacks() {
|
||||
renderCheckOverrides.clear();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
@RequiresMod("refinedstorage")
|
||||
@ClientOnlyMixin
|
||||
public class ClientSetupMixin {
|
||||
@Shadow @Final private BakedModelOverrideRegistry bakedModelOverrideRegistry;
|
||||
@Shadow(remap = false) @Final private BakedModelOverrideRegistry bakedModelOverrideRegistry;
|
||||
|
||||
@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<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -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