diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index cf7b2b8e8..4a41c45a2 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -463,22 +463,6 @@ public class ForgeHooksClient return model; } - private static final FloatBuffer matrixBuf = BufferUtils.createFloatBuffer(16); - - @Deprecated - public static void multiplyCurrentGlMatrix(Matrix4f matrix) - { - matrixBuf.clear(); - float[] t = new float[4]; - for(int i = 0; i < 4; i++) - { - matrix.getColumn(i, t); - matrixBuf.put(t); - } - matrixBuf.flip(); - glMultMatrixf(matrixBuf); - } - // moved and expanded from WorldVertexBufferUploader.draw public static void preDraw(Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer) diff --git a/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java b/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java index d883aa759..e29e081db 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java +++ b/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java @@ -72,9 +72,6 @@ public final class ModelDynBucket implements IModelGeometry private static final float NORTH_Z_FLUID = 7.498f / 16f; private static final float SOUTH_Z_FLUID = 8.502f / 16f; - @Deprecated - public static final ModelDynBucket MODEL = new ModelDynBucket(); - @Nonnull private final Fluid fluid; @@ -82,12 +79,6 @@ public final class ModelDynBucket implements IModelGeometry private final boolean tint; private final boolean coverIsMask; - @Deprecated - public ModelDynBucket() - { - this(Fluids.EMPTY, false, true, false); - } - public ModelDynBucket(Fluid fluid, boolean flipGas, boolean tint, boolean coverIsMask) { this.fluid = fluid; @@ -97,24 +88,12 @@ public final class ModelDynBucket implements IModelGeometry } /** - * Sets the fluid in the model. - * "fluid" - Name of the fluid in the fluid registry. - * "flipGas" - If "true" the model will be flipped upside down if the fluid is lighter than air. If "false" it won't. - * "applyTint" - If "true" the model will tint the fluid quads according to the fluid's base color. - *

- * If the fluid can't be found, water is used. + * Returns a new ModelDynBucket representing the given fluid, but with the same + * other properties (flipGas, tint, coverIsMask). */ - @Deprecated - public ModelDynBucket withFluid(String newFluid) + public ModelDynBucket withFluid(Fluid newFluid) { - ResourceLocation fluidName = new ResourceLocation(newFluid); - Fluid fluid = ForgeRegistries.FLUIDS.getValue(fluidName); - - if (fluid == null) - fluid = this.fluid; - - // create new model with correct liquid - return new ModelDynBucket(fluid, flipGas, tint, coverIsMask); + return new ModelDynBucket(newFluid, flipGas, tint, coverIsMask); } @Nullable @@ -438,7 +417,7 @@ public final class ModelDynBucket implements IModelGeometry if (!model.cache.containsKey(name)) { - ModelDynBucket parent = model.parent.withFluid(name); + ModelDynBucket parent = model.parent.withFluid(fluid); IBakedModel bakedModel = parent.bake(model.owner, bakery, ModelLoader.defaultTextureGetter(), new SimpleModelTransform(model.transforms), model.getOverrides(), new ResourceLocation("forge:bucket_override")); model.cache.put(name, bakedModel); return bakedModel; diff --git a/src/main/java/net/minecraftforge/client/model/generators/ModelFile.java b/src/main/java/net/minecraftforge/client/model/generators/ModelFile.java index f2a7444dc..4252658a7 100644 --- a/src/main/java/net/minecraftforge/client/model/generators/ModelFile.java +++ b/src/main/java/net/minecraftforge/client/model/generators/ModelFile.java @@ -69,11 +69,6 @@ public abstract class ModelFile { public static class ExistingModelFile extends ModelFile { private final ExistingFileHelper existingHelper; - @Deprecated - public ExistingModelFile(String location, ExistingFileHelper existingHelper) { - this(new ResourceLocation(location), existingHelper); - } - public ExistingModelFile(ResourceLocation location, ExistingFileHelper existingHelper) { super(location); this.existingHelper = existingHelper; diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java b/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java index c911e91da..19ba0d780 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java @@ -254,30 +254,6 @@ public class LightUtil } } - private static IVertexConsumer tessellator = null; - @Deprecated // TODO: remove - public static IVertexConsumer getTessellator() - { - if(tessellator == null) - { - Tessellator tes = Tessellator.getInstance(); - BufferBuilder wr = tes.getBuffer(); - tessellator = new VertexBufferConsumer(wr); - } - return tessellator; - } - - private static ItemConsumer itemConsumer = null; - @Deprecated // TODO: remove - public static ItemConsumer getItemConsumer() - { - if(itemConsumer == null) - { - itemConsumer = new ItemConsumer(getTessellator()); - } - return itemConsumer; - } - private static final class ItemPipeline { final VertexBufferConsumer bufferConsumer; diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index 36ccf3d98..4f85be4d2 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -77,24 +77,6 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public static final String VERSION_CHECK_CAT = "version_checking"; private static final Logger LOGGER = LogManager.getLogger(); private static final Marker FORGEMOD = MarkerManager.getMarker("FORGEMOD"); - //TODO: Remove all of these, use ForgeConfig instead - @Deprecated - public static int[] blendRanges = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 }; - @Deprecated - public static boolean disableVersionCheck = false; - @Deprecated - public static boolean forgeLightPipelineEnabled = true; - @Deprecated - public static boolean zoomInMissingModelTextInGui = false; - @Deprecated - public static boolean disableStairSlabCulling = false; // Also known as the "DontCullStairsBecauseIUseACrappyTexturePackThatBreaksBasicBlockShapesSoICantTrustBasicBlockCulling" flag - @Deprecated - public static boolean alwaysSetupTerrainOffThread = false; // In WorldRenderer.setupTerrain, always force the chunk render updates to be queued to the thread - @Deprecated - public static boolean logCascadingWorldGeneration = true; // see Chunk#logCascadingWorldGeneration() - @Deprecated - public static boolean fixVanillaCascading = false; // There are various places in vanilla that cause cascading worldgen. Enabling this WILL change where blocks are placed to prevent this. - // DO NOT contact Forge about worldgen not 'matching' vanilla if this flag is set. private static ForgeMod INSTANCE; public static ForgeMod getInstance() diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index e759f92ce..3a4b2fa40 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -136,26 +136,6 @@ public interface IForgeBlock return false; } - //TODO: remove in 1.15 - /** - * Check if the face of a block should block rendering. - * - * Faces which are fully opaque should return true, faces with transparency - * or faces which do not span the full size of the block should return false. - * - * @param state The current block state - * @param world The current world - * @param pos Block position in world - * @param face The side to check - * @return True if the block is opaque on the specified side. - * @deprecated This is no longer used for rendering logic. - */ - @Deprecated - default boolean doesSideBlockRendering(BlockState state, ILightReader world, BlockPos pos, Direction face) - { - return state.isOpaqueCube(world, pos); - } - /** * Determines if this block should set fire and deal fire damage * to entities coming into contact with it. diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java index 399cd05f3..f9a9bb25c 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java @@ -102,25 +102,6 @@ public interface IForgeBlockState return getBlockState().getBlock().isLadder(getBlockState(), world, pos, entity); } - //TODO: remove in 1.15 - /** - * Check if the face of a block should block rendering. - * - * Faces which are fully opaque should return true, faces with transparency - * or faces which do not span the full size of the block should return false. - * - * @param world The current world - * @param pos Block position in world - * @param face The side to check - * @return True if the block is opaque on the specified side. - * @deprecated This is no longer used for rendering logic. - */ - @Deprecated - default boolean doesSideBlockRendering(ILightReader world, BlockPos pos, Direction face) - { - return getBlockState().getBlock().doesSideBlockRendering(getBlockState(), world, pos, face); - } - /** * Called throughout the code as a replacement for block instanceof BlockContainer * Moving this to the Block base class allows for mods that wish to extend vanilla diff --git a/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java b/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java index 3700d34e3..fb2cdb957 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java @@ -79,8 +79,8 @@ public class ItemTooltipEvent extends PlayerEvent */ @Override @Nullable - public PlayerEntity getEntityPlayer() + public PlayerEntity getPlayer() { - return super.getEntityPlayer(); + return super.getPlayer(); } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java index 49ec5fd1e..410ac49c0 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java @@ -53,17 +53,6 @@ public class PlayerEvent extends LivingEvent entityPlayer = player; } - /** - * Use {@link #getPlayer()} - * - * @return Player - */ - @Deprecated - public PlayerEntity getEntityPlayer() - { - return entityPlayer; - } - /** * @return Player */ diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java index 995456195..602c09785 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java @@ -38,7 +38,6 @@ import javax.annotation.Nullable; import static net.minecraftforge.eventbus.api.Event.Result.DEFAULT; import static net.minecraftforge.eventbus.api.Event.Result.DENY; -import net.minecraftforge.eventbus.api.Event.Result; import net.minecraftforge.fml.LogicalSide; /** @@ -317,7 +316,7 @@ public class PlayerInteractEvent extends PlayerEvent @Nonnull public ItemStack getItemStack() { - return getEntityPlayer().getHeldItem(hand); + return getPlayer().getHeldItem(hand); } /** @@ -347,7 +346,7 @@ public class PlayerInteractEvent extends PlayerEvent */ public World getWorld() { - return getEntityPlayer().getEntityWorld(); + return getPlayer().getEntityWorld(); } /** diff --git a/src/main/java/net/minecraftforge/fml/RegistryObject.java b/src/main/java/net/minecraftforge/fml/RegistryObject.java index 8c326e67a..cf2d9d366 100644 --- a/src/main/java/net/minecraftforge/fml/RegistryObject.java +++ b/src/main/java/net/minecraftforge/fml/RegistryObject.java @@ -22,10 +22,10 @@ package net.minecraftforge.fml; import net.minecraft.util.ResourceLocation; import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistryEntry; -import net.minecraftforge.registries.IRegistryDelegate; import net.minecraftforge.registries.ObjectHolderRegistry; import net.minecraftforge.registries.RegistryManager; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Objects; @@ -42,20 +42,10 @@ public final class RegistryObject> impl @Nullable private T value; - @Deprecated - public static , U extends T> RegistryObject of(final String name, Supplier> registryType) { - return of(new ResourceLocation(name), registryType); - } - public static , U extends T> RegistryObject of(final ResourceLocation name, Supplier> registryType) { return new RegistryObject<>(name, registryType); } - @Deprecated - public static , U extends T> RegistryObject of(final String name, IForgeRegistry registry) { - return of(new ResourceLocation(name), registry); - } - public static , U extends T> RegistryObject of(final ResourceLocation name, IForgeRegistry registry) { return new RegistryObject<>(name, registry); } @@ -93,11 +83,13 @@ public final class RegistryObject> impl /** * Directly retrieves the wrapped Registry Object. This value will automatically be updated when the backing registry is updated. */ - @Nullable @Override + @Nonnull public T get() { - return this.value; + T ret = this.value; + Objects.requireNonNull(ret, "Registry Object not present"); + return ret; } public void updateReference(IForgeRegistry registry) @@ -110,14 +102,6 @@ public final class RegistryObject> impl return this.name; } - /** - * @deprecated Prefer {@link #getId()} - */ - @Deprecated - public String getName() { - return getId().toString(); - } - public Stream stream() { return isPresent() ? Stream.of(get()) : Stream.of(); } diff --git a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java index 7067541ea..662f18f05 100644 --- a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java +++ b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java @@ -37,7 +37,6 @@ import java.util.function.Supplier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; @@ -145,12 +144,6 @@ public class ClientModLoader return VersionChecker.Status.UP_TO_DATE; } - @Deprecated // TODO: remove in 1.15 - public static void complete() - { - completeModLoading(); - } - public static boolean completeModLoading() { RenderSystem.disableTexture(); diff --git a/src/main/java/net/minecraftforge/fml/common/ObfuscationReflectionHelper.java b/src/main/java/net/minecraftforge/fml/common/ObfuscationReflectionHelper.java index daf2388f6..ffe08a4dc 100644 --- a/src/main/java/net/minecraftforge/fml/common/ObfuscationReflectionHelper.java +++ b/src/main/java/net/minecraftforge/fml/common/ObfuscationReflectionHelper.java @@ -64,37 +64,6 @@ public class ObfuscationReflectionHelper return FMLLoader.getNameFunction("srg").map(f->f.apply(domain, name)).orElse(name); } - /** - * Gets the value a field with the specified index in the given class. - * Note: For performance, use {@link #findField(Class, int)} if you are getting the value more than once. - *

- * Throws an exception if the field is not found or the value of the field cannot be gotten. - * - * @param classToAccess The class to find the field on. - * @param instance The instance of the {@code classToAccess}. - * @param fieldIndex The index of the field in the {@code classToAccess}. - * @param The type of the value. - * @param The type of the {@code classToAccess}. - * @return The value of the field with the specified index in the {@code classToAccess}. - * @throws UnableToAccessFieldException If there was a problem getting the field or the value. - * @deprecated Use {@link #getPrivateValue(Class, Object, String)} because field indices change a lot more often than field names do. - * TODO: Remove in 1.15 - */ - @Deprecated - @Nullable - public static T getPrivateValue(Class classToAccess, E instance, int fieldIndex) - { - try - { - return (T) findField(classToAccess, fieldIndex).get(instance); - } - catch (Exception e) - { - LOGGER.error(REFLECTION, "There was a problem getting field index {} from {}", fieldIndex, classToAccess.getName(), e); - throw new UnableToAccessFieldException(e); - } - } - /** * Gets the value a field with the specified name in the given class. * Note: For performance, use {@link #findField(Class, String)} if you are getting the value more than once. @@ -129,36 +98,6 @@ public class ObfuscationReflectionHelper } } - /** - * Sets the value a field with the specified index in the given class. - * Note: For performance, use {@link #findField(Class, int)} if you are setting the value more than once. - *

- * Throws an exception if the field is not found or the value of the field cannot be set. - * - * @param classToAccess The class to find the field on. - * @param instance The instance of the {@code classToAccess}. - * @param value The new value for the field - * @param fieldIndex The index of the field in the {@code classToAccess}. - * @param The type of the value. - * @param The type of the {@code classToAccess}. - * @throws UnableToAccessFieldException If there was a problem setting the value of the field. - * @deprecated Use {@link #setPrivateValue(Class, Object, Object, String)} because field indices change a lot more often than field names do. - * TODO: Remove in 1.15 - */ - @Deprecated - public static void setPrivateValue(@Nonnull final Class classToAccess, @Nonnull final T instance, @Nullable final E value, int fieldIndex) - { - try - { - findField(classToAccess, fieldIndex).set(instance, value); - } - catch (IllegalAccessException e) - { - LOGGER.error("There was a problem setting field index {} on type {}", fieldIndex, classToAccess.getName(), e); - throw new UnableToAccessFieldException(e); - } - } - /** * Sets the value a field with the specified name in the given class. * Note: For performance, use {@link #findField(Class, String)} if you are setting the value more than once. @@ -304,35 +243,6 @@ public class ObfuscationReflectionHelper } } - /** - * Finds a field with the specified index in the given class and makes it accessible. - * Note: For performance, store the returned value and avoid calling this repeatedly. - *

- * Throws an exception if the field is not found. - * - * @param clazz The class to find the field on. - * @param fieldIndex The index of the field on the class - * @param The type. - * @return The constructor with the specified parameters in the given class. - * @throws NullPointerException If {@code clazz} is null. - * @throws UnableToFindFieldException If the field could not be found. - * @deprecated Use {@link #findField(Class, String)} because field indices change a lot more often than field names do. - * TODO: Remove in 1.15 - */ - @Deprecated - @Nonnull - public static Field findField(final Class clazz, final int fieldIndex) { - Preconditions.checkNotNull(clazz, "Class to find field on cannot be null."); - - try { - final Field f = clazz.getDeclaredFields()[fieldIndex]; - f.setAccessible(true); - return f; - } catch (Exception e) { - throw new UnableToFindFieldException(e); - } - } - public static class UnableToAccessFieldException extends RuntimeException { private UnableToAccessFieldException(Exception e) diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistry.java b/src/main/java/net/minecraftforge/registries/ForgeRegistry.java index 5b1399a96..7574eb838 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistry.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistry.java @@ -395,12 +395,6 @@ public class ForgeRegistry> implements IForgeRe return ret; } - @Deprecated //Public for ByteByfUtils only! - public V getRaw(int id) - { - return this.ids.get(id); - } - void addAlias(ResourceLocation from, ResourceLocation to) { if (this.isLocked()) diff --git a/src/main/java/net/minecraftforge/registries/GameData.java b/src/main/java/net/minecraftforge/registries/GameData.java index 94aaa01dc..e4ed6c15e 100644 --- a/src/main/java/net/minecraftforge/registries/GameData.java +++ b/src/main/java/net/minecraftforge/registries/GameData.java @@ -969,15 +969,6 @@ public class GameData } } - /** - * @deprecated Use {@link #checkPrefix(String, boolean)}. - */ - @Deprecated - public static ResourceLocation checkPrefix(String name) - { - return checkPrefix(name, true); - } - /** * Check a name for a domain prefix, and if not present infer it from the * current active mod container. diff --git a/src/main/java/net/minecraftforge/server/timings/ForgeTimings.java b/src/main/java/net/minecraftforge/server/timings/ForgeTimings.java index d4ca83f92..555b597da 100644 --- a/src/main/java/net/minecraftforge/server/timings/ForgeTimings.java +++ b/src/main/java/net/minecraftforge/server/timings/ForgeTimings.java @@ -68,13 +68,4 @@ public class ForgeTimings return sum / rawTimingData.length; } - - /** - * Returns a copy of the raw timings data collected by the tracker - * @return The raw timing data - * @deprecated Added for compatibility, remove in 1.13 - */ - public int[] getRawTimingData(){ - return Arrays.copyOfRange(rawTimingData, 0, rawTimingData.length); - } } diff --git a/src/test/java/net/minecraftforge/debug/misc/ContainerTypeTest.java b/src/test/java/net/minecraftforge/debug/misc/ContainerTypeTest.java index 3abaf4f96..6c3bf94cd 100644 --- a/src/test/java/net/minecraftforge/debug/misc/ContainerTypeTest.java +++ b/src/test/java/net/minecraftforge/debug/misc/ContainerTypeTest.java @@ -115,7 +115,7 @@ public class ContainerTypeTest if (event.getWorld().getBlockState(event.getPos()).getBlock() == Blocks.SPONGE) { String text = "Hello World!"; - NetworkHooks.openGui((ServerPlayerEntity) event.getEntityPlayer(), new INamedContainerProvider() + NetworkHooks.openGui((ServerPlayerEntity) event.getPlayer(), new INamedContainerProvider() { @Override public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_)