From c75eb9e7cfbdcde418f1a20175883cf61f10d900 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 10 Sep 2020 12:01:34 -0700 Subject: [PATCH] 1.16.3 Update Also included a bunch of warning cleanups. --- build.gradle | 6 +- mdk/src/main/resources/META-INF/mods.toml | 6 +- .../net/minecraft/entity/MobEntity.java.patch | 4 +- .../loading/AdvancedLogMessageAdapter.java | 2 + .../fml/loading/LoadingModList.java | 4 +- .../minecraftforge/fml/loading/ModSorter.java | 1 - .../moddiscovery/AbstractJarFileLocator.java | 1 - .../fml/loading/moddiscovery/ModFile.java | 1 - .../fml/loading/moddiscovery/ModFileInfo.java | 8 +- .../client/ForgeHooksClient.java | 59 +------- .../client/MinecraftForgeClient.java | 7 - .../client/event/EntityViewRenderEvent.java | 2 + .../client/event/GuiOpenEvent.java | 7 +- .../client/event/RenderItemInFrameEvent.java | 2 +- .../client/event/RenderPlayerEvent.java | 7 +- .../client/gui/ForgeIngameGui.java | 2 +- .../gui/NotificationModUpdateScreen.java | 1 + .../client/gui/ScrollPanel.java | 1 + .../client/model/FluidModel.java | 2 - .../client/model/ModelLoader.java | 1 + .../client/model/ModelLoaderRegistry.java | 2 + .../animation/AnimationItemOverrideList.java | 1 + .../model/animation/AnimationModelBase.java | 141 ------------------ .../model/animation/ModelBlockAnimation.java | 1 - .../TileEntityRendererAnimation.java | 3 +- .../client/model/b3d/B3DLoader.java | 4 +- .../client/model/obj/OBJModel.java | 1 - .../net/minecraftforge/common/ForgeMod.java | 5 - .../common/VillagerTradingManager.java | 3 - .../common/animation/TimeValues.java | 1 - .../common/brewing/VanillaBrewingRecipe.java | 2 - .../common/data/ForgeRecipeProvider.java | 3 +- .../common/extensions/IForgeBlock.java | 9 +- .../common/extensions/IForgeFluid.java | 2 +- .../common/extensions/IForgeItem.java | 5 +- .../minecraftforge/common/model/Models.java | 1 - .../event/AttachCapabilitiesEvent.java | 8 - .../event/DifficultyChangeEvent.java | 5 +- .../event/ForgeEventFactory.java | 4 - .../event/brewing/PotionBrewEvent.java | 2 +- .../event/entity/EntityMountEvent.java | 12 +- .../event/entity/living/AnimalTameEvent.java | 2 +- .../living/LivingExperienceDropEvent.java | 4 +- .../event/entity/living/LivingFallEvent.java | 2 +- .../event/entity/living/LivingHealEvent.java | 2 +- .../event/entity/player/AdvancementEvent.java | 1 - .../event/entity/player/FillBucketEvent.java | 2 +- .../event/entity/player/ItemFishedEvent.java | 2 +- .../entity/player/PlayerSleepInBedEvent.java | 3 - .../fml/CrashReportExtender.java | 3 - .../minecraftforge/fml/DeferredWorkQueue.java | 1 - .../java/net/minecraftforge/fml/Logging.java | 4 - .../net/minecraftforge/fml/ModLoader.java | 6 - .../fml/ModLoadingException.java | 3 +- .../minecraftforge/fml/VersionChecker.java | 19 --- .../fml/client/ClientHooks.java | 3 +- .../fml/client/ClientModLoader.java | 4 - .../fml/client/EarlyLoaderGUI.java | 7 +- .../fml/client/gui/GuiUtils.java | 12 +- .../fml/client/gui/screen/ModListScreen.java | 1 + .../fml/client/gui/widget/ExtendedButton.java | 1 - .../fml/network/FMLPlayMessages.java | 2 +- .../relauncher/libraries/LibraryManager.java | 4 +- .../fml/relauncher/libraries/ModList.java | 2 - .../fml/server/ServerModLoader.java | 5 - .../server/command/CommandEntity.java | 2 - .../server/command/CommandModList.java | 3 - .../permission/DefaultPermissionHandler.java | 1 - .../permission/context/AreaContext.java | 1 + .../debug/DataGeneratorTest.java | 3 - .../debug/item/CustomElytraTest.java | 6 - .../userdev/FMLDevClientLaunchProvider.java | 1 - .../FMLUserdevClientLaunchProvider.java | 3 - 73 files changed, 73 insertions(+), 381 deletions(-) delete mode 100644 src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java diff --git a/build.gradle b/build.gradle index 4c8c932e1..ea6565a2c 100644 --- a/build.gradle +++ b/build.gradle @@ -54,8 +54,8 @@ ext { } MAPPING_CHANNEL = 'snapshot' MAPPING_VERSION = '20200514-1.16' - MC_VERSION = '1.16.2' - MCP_VERSION = '20200812.004259' + MC_VERSION = '1.16.3' + MCP_VERSION = '20200910.110331' } project(':mcp') { @@ -197,7 +197,7 @@ project(':forge') { } ext { - SPEC_VERSION = '33.0' // This is overwritten by git tag, but here so dev time doesnt explode + SPEC_VERSION = '34.0' // This is overwritten by git tag, but here so dev time doesnt explode // The new versioning sceme is -.. // ForgeMC is a unique identifier for every MC version we have supported. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. diff --git a/mdk/src/main/resources/META-INF/mods.toml b/mdk/src/main/resources/META-INF/mods.toml index fdad2f993..adf66a1a3 100644 --- a/mdk/src/main/resources/META-INF/mods.toml +++ b/mdk/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader="javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion="[33,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +loaderVersion="[34,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license="All rights reserved" @@ -45,7 +45,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn # Does this dependency have to exist - if not, ordering below must be specified mandatory=true #mandatory # The version range of the dependency - versionRange="[33,)" #mandatory + versionRange="[34,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering="NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER @@ -54,6 +54,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn [[dependencies.examplemod]] modId="minecraft" mandatory=true - versionRange="[1.16.2]" + versionRange="[1.16.3]" ordering="NONE" side="BOTH" diff --git a/patches/minecraft/net/minecraft/entity/MobEntity.java.patch b/patches/minecraft/net/minecraft/entity/MobEntity.java.patch index ea709c77c..f6860d752 100644 --- a/patches/minecraft/net/minecraft/entity/MobEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/MobEntity.java.patch @@ -32,7 +32,7 @@ if (entity != null) { double d0 = entity.func_70068_e(this); int i = this.func_200600_R().func_220339_d().func_233671_f_(); -@@ -878,6 +887,8 @@ +@@ -879,6 +888,8 @@ } public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) { @@ -41,7 +41,7 @@ Item item = p_184640_0_.func_77973_b(); if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof BlockItem) || !(((BlockItem)item).func_179223_d() instanceof AbstractSkullBlock))) { if (item instanceof ArmorItem) { -@@ -885,7 +896,7 @@ +@@ -886,7 +897,7 @@ } else if (item == Items.field_185160_cR) { return EquipmentSlotType.CHEST; } else { diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java index 6acab492a..88a9eae98 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java @@ -25,6 +25,8 @@ import org.apache.logging.log4j.util.StringBuilderFormattable; import java.util.function.Consumer; public class AdvancedLogMessageAdapter implements Message, StringBuilderFormattable { + private static final long serialVersionUID = -8291754833965087436L; + private static final Object[] EMPTY = new Object[0]; private final Consumer logMessageBuilder; diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/LoadingModList.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/LoadingModList.java index d7430d388..e130d1eea 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/LoadingModList.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/LoadingModList.java @@ -19,20 +19,17 @@ package net.minecraftforge.fml.loading; -import com.google.common.collect.Streams; import cpw.mods.modlauncher.api.LamdbaExceptionUtils; import net.minecraftforge.fml.loading.moddiscovery.BackgroundScanHandler; import net.minecraftforge.fml.loading.moddiscovery.ModFile; import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo; import net.minecraftforge.fml.loading.moddiscovery.ModInfo; -import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * Master list of all mods in the loading context. This class cannot refer outside the @@ -44,6 +41,7 @@ public class LoadingModList private final List modFiles; private final List sortedList; private final Map fileById; + @SuppressWarnings("unused") private BackgroundScanHandler scanner; private final List preLoadErrors; private List brokenFiles; diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java index 8bfd819fe..d4a083933 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java @@ -19,7 +19,6 @@ package net.minecraftforge.fml.loading; -import com.google.common.collect.Streams; import com.google.common.graph.GraphBuilder; import com.google.common.graph.MutableGraph; import net.minecraftforge.forgespi.language.IModFileInfo; diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileLocator.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileLocator.java index 6d5ff9e71..a850ad77c 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileLocator.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileLocator.java @@ -29,7 +29,6 @@ import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Optional; diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java index 3dd73a937..0830f6869 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java @@ -21,7 +21,6 @@ package net.minecraftforge.fml.loading.moddiscovery; import com.google.common.collect.ImmutableMap; import net.minecraftforge.fml.loading.progress.StartupMessageManager; -import net.minecraftforge.forgespi.Environment; import net.minecraftforge.fml.loading.FMLLoader; import net.minecraftforge.forgespi.language.IModFileInfo; import net.minecraftforge.forgespi.language.IModInfo; diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java index 80251180d..d993a8084 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java @@ -19,9 +19,6 @@ package net.minecraftforge.fml.loading.moddiscovery; -import com.electronwill.nightconfig.core.UnmodifiableConfig; - -import net.minecraftforge.fml.loading.StringSubstitutor; import net.minecraftforge.fml.loading.StringUtils; import net.minecraftforge.forgespi.language.IConfigurable; import net.minecraftforge.forgespi.language.IModFileInfo; @@ -145,4 +142,9 @@ public class ModFileInfo implements IModFileInfo, IConfigurable { return license; } + + public URL getIssueURL() + { + return issueURL; + } } diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 377846634..1b6ddaa4b 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -22,12 +22,12 @@ package net.minecraftforge.client; import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; -import net.minecraft.client.GameSettings; import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; import net.minecraft.client.MouseHelper; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundEngine; +import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.gui.ClientBossInfo; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.screen.MainMenuScreen; @@ -73,8 +73,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.IBlockDisplayReader; -import net.minecraft.world.World; -import net.minecraft.world.biome.Biome; import net.minecraftforge.client.event.*; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.client.model.ModelLoader; @@ -135,8 +133,9 @@ public class ForgeHooksClient case ENTITY: if (!(target instanceof EntityRayTraceResult)) return false; return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent.HighlightEntity(context, info, target, partialTicks, matrix, buffers)); + default: + return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent(context, info, target, partialTicks, matrix, buffers)); } - return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent(context, info, target, partialTicks, matrix, buffers)); } public static void dispatchRenderLast(WorldRenderer context, MatrixStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano) @@ -223,54 +222,6 @@ public class ForgeHooksClient return event.getFOV(); } - private static int skyX, skyZ; - - private static boolean skyInit; - private static int skyRGBMultiplier; - - public static int getSkyBlendColour(World world, BlockPos center) - { - if (center.getX() == skyX && center.getZ() == skyZ && skyInit) - { - return skyRGBMultiplier; - } - skyInit = true; - - GameSettings settings = Minecraft.getInstance().gameSettings; - int[] ranges = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 }; - int distance = 0; - //TODO, GraphicsFanciness changed, and is getSkyBlendColour used still? -// if (settings.fancyGraphics && ranges.length > 0) -// { -// distance = ranges[MathHelper.clamp(settings.renderDistanceChunks, 0, ranges.length-1)]; -// } - - int r = 0; - int g = 0; - int b = 0; - - int divider = 0; - for (int x = -distance; x <= distance; ++x) - { - for (int z = -distance; z <= distance; ++z) - { - BlockPos pos = center.add(x, 0, z); - Biome biome = world.getNoiseBiome(pos.getX(), pos.getY(), pos.getZ()); - int colour = 0xFFFFFF; // TODO: biome.getSkyColorByTemp(biome.getTemperature(pos)); - r += (colour & 0xFF0000) >> 16; - g += (colour & 0x00FF00) >> 8; - b += colour & 0x0000FF; - divider++; - } - } - - int multiplier = (r / divider & 255) << 16 | (g / divider & 255) << 8 | b / divider & 255; - - skyX = center.getX(); - skyZ = center.getZ(); - skyRGBMultiplier = multiplier; - return skyRGBMultiplier; - } /** * Initialization of Forge Renderers. */ @@ -287,9 +238,9 @@ public class ForgeHooksClient { // render a warning at the top of the screen, ITextComponent line = new TranslationTextComponent("forge.update.beta.1", TextFormatting.RED, TextFormatting.RESET).func_240699_a_(TextFormatting.RED); - gui.func_238472_a_(mStack, font, line, width / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1); + AbstractGui.func_238472_a_(mStack, font, line, width / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1); line = new TranslationTextComponent("forge.update.beta.2"); - gui.func_238472_a_(mStack, font, line, width / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1); + AbstractGui.func_238472_a_(mStack, font, line, width / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1); } String line = null; diff --git a/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java b/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java index 7807d14e3..de7d3cbce 100644 --- a/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java +++ b/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java @@ -20,15 +20,9 @@ package net.minecraftforge.client; import java.io.IOException; -import java.lang.ref.WeakReference; import java.util.BitSet; -import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; @@ -37,7 +31,6 @@ import javax.annotation.Nonnull; import net.minecraft.client.renderer.RenderType; import org.apache.commons.lang3.tuple.Pair; -import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; diff --git a/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java b/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java index ec5fff21e..e1a576e07 100644 --- a/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java +++ b/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java @@ -60,6 +60,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. private static class FogEvent extends EntityViewRenderEvent { private final FogType type; + @SuppressWarnings("resource") protected FogEvent(FogType type, ActiveRenderInfo info, double renderPartialTicks) { super(Minecraft.getInstance().gameRenderer, info, renderPartialTicks); @@ -125,6 +126,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. private float green; private float blue; + @SuppressWarnings("resource") public FogColors(ActiveRenderInfo info, float partialTicks, float red, float green, float blue) { super(Minecraft.getInstance().gameRenderer, info, partialTicks); diff --git a/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java b/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java index 159e4dc60..084565336 100644 --- a/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java +++ b/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java @@ -27,11 +27,10 @@ import net.minecraft.client.gui.screen.Screen; * This event is called before any Gui will open. * If you don't want this to happen, cancel the event. * If you want to override this Gui, simply set the gui variable to your own Gui. - * - * @author jk-5 + * */ -@net.minecraftforge.eventbus.api.Cancelable -public class GuiOpenEvent extends net.minecraftforge.eventbus.api.Event +@Cancelable +public class GuiOpenEvent extends Event { private Screen gui; public GuiOpenEvent(Screen gui) diff --git a/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java b/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java index a696a8e5c..8866adde4 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java @@ -35,7 +35,7 @@ import javax.annotation.Nonnull; * You can set canceled to do no further vanilla processing. */ @Cancelable -public class RenderItemInFrameEvent extends net.minecraftforge.eventbus.api.Event +public class RenderItemInFrameEvent extends Event { private final ItemStack item; private final ItemFrameEntity entityItemFrame; diff --git a/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java b/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java index 0f6d16f48..6174fac1e 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java @@ -24,11 +24,8 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraftforge.eventbus.api.Cancelable; import net.minecraft.client.renderer.entity.PlayerRenderer; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.player.PlayerEvent; -import javax.annotation.Nonnull; - public abstract class RenderPlayerEvent extends PlayerEvent { private final PlayerRenderer renderer; @@ -53,7 +50,7 @@ public abstract class RenderPlayerEvent extends PlayerEvent public IRenderTypeBuffer getBuffers() { return buffers; } public int getLight() { return light; } - @net.minecraftforge.eventbus.api.Cancelable + @Cancelable public static class Pre extends RenderPlayerEvent { public Pre(PlayerEntity player, PlayerRenderer renderer, float tick, MatrixStack stack, IRenderTypeBuffer buffers, int light) { @@ -67,5 +64,5 @@ public abstract class RenderPlayerEvent extends PlayerEvent super(player, renderer, tick, stack, buffers, light); } } - + } diff --git a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java index 73985db50..b045b4d18 100644 --- a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java +++ b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java @@ -50,7 +50,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StringUtils; import net.minecraft.util.Util; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.text.ITextComponent; import net.minecraft.world.GameType; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; @@ -60,6 +59,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; +@SuppressWarnings("deprecation") public class ForgeIngameGui extends IngameGui { //private static final ResourceLocation VIGNETTE = new ResourceLocation("textures/misc/vignette.png"); diff --git a/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java b/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java index 15b1960a2..0c8e27048 100644 --- a/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java +++ b/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java @@ -64,6 +64,7 @@ public class NotificationModUpdateScreen extends Screen } } + @SuppressWarnings("deprecation") @Override public void func_230430_a_(MatrixStack mStack, int mouseX, int mouseY, float partialTicks) { diff --git a/src/main/java/net/minecraftforge/client/gui/ScrollPanel.java b/src/main/java/net/minecraftforge/client/gui/ScrollPanel.java index 3ff5045d5..2ef299f2d 100644 --- a/src/main/java/net/minecraftforge/client/gui/ScrollPanel.java +++ b/src/main/java/net/minecraftforge/client/gui/ScrollPanel.java @@ -182,6 +182,7 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable return false; } + @SuppressWarnings("deprecation") @Override public void func_230430_a_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) { diff --git a/src/main/java/net/minecraftforge/client/model/FluidModel.java b/src/main/java/net/minecraftforge/client/model/FluidModel.java index 8204b7f96..98fc7cde1 100644 --- a/src/main/java/net/minecraftforge/client/model/FluidModel.java +++ b/src/main/java/net/minecraftforge/client/model/FluidModel.java @@ -57,8 +57,6 @@ import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; // TODO: Write a model loader and test/fix as needed public final class FluidModel implements IModelGeometry diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoader.java b/src/main/java/net/minecraftforge/client/model/ModelLoader.java index c576d770e..1a1850dd8 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoader.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoader.java @@ -158,6 +158,7 @@ public final class ModelLoader extends ModelBakery public static final class White { public static final ResourceLocation LOCATION = new ResourceLocation("white"); private static TextureAtlasSprite instance = null; + @SuppressWarnings("deprecation") public static final TextureAtlasSprite instance() { if (instance == null) diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java b/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java index ee092f960..bf9deb260 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java @@ -175,11 +175,13 @@ public class ModelLoaderRegistry return blockMaterial(tex); } + @SuppressWarnings("deprecation") public static RenderMaterial blockMaterial(String location) { return new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(location)); } + @SuppressWarnings("deprecation") public static RenderMaterial blockMaterial(ResourceLocation location) { return new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, location); diff --git a/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java b/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java index fd1b3dc99..bc51ce68a 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java +++ b/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java @@ -61,6 +61,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList this.bakedTextureGetter = bakedTextureGetter; } + @SuppressWarnings("resource") @Override public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity) { diff --git a/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java b/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java deleted file mode 100644 index 9bb291c8d..000000000 --- a/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Minecraft Forge - * Copyright (c) 2016-2020. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package net.minecraftforge.client.model.animation; - -import java.util.List; -import java.util.Random; - -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.model.BakedQuad; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.client.renderer.model.IUnbakedModel; -import net.minecraft.client.renderer.model.Model; -import net.minecraft.entity.Entity; -import net.minecraft.block.Blocks; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.Direction; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.client.model.pipeline.VertexLighterFlat; -import net.minecraftforge.client.model.pipeline.VertexBufferConsumer; -import net.minecraftforge.common.animation.Event; -import net.minecraftforge.common.animation.IEventHandler; -import net.minecraftforge.common.model.animation.CapabilityAnimation; - -import org.lwjgl.opengl.GL11; - -import com.mojang.blaze3d.platform.GlStateManager; - -/** - * ModelBase that works with the Forge model system and animations. - * Some quirks are still left, deprecated for the moment. - */ -/* -@Deprecated -public class AnimationModelBase extends Model implements IEventHandler -{ - private final VertexLighterFlat lighter; - private final ResourceLocation modelLocation; - - public AnimationModelBase(ResourceLocation modelLocation, VertexLighterFlat lighter) - { - this.modelLocation = modelLocation; - this.lighter = lighter; - } - - @SuppressWarnings("unchecked") - //@Override - public void render(Entity entity, float limbSwing, float limbSwingSpeed, float timeAlive, float yawHead, float rotationPitch, float scale) - { - entity.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null) - .map(cap -> cap.apply(timeAlive / 20)) - .map(pair -> { - handleEvents((T) entity, timeAlive / 20, pair.getRight()); - IUnbakedModel unbaked = ModelLoaderRegistry.getModelOrMissing(modelLocation); - // TODO where should uvlock data come from? - return unbaked.bake(ModelLoader.defaultModelGetter(), ModelLoader.defaultTextureGetter(), new BasicState(pair.getLeft(), false), DefaultVertexFormats.ITEM); - }).ifPresent(model -> drawModel(model, entity)); - } - - private void drawModel(IBakedModel bakedModel, Entity entity) - { - BlockPos pos = new BlockPos(entity.posX, entity.posY + entity.height, entity.posZ); - - RenderHelper.disableStandardItemLighting(); - GlStateManager.pushMatrix(); - GlStateManager.rotatef(180, 0, 0, 1); - Tessellator tessellator = Tessellator.getInstance(); - BufferBuilder builder = tessellator.getBuffer(); - builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); - builder.setTranslation(-0.5, -1.5, -0.5); - - lighter.setParent(new VertexBufferConsumer(builder)); - lighter.setWorld(entity.world); - lighter.setState(Blocks.AIR.getDefaultState()); - lighter.setBlockPos(pos); - boolean empty = true; - Random random = new Random(); - random.setSeed(42); - List quads = bakedModel.getQuads(null, null, random); - if(!quads.isEmpty()) - { - lighter.updateBlockInfo(); - empty = false; - for(BakedQuad quad : quads) - { - quad.pipe(lighter); - } - } - for(Direction side : Direction.values()) - { - random.setSeed(42); - quads = bakedModel.getQuads(null, side, random); - if(!quads.isEmpty()) - { - if(empty) lighter.updateBlockInfo(); - empty = false; - for(BakedQuad quad : quads) - { - quad.pipe(lighter); - } - } - } - - // debug quad - //VertexBuffer.pos(0, 1, 0).color(0xFF, 0xFF, 0xFF, 0xFF).tex(0, 0).lightmap(240, 0).endVertex(); - //VertexBuffer.pos(0, 1, 1).color(0xFF, 0xFF, 0xFF, 0xFF).tex(0, 1).lightmap(240, 0).endVertex(); - //VertexBuffer.pos(1, 1, 1).color(0xFF, 0xFF, 0xFF, 0xFF).tex(1, 1).lightmap(240, 0).endVertex(); - //VertexBuffer.pos(1, 1, 0).color(0xFF, 0xFF, 0xFF, 0xFF).tex(1, 0).lightmap(240, 0).endVertex(); - - builder.setTranslation(0, 0, 0); - - tessellator.draw(); - GlStateManager.popMatrix(); - RenderHelper.enableStandardItemLighting(); - } - - @Override - public void handleEvents(T instance, float time, Iterable pastEvents) {} -} -*/ diff --git a/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java b/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java index 6d0320af3..2cba338f3 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java +++ b/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java @@ -50,7 +50,6 @@ import net.minecraftforge.client.model.animation.ModelBlockAnimation.Parameter.I import net.minecraftforge.client.model.animation.ModelBlockAnimation.Parameter.Type; import net.minecraftforge.client.model.animation.ModelBlockAnimation.Parameter.Variable; import net.minecraftforge.common.animation.Event; -import net.minecraftforge.common.model.TransformationHelper; import net.minecraftforge.common.model.animation.IClip; import net.minecraftforge.common.model.animation.IJoint; import net.minecraftforge.common.model.animation.IJointClip; diff --git a/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java b/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java index 612142cf2..16f746e2f 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java +++ b/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java @@ -55,7 +55,7 @@ public class TileEntityRendererAnimation extends TileEntit } protected static BlockRendererDispatcher blockRenderer; - + @Override public void render(T te, float partialTick, MatrixStack mat, IRenderTypeBuffer renderer, int light, int otherlight) { @@ -72,6 +72,7 @@ public class TileEntityRendererAnimation extends TileEntit IModelData data = model.getModelData(world, pos, state, ModelDataManager.getModelData(te.getWorld(), pos)); if (data.hasProperty(Properties.AnimationProperty)) { + @SuppressWarnings("resource") float time = Animation.getWorldTime(Minecraft.getInstance().world, partialTick); cap .map(asm -> asm.apply(time)) diff --git a/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java b/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java index 92a6b24d2..5e72a6f95 100644 --- a/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java +++ b/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java @@ -93,6 +93,7 @@ import net.minecraftforge.common.property.Properties; * If you need more control over accepted resources - extend the class, and register a new instance with ModelLoaderRegistry. */ // TODO: Implement as a new model loader +@SuppressWarnings("unused") public enum B3DLoader implements ISelectiveResourceReloadListener { INSTANCE; @@ -111,7 +112,6 @@ public enum B3DLoader implements ISelectiveResourceReloadListener cache.clear(); } - @SuppressWarnings("unchecked") public IUnbakedModel loadModel(ResourceLocation modelLocation) throws Exception { ResourceLocation file = new ResourceLocation(modelLocation.getNamespace(), modelLocation.getPath()); @@ -445,6 +445,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener return path; } + @SuppressWarnings("deprecation") @Override public Collection getTextures(Function modelGetter, Set> missingTextureErrors) { @@ -459,6 +460,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener return Collections.emptyList(); } + @SuppressWarnings("deprecation") @Nullable @Override public IBakedModel bakeModel(ModelBakery bakery, Function spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation) diff --git a/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java b/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java index 37bf67181..637cb7b2d 100644 --- a/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java +++ b/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java @@ -39,7 +39,6 @@ import net.minecraftforge.client.model.geometry.IModelGeometryPart; import net.minecraftforge.client.model.geometry.IMultipartModelGeometry; import net.minecraftforge.client.model.pipeline.BakedQuadBuilder; import net.minecraftforge.client.model.pipeline.IVertexConsumer; -import net.minecraftforge.common.model.TransformationHelper; import org.apache.commons.lang3.tuple.Pair; import javax.annotation.Nonnull; diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index 7a31767c6..3a928cfe6 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -23,7 +23,6 @@ import net.minecraft.entity.ai.attributes.Attribute; import net.minecraft.entity.ai.attributes.RangedAttribute; import net.minecraft.util.SoundEvent; import net.minecraft.world.storage.IServerConfiguration; -import net.minecraft.world.storage.IWorldInfo; import net.minecraft.world.storage.SaveFormat; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -31,14 +30,10 @@ import net.minecraftforge.fml.*; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLModIdMappingEvent; -import net.minecraftforge.fml.event.server.FMLServerStartingEvent; import net.minecraftforge.fml.event.server.FMLServerStoppingEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.loading.progress.StartupMessageManager; import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.server.command.ConfigCommand; -import net.minecraftforge.server.command.ForgeCommand; import net.minecraftforge.versions.forge.ForgeVersion; import net.minecraftforge.versions.mcp.MCPVersion; diff --git a/src/main/java/net/minecraftforge/common/VillagerTradingManager.java b/src/main/java/net/minecraftforge/common/VillagerTradingManager.java index 2809e09c0..220a71074 100644 --- a/src/main/java/net/minecraftforge/common/VillagerTradingManager.java +++ b/src/main/java/net/minecraftforge/common/VillagerTradingManager.java @@ -19,14 +19,11 @@ package net.minecraftforge.common; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.google.common.collect.Lists; - import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import net.minecraft.entity.merchant.villager.VillagerProfession; diff --git a/src/main/java/net/minecraftforge/common/animation/TimeValues.java b/src/main/java/net/minecraftforge/common/animation/TimeValues.java index 535341bed..c8c513e20 100644 --- a/src/main/java/net/minecraftforge/common/animation/TimeValues.java +++ b/src/main/java/net/minecraftforge/common/animation/TimeValues.java @@ -32,7 +32,6 @@ import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; import javax.annotation.Nullable; diff --git a/src/main/java/net/minecraftforge/common/brewing/VanillaBrewingRecipe.java b/src/main/java/net/minecraftforge/common/brewing/VanillaBrewingRecipe.java index e0e4bc31e..c67db88aa 100644 --- a/src/main/java/net/minecraftforge/common/brewing/VanillaBrewingRecipe.java +++ b/src/main/java/net/minecraftforge/common/brewing/VanillaBrewingRecipe.java @@ -24,8 +24,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionBrewing; -import javax.annotation.Nonnull; - /** * Used in BrewingRecipeRegistry to maintain the vanilla behaviour. * diff --git a/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java index 97907bd3e..954a5038f 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java @@ -46,7 +46,6 @@ import net.minecraft.item.crafting.Ingredient.IItemList; import net.minecraft.item.crafting.Ingredient.TagList; import net.minecraft.item.crafting.Ingredient.SingleItemList; import net.minecraft.tags.ITag; -import net.minecraft.tags.Tag; import net.minecraft.util.IItemProvider; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.Tags; @@ -90,7 +89,7 @@ public class ForgeRecipeProvider extends RecipeProvider exclude(Blocks.DIAMOND_BLOCK); exclude(Blocks.EMERALD_BLOCK); exclude(Blocks.field_235397_ng_); - + exclude(Blocks.COBBLESTONE_STAIRS); exclude(Blocks.COBBLESTONE_SLAB); exclude(Blocks.COBBLESTONE_WALL); diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index 809ff078a..e97d8825c 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -19,11 +19,8 @@ package net.minecraftforge.common.extensions; -import java.util.Collection; import java.util.Optional; import java.util.Set; -import java.util.function.Predicate; - import javax.annotation.Nullable; import net.minecraft.block.*; @@ -43,17 +40,13 @@ import net.minecraft.entity.projectile.WitherSkullEntity; import net.minecraft.fluid.FluidState; import net.minecraft.potion.Effects; import net.minecraft.item.AxeItem; -import net.minecraft.item.DyeColor; import net.minecraft.item.HoeItem; import net.minecraft.item.ItemStack; import net.minecraft.item.ShovelItem; import net.minecraft.pathfinding.PathNodeType; -import net.minecraft.state.Property; -import net.minecraft.state.properties.BedPart; import net.minecraft.tags.BlockTags; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; -import net.minecraft.util.Hand; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; @@ -911,7 +904,7 @@ public interface IForgeBlock else if(toolType == ToolType.HOE) return HoeItem.getHoeTillingState(state); else return toolType == ToolType.SHOVEL ? ShovelItem.getShovelPathingState(state) : null; } - + /** * Checks if a player or entity handles movement on this block like scaffolding. * diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java b/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java index 684b9cf23..4eb39cb1f 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java @@ -24,7 +24,6 @@ import java.util.Set; import javax.annotation.Nullable; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.Entity; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.FluidState; @@ -98,6 +97,7 @@ public interface IForgeFluid * @param explosion The explosion * @return The amount of the explosion absorbed. */ + @SuppressWarnings("deprecation") default float getExplosionResistance(FluidState state, IBlockReader world, BlockPos pos, Explosion explosion) { return state.getExplosionResistance(); diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java b/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java index 3897f10b8..2b557b3b1 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java @@ -24,7 +24,6 @@ import java.util.function.Consumer; import javax.annotation.Nullable; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.Multimap; import net.minecraft.block.BlockState; @@ -54,14 +53,11 @@ import net.minecraft.util.ActionResultType; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.text.IFormattableTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.Tags; import net.minecraftforge.common.ToolType; -import net.minecraftforge.common.animation.ITimeValue; // TODO review most of the methods in this "patch" public interface IForgeItem @@ -241,6 +237,7 @@ public interface IForgeItem * @param itemStack The current ItemStack * @return The resulting ItemStack */ + @SuppressWarnings("deprecation") default ItemStack getContainerItem(ItemStack itemStack) { if (!hasContainerItem(itemStack)) diff --git a/src/main/java/net/minecraftforge/common/model/Models.java b/src/main/java/net/minecraftforge/common/model/Models.java index 953d26a6f..fc226021f 100644 --- a/src/main/java/net/minecraftforge/common/model/Models.java +++ b/src/main/java/net/minecraftforge/common/model/Models.java @@ -21,7 +21,6 @@ package net.minecraftforge.common.model; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterators; import com.google.common.collect.UnmodifiableIterator; public enum Models diff --git a/src/main/java/net/minecraftforge/event/AttachCapabilitiesEvent.java b/src/main/java/net/minecraftforge/event/AttachCapabilitiesEvent.java index 9da4d3cca..2acc3d6ed 100644 --- a/src/main/java/net/minecraftforge/event/AttachCapabilitiesEvent.java +++ b/src/main/java/net/minecraftforge/event/AttachCapabilitiesEvent.java @@ -28,14 +28,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.eventbus.api.GenericEvent; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.eventbus.api.GenericEvent; - /** * Fired whenever an object with Capabilities support {currently TileEntity/Item/Entity) * is created. Allowing for the attachment of arbitrary capability providers. diff --git a/src/main/java/net/minecraftforge/event/DifficultyChangeEvent.java b/src/main/java/net/minecraftforge/event/DifficultyChangeEvent.java index f8e6d7d5c..eee6d4999 100644 --- a/src/main/java/net/minecraftforge/event/DifficultyChangeEvent.java +++ b/src/main/java/net/minecraftforge/event/DifficultyChangeEvent.java @@ -22,7 +22,6 @@ package net.minecraftforge.event; import net.minecraft.world.Difficulty; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.Cancelable; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.Event.HasResult; @@ -31,13 +30,11 @@ import net.minecraftforge.eventbus.api.Event.HasResult; *
* This event is fired via the {@link ForgeHooks#onDifficultyChange(EnumDifficulty, EnumDifficulty)}.
*
- * This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
- *
* This event does not have a result. {@link HasResult}
*
* This event is fired on the {@link MinecraftForge#EVENT_BUS}. **/ -public class DifficultyChangeEvent extends net.minecraftforge.eventbus.api.Event +public class DifficultyChangeEvent extends Event { private final Difficulty difficulty; private final Difficulty oldDifficulty; diff --git a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java index f792db738..19003fb24 100644 --- a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java +++ b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -28,7 +28,6 @@ import javax.annotation.Nullable; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.brigadier.CommandDispatcher; -import net.minecraft.block.NetherPortalBlock; import net.minecraft.block.PortalSize; import net.minecraft.block.BlockState; import net.minecraft.client.util.ITooltipFlag; @@ -69,7 +68,6 @@ import net.minecraft.util.RegistryKey; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; -import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.RayTraceResult; @@ -81,8 +79,6 @@ import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; -import net.minecraft.world.WorldSettings; -import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.MobSpawnInfo; import net.minecraft.world.storage.IServerWorldInfo; import net.minecraft.world.storage.PlayerData; diff --git a/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java b/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java index 670c4ecc2..a3e7a2ec8 100644 --- a/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java +++ b/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java @@ -76,7 +76,7 @@ public class PotionBrewEvent extends Event *
* If this event is canceled, and items have been modified, PotionBrewEvent.Post will automatically be fired. **/ - @net.minecraftforge.eventbus.api.Cancelable + @Cancelable public static class Pre extends PotionBrewEvent { public Pre(NonNullList stacks) diff --git a/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java index 5753f04fd..a3f5f6efe 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java @@ -36,17 +36,17 @@ import net.minecraftforge.eventbus.api.Event.HasResult; * This event does not have a result. {@link HasResult}
*
* This event is fired on the {@link MinecraftForge#EVENT_BUS}. - * + * */ -@net.minecraftforge.eventbus.api.Cancelable +@Cancelable public class EntityMountEvent extends EntityEvent { - + private final Entity entityMounting; private final Entity entityBeingMounted; private final World worldObj; - + private final boolean isMounting; public EntityMountEvent(Entity entityMounting, Entity entityBeingMounted, World entityWorld, boolean isMounting) @@ -57,12 +57,12 @@ public class EntityMountEvent extends EntityEvent this.worldObj = entityWorld; this.isMounting = isMounting; } - + public boolean isMounting() { return isMounting; } - + public boolean isDismounting() { return !isMounting; diff --git a/src/main/java/net/minecraftforge/event/entity/living/AnimalTameEvent.java b/src/main/java/net/minecraftforge/event/entity/living/AnimalTameEvent.java index 67f3dbfa7..b804b870f 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/AnimalTameEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/AnimalTameEvent.java @@ -32,7 +32,7 @@ import net.minecraftforge.eventbus.api.Cancelable; * This event is {@link net.minecraftforge.eventbus.api.Cancelable}. If canceled, taming the animal will fail. * This event is fired on the {@link MinecraftForge#EVENT_BUS}. */ -@net.minecraftforge.eventbus.api.Cancelable +@Cancelable public class AnimalTameEvent extends LivingEvent { private final AnimalEntity animal; diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java index 3c48d540e..d12bdc6ed 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java @@ -28,8 +28,8 @@ import net.minecraftforge.eventbus.api.Cancelable; * the amount of experience points dropped or completely prevent dropping of experience * by canceling the event. */ -@net.minecraftforge.eventbus.api.Cancelable -public class LivingExperienceDropEvent extends LivingEvent +@Cancelable +public class LivingExperienceDropEvent extends LivingEvent { private final PlayerEntity attackingPlayer; private final int originalExperiencePoints; diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java index e4579d5dd..34b06168d 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java @@ -40,7 +40,7 @@ import net.minecraft.entity.LivingEntity; *
* This event is fired on the {@link MinecraftForge#EVENT_BUS}. **/ -@net.minecraftforge.eventbus.api.Cancelable +@Cancelable public class LivingFallEvent extends LivingEvent { private float distance; diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java index 5422a5f0d..58820ac47 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java @@ -39,7 +39,7 @@ import net.minecraft.entity.LivingEntity; *
* This event is fired on the {@link MinecraftForge#EVENT_BUS}. **/ -@net.minecraftforge.eventbus.api.Cancelable +@Cancelable public class LivingHealEvent extends LivingEvent { private float amount; diff --git a/src/main/java/net/minecraftforge/event/entity/player/AdvancementEvent.java b/src/main/java/net/minecraftforge/event/entity/player/AdvancementEvent.java index 10a065c39..7f8c4fa62 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/AdvancementEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/AdvancementEvent.java @@ -22,7 +22,6 @@ package net.minecraftforge.event.entity.player; import net.minecraft.advancements.Advancement; import net.minecraft.entity.player.PlayerEntity; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.Cancelable; /** * This event is fired when a player gets an advancement. diff --git a/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java b/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java index c0a33f92a..3ace68a05 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java @@ -38,7 +38,7 @@ import javax.annotation.Nullable; * ItemStack to your inventory and reducing the stack size to process. * setResult(ALLOW) is the same as the old setHandled(); */ -@net.minecraftforge.eventbus.api.Cancelable +@Cancelable @Event.HasResult public class FillBucketEvent extends PlayerEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/player/ItemFishedEvent.java b/src/main/java/net/minecraftforge/event/entity/player/ItemFishedEvent.java index e42807962..b0e902885 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/ItemFishedEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/ItemFishedEvent.java @@ -35,7 +35,7 @@ import java.util.List; * Canceling the event will cause the player to receive no items at all. * The hook will still take the damage specified */ -@net.minecraftforge.eventbus.api.Cancelable +@Cancelable public class ItemFishedEvent extends PlayerEvent { private final NonNullList stacks = NonNullList.create(); diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java index e12c26ef4..bad028e65 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java @@ -23,7 +23,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity.SleepResult; import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.Cancelable; import java.util.Optional; @@ -35,8 +34,6 @@ import java.util.Optional; *
* {@link #result} contains whether the player is able to sleep.
*
- * This event is not {@link net.minecraftforge.eventbus.api.Cancelable}. - *
* This event does not have a result. {@link HasResult} *
* This event is fired on the {@link MinecraftForge#EVENT_BUS}. diff --git a/src/main/java/net/minecraftforge/fml/CrashReportExtender.java b/src/main/java/net/minecraftforge/fml/CrashReportExtender.java index af722a52e..826fed809 100644 --- a/src/main/java/net/minecraftforge/fml/CrashReportExtender.java +++ b/src/main/java/net/minecraftforge/fml/CrashReportExtender.java @@ -25,16 +25,13 @@ import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReportCategory; import net.minecraftforge.fml.common.ICrashCallable; import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo; -import net.minecraftforge.forgespi.language.IModFileInfo; import net.minecraftforge.forgespi.language.IModInfo; -import net.minecraftforge.forgespi.locating.IModFile; import org.apache.logging.log4j.Logger; import java.io.File; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.Callable; -import java.util.stream.Collectors; public class CrashReportExtender { diff --git a/src/main/java/net/minecraftforge/fml/DeferredWorkQueue.java b/src/main/java/net/minecraftforge/fml/DeferredWorkQueue.java index 82f14bb68..6864ac145 100644 --- a/src/main/java/net/minecraftforge/fml/DeferredWorkQueue.java +++ b/src/main/java/net/minecraftforge/fml/DeferredWorkQueue.java @@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import net.minecraftforge.fml.event.lifecycle.ParallelDispatchEvent; -import net.minecraftforge.fml.javafmlmod.FMLModContainer; import org.apache.commons.lang3.time.StopWatch; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/net/minecraftforge/fml/Logging.java b/src/main/java/net/minecraftforge/fml/Logging.java index d98dad7c9..e2c05d79c 100644 --- a/src/main/java/net/minecraftforge/fml/Logging.java +++ b/src/main/java/net/minecraftforge/fml/Logging.java @@ -19,12 +19,8 @@ package net.minecraftforge.fml; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.MarkerManager; -import org.apache.logging.log4j.core.config.Configurator; public class Logging { diff --git a/src/main/java/net/minecraftforge/fml/ModLoader.java b/src/main/java/net/minecraftforge/fml/ModLoader.java index 7012c525a..737eec22d 100644 --- a/src/main/java/net/minecraftforge/fml/ModLoader.java +++ b/src/main/java/net/minecraftforge/fml/ModLoader.java @@ -21,16 +21,12 @@ package net.minecraftforge.fml; import com.google.common.collect.ImmutableList; import cpw.mods.modlauncher.TransformingClassLoader; -import net.minecraft.util.registry.Bootstrap; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.capabilities.CapabilityManager; -import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.fml.config.ConfigTracker; import net.minecraftforge.fml.config.ModConfig; -import net.minecraftforge.fml.event.lifecycle.GatherDataEvent; import net.minecraftforge.fml.event.lifecycle.IModBusEvent; -import net.minecraftforge.fml.event.lifecycle.ModLifecycleEvent; import net.minecraftforge.fml.loading.FMLLoader; import net.minecraftforge.fml.loading.FMLPaths; import net.minecraftforge.fml.loading.LoadingModList; @@ -48,7 +44,6 @@ import net.minecraftforge.versions.forge.ForgeVersion; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.nio.file.Path; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -56,7 +51,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.Executor; diff --git a/src/main/java/net/minecraftforge/fml/ModLoadingException.java b/src/main/java/net/minecraftforge/fml/ModLoadingException.java index 73fb4a972..324967382 100644 --- a/src/main/java/net/minecraftforge/fml/ModLoadingException.java +++ b/src/main/java/net/minecraftforge/fml/ModLoadingException.java @@ -20,9 +20,7 @@ package net.minecraftforge.fml; import com.google.common.collect.Streams; -import net.minecraft.util.StringUtils; import net.minecraftforge.fml.loading.EarlyLoadingException; -import net.minecraftforge.fml.loading.moddiscovery.ModInfo; import net.minecraftforge.forgespi.language.IModInfo; import java.util.Arrays; @@ -34,6 +32,7 @@ import java.util.stream.Stream; */ public class ModLoadingException extends RuntimeException { + private static final long serialVersionUID = 2048947398536935507L; /** * Mod Info for mod with issue */ diff --git a/src/main/java/net/minecraftforge/fml/VersionChecker.java b/src/main/java/net/minecraftforge/fml/VersionChecker.java index 29d2613ec..cc9ad22d4 100644 --- a/src/main/java/net/minecraftforge/fml/VersionChecker.java +++ b/src/main/java/net/minecraftforge/fml/VersionChecker.java @@ -21,7 +21,6 @@ package net.minecraftforge.fml; import com.google.common.io.ByteStreams; import com.google.gson.Gson; -import net.minecraftforge.common.ForgeConfig; import net.minecraftforge.fml.loading.FMLConfig; import net.minecraftforge.fml.loading.moddiscovery.ModInfo; import net.minecraftforge.forgespi.language.IModInfo; @@ -45,23 +44,6 @@ import java.util.concurrent.ConcurrentHashMap; import javax.annotation.Nonnull; import javax.annotation.Nullable; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - import static net.minecraftforge.fml.VersionChecker.Status.*; public class VersionChecker @@ -191,7 +173,6 @@ public class VersionChecker throw new IOException("Too many redirects while trying to fetch " + url); } - @SuppressWarnings("UnstableApiUsage") private void process(IModInfo mod) { Status status = PENDING; diff --git a/src/main/java/net/minecraftforge/fml/client/ClientHooks.java b/src/main/java/net/minecraftforge/fml/client/ClientHooks.java index aa8421d3b..7f386e11d 100644 --- a/src/main/java/net/minecraftforge/fml/client/ClientHooks.java +++ b/src/main/java/net/minecraftforge/fml/client/ClientHooks.java @@ -35,7 +35,6 @@ import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.gui.screen.MultiplayerScreen; -import net.minecraft.client.gui.screen.WorldSelectionScreen; import net.minecraft.client.multiplayer.PlayerController; import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.client.event.ClientPlayerNetworkEvent; @@ -52,7 +51,6 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.MarkerManager; -import com.google.common.base.CharMatcher; import com.google.common.base.MoreObjects; import com.google.common.base.Strings; @@ -185,6 +183,7 @@ public class ClientHooks return description.endsWith(":NOFML§r") ? description.substring(0, description.length() - 8)+"§r" : description; } + @SuppressWarnings("resource") static File getSavesDir() { return new File(Minecraft.getInstance().gameDir, "saves"); diff --git a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java index b45304308..dffb32f22 100644 --- a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java +++ b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java @@ -23,7 +23,6 @@ import static net.minecraftforge.fml.Logging.CORE; import static net.minecraftforge.fml.loading.LogMarkers.LOADING; import java.io.File; -import java.text.SimpleDateFormat; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.CompletableFuture; @@ -32,8 +31,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.BiConsumer; import java.util.function.Consumer; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.CrashReportCategory; import net.minecraft.resources.IFutureReloadListener; import net.minecraft.resources.IPackNameDecorator; import net.minecraft.resources.IReloadableResourceManager; @@ -42,7 +39,6 @@ import net.minecraft.resources.ResourcePackInfo; import net.minecraft.resources.ResourcePackList; import net.minecraft.util.datafix.codec.DatapackCodec; import net.minecraftforge.fml.*; -import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/net/minecraftforge/fml/client/EarlyLoaderGUI.java b/src/main/java/net/minecraftforge/fml/client/EarlyLoaderGUI.java index 38a4cbc8a..d77287c6d 100644 --- a/src/main/java/net/minecraftforge/fml/client/EarlyLoaderGUI.java +++ b/src/main/java/net/minecraftforge/fml/client/EarlyLoaderGUI.java @@ -45,6 +45,7 @@ public class EarlyLoaderGUI { this.window = window; } + @SuppressWarnings("deprecation") private void setupMatrix() { RenderSystem.clear(256, Minecraft.IS_RUNNING_ON_MAC); RenderSystem.matrixMode(5889); @@ -63,6 +64,7 @@ public class EarlyLoaderGUI { renderMessages(); } + @SuppressWarnings("deprecation") void renderTick() { if (handledElsewhere) return; int guiScale = window.calcGuiScale(0, false); @@ -116,6 +118,7 @@ public class EarlyLoaderGUI { renderMessage(memory, memorycolour, 1, 1.0f); } + @SuppressWarnings("deprecation") void renderMessage(final String message, final float[] colour, int line, float alpha) { GlStateManager.enableClientState(GL11.GL_VERTEX_ARRAY); ByteBuffer charBuffer = MemoryUtil.memAlloc(message.length() * 270); @@ -124,9 +127,9 @@ public class EarlyLoaderGUI { RenderSystem.enableBlend(); RenderSystem.disableTexture(); - // STBEasyFont's quads are in reverse order or what OGGL expects, so it gets culled for facing the wrong way. + // STBEasyFont's quads are in reverse order or what OGGL expects, so it gets culled for facing the wrong way. // So Disable culling https://github.com/MinecraftForge/MinecraftForge/pull/6824 - RenderSystem.disableCull(); + RenderSystem.disableCull(); GL14.glBlendColor(0,0,0, alpha); RenderSystem.blendFunc(GlStateManager.SourceFactor.CONSTANT_ALPHA, GlStateManager.DestFactor.ONE_MINUS_CONSTANT_ALPHA); RenderSystem.color3f(colour[0],colour[1],colour[2]); diff --git a/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java b/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java index c1bf4c20a..5b44e23c9 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java @@ -20,28 +20,18 @@ package net.minecraftforge.fml.client.gui; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; -import net.minecraft.util.IReorderingProcessor; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.vector.Matrix4f; -import net.minecraft.util.text.ITextProperties; -import net.minecraftforge.client.event.RenderTooltipEvent; -import net.minecraftforge.common.MinecraftForge; - import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; -import java.util.ArrayList; -import java.util.List; - import javax.annotation.Nonnull; /** @@ -157,6 +147,7 @@ public class GuiUtils * @param rightBorder the size of the box's right border * @param zLevel the zLevel to draw at */ + @SuppressWarnings("deprecation") public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) { @@ -426,6 +417,7 @@ public class GuiUtils } */ + @SuppressWarnings("deprecation") public static void drawGradientRect(Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { float startAlpha = (float)(startColor >> 24 & 255) / 255.0F; diff --git a/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java b/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java index 36b77d6d2..6f8941440 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java @@ -409,6 +409,7 @@ public class ModListScreen extends Screen List lines = new ArrayList<>(); VersionChecker.CheckResult vercheck = VersionChecker.getResult(selectedMod); + @SuppressWarnings("resource") Pair logoData = selectedMod.getLogoFile().map(logoFile-> { TextureManager tm = this.field_230706_i_.getTextureManager(); diff --git a/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java b/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java index 64a9676dd..e877ebe06 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java @@ -22,7 +22,6 @@ package net.minecraftforge.fml.client.gui.widget; import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.widget.button.Button; -import net.minecraft.util.text.IFormattableTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.fml.client.gui.GuiUtils; diff --git a/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java b/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java index dd501e8eb..26aef4bae 100644 --- a/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java +++ b/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java @@ -88,7 +88,7 @@ public class FMLPlayMessages SpawnEntity(Entity e) { this.entity = e; - this.typeId = Registry.ENTITY_TYPE.getId(e.getType()); + this.typeId = Registry.ENTITY_TYPE.getId(e.getType()); //TODO: Codecs this.entityId = e.getEntityId(); this.uuid = e.getUniqueID(); this.posX = e.getPosX(); diff --git a/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java b/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java index 229e54783..defd8f6fc 100644 --- a/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java +++ b/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java @@ -55,13 +55,12 @@ import org.apache.maven.artifact.versioning.ArtifactVersion; import com.google.common.io.ByteStreams; import com.google.common.io.Files; -import net.minecraftforge.versions.forge.ForgeVersion; import net.minecraftforge.fml.loading.FMLEnvironment; public class LibraryManager { private static final Logger LOGGER = LogManager.getLogger(); - + public static final boolean DISABLE_EXTERNAL_MANIFEST = Boolean.parseBoolean(System.getProperty("forge.disable_external_manifest", "false")); public static final boolean ENABLE_AUTO_MOD_MOVEMENT = Boolean.parseBoolean(System.getProperty("forge.enable_auto_mod_movement", "false")); private static final String LIBRARY_DIRECTORY_OVERRIDE = System.getProperty("forge.lib_folder", null); @@ -447,7 +446,6 @@ public class LibraryManager { List list = new ArrayList<>(); - @SuppressWarnings("unchecked") Map args = Collections.emptyMap(); // TODO Launch args - do we need this? (Map)Launcher.INSTANCE.blackboard().get("launchArgs"); String extraMods = args.get("--mods"); if (extraMods != null) diff --git a/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java b/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java index 14a4ae737..f648abe7f 100644 --- a/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java +++ b/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java @@ -40,8 +40,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; -import net.minecraftforge.versions.forge.ForgeVersion; - public class ModList { private static final Logger LOGGER = LogManager.getLogger(); diff --git a/src/main/java/net/minecraftforge/fml/server/ServerModLoader.java b/src/main/java/net/minecraftforge/fml/server/ServerModLoader.java index 50f5254e9..af763acae 100644 --- a/src/main/java/net/minecraftforge/fml/server/ServerModLoader.java +++ b/src/main/java/net/minecraftforge/fml/server/ServerModLoader.java @@ -19,17 +19,12 @@ package net.minecraftforge.fml.server; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.CrashReportCategory; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.*; -import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/net/minecraftforge/server/command/CommandEntity.java b/src/main/java/net/minecraftforge/server/command/CommandEntity.java index af6a47d87..449222c22 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandEntity.java +++ b/src/main/java/net/minecraftforge/server/command/CommandEntity.java @@ -37,13 +37,11 @@ import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.command.ISuggestionProvider; import net.minecraft.command.arguments.DimensionArgument; -import net.minecraft.entity.Entity; import net.minecraft.util.RegistryKey; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TranslationTextComponent; -import net.minecraft.world.DimensionType; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.registries.ForgeRegistries; diff --git a/src/main/java/net/minecraftforge/server/command/CommandModList.java b/src/main/java/net/minecraftforge/server/command/CommandModList.java index 1bbaddae3..402ca7081 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandModList.java +++ b/src/main/java/net/minecraftforge/server/command/CommandModList.java @@ -24,9 +24,6 @@ import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.fml.ModList; -import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo; -import net.minecraftforge.fml.loading.moddiscovery.ModInfo; - import java.util.stream.Collectors; public class CommandModList { diff --git a/src/main/java/net/minecraftforge/server/permission/DefaultPermissionHandler.java b/src/main/java/net/minecraftforge/server/permission/DefaultPermissionHandler.java index 73d28f181..ef849e918 100644 --- a/src/main/java/net/minecraftforge/server/permission/DefaultPermissionHandler.java +++ b/src/main/java/net/minecraftforge/server/permission/DefaultPermissionHandler.java @@ -22,7 +22,6 @@ package net.minecraftforge.server.permission; import com.mojang.authlib.GameProfile; import net.minecraft.server.MinecraftServer; import net.minecraftforge.fml.server.ServerLifecycleHooks; -import net.minecraftforge.fml.server.ServerModLoader; import net.minecraftforge.server.permission.context.IContext; import javax.annotation.Nullable; diff --git a/src/main/java/net/minecraftforge/server/permission/context/AreaContext.java b/src/main/java/net/minecraftforge/server/permission/context/AreaContext.java index 4a8117357..16ecb8951 100644 --- a/src/main/java/net/minecraftforge/server/permission/context/AreaContext.java +++ b/src/main/java/net/minecraftforge/server/permission/context/AreaContext.java @@ -35,6 +35,7 @@ public class AreaContext extends PlayerContext area = Preconditions.checkNotNull(aabb, "AxisAlignedBB can't be null in AreaContext!"); } + @SuppressWarnings("unchecked") @Override @Nullable public T get(ContextKey key) diff --git a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java index cfdf058c9..3931c7b13 100644 --- a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java +++ b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java @@ -70,7 +70,6 @@ import net.minecraft.tags.BlockTags; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.StringTextComponent; -import net.minecraft.world.biome.Biomes; import net.minecraftforge.client.model.generators.BlockStateProvider; import net.minecraftforge.client.model.generators.ConfiguredModel; import net.minecraftforge.client.model.generators.ItemModelProvider; @@ -181,8 +180,6 @@ public class DataGeneratorTest public static class Tags extends BlockTagsProvider { - private Set filter; - public Tags(DataGenerator gen, ExistingFileHelper existingFileHelper) { super(gen, MODID, existingFileHelper); diff --git a/src/test/java/net/minecraftforge/debug/item/CustomElytraTest.java b/src/test/java/net/minecraftforge/debug/item/CustomElytraTest.java index 019f15980..06886c1fe 100644 --- a/src/test/java/net/minecraftforge/debug/item/CustomElytraTest.java +++ b/src/test/java/net/minecraftforge/debug/item/CustomElytraTest.java @@ -23,23 +23,17 @@ import net.minecraft.block.DispenserBlock; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.AbstractClientPlayerEntity; import net.minecraft.client.renderer.entity.IEntityRenderer; -import net.minecraft.client.renderer.entity.PlayerRenderer; import net.minecraft.client.renderer.entity.layers.ElytraLayer; -import net.minecraft.client.renderer.entity.model.ElytraModel; import net.minecraft.client.renderer.entity.model.PlayerModel; import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.*; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.thread.EffectiveSide; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; diff --git a/src/userdev/java/net/minecraftforge/userdev/FMLDevClientLaunchProvider.java b/src/userdev/java/net/minecraftforge/userdev/FMLDevClientLaunchProvider.java index 810aa9b6c..34f24fa25 100644 --- a/src/userdev/java/net/minecraftforge/userdev/FMLDevClientLaunchProvider.java +++ b/src/userdev/java/net/minecraftforge/userdev/FMLDevClientLaunchProvider.java @@ -22,7 +22,6 @@ package net.minecraftforge.userdev; import cpw.mods.modlauncher.api.IEnvironment; import cpw.mods.modlauncher.api.ILaunchHandlerService; import cpw.mods.modlauncher.api.ITransformingClassLoader; -import cpw.mods.modlauncher.api.ITransformingClassLoaderBuilder; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.loading.FMLCommonLaunchHandler; import net.minecraftforge.fml.loading.LibraryFinder; diff --git a/src/userdev/java/net/minecraftforge/userdev/FMLUserdevClientLaunchProvider.java b/src/userdev/java/net/minecraftforge/userdev/FMLUserdevClientLaunchProvider.java index b7fc1f428..e5ed47b86 100644 --- a/src/userdev/java/net/minecraftforge/userdev/FMLUserdevClientLaunchProvider.java +++ b/src/userdev/java/net/minecraftforge/userdev/FMLUserdevClientLaunchProvider.java @@ -21,10 +21,7 @@ package net.minecraftforge.userdev; import cpw.mods.modlauncher.api.ILaunchHandlerService; import cpw.mods.modlauncher.api.ITransformingClassLoader; -import cpw.mods.modlauncher.api.ITransformingClassLoaderBuilder; import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.loading.LibraryFinder; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger;