From 37016ca77f8b05163d70c8edbca79e033a16523a Mon Sep 17 00:00:00 2001 From: tterrag Date: Fri, 29 Mar 2019 16:58:33 -0400 Subject: [PATCH] Remove remaining deprecations, improve a few patch comments --- .../block/state/IBlockState.java.patch | 10 ++++--- .../model/ItemTextureQuadConverter.java | 28 ------------------- .../common/extensions/IForgeBlockState.java | 1 - .../animation/AnimationStateMachine.java | 6 ---- .../event/world/BlockEvent.java | 3 -- 5 files changed, 6 insertions(+), 42 deletions(-) diff --git a/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch b/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch index 01fa9b25f..dd3c34a69 100644 --- a/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch +++ b/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch @@ -9,19 +9,21 @@ ThreadLocal> field_208776_a = ThreadLocal.withInitial(() -> { Object2ByteOpenHashMap object2byteopenhashmap = new Object2ByteOpenHashMap<>(); object2byteopenhashmap.defaultReturnValue((byte)127); -@@ -97,6 +97,7 @@ +@@ -97,6 +97,8 @@ return this.func_177230_c().func_149750_m(this); } -+ @Deprecated //Forge: Use position sensitive version ++ /** @deprecated use {@link IBlockState#isAir(IBlockReader, BlockPos) */ ++ @Deprecated default boolean func_196958_f() { return this.func_177230_c().func_196261_e(this); } -@@ -109,6 +110,7 @@ +@@ -109,6 +111,8 @@ return this.func_177230_c().func_180659_g(this, p_185909_1_, p_185909_2_); } -+ @Deprecated //Forge: Use position sensitive version ++ /** @deprecated use {@link IBlockState#rotate(IWorld, BlockPos, Rotation) */ ++ @Deprecated default IBlockState func_185907_a(Rotation p_185907_1_) { return this.func_177230_c().func_185499_a(this, p_185907_1_); } diff --git a/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java b/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java index f5306498e..5aeafa5f7 100644 --- a/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java +++ b/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java @@ -39,13 +39,6 @@ public final class ItemTextureQuadConverter // non-instantiable } - /** @deprecated use {@link #convertTexture(VertexFormat, TRSRTransformation, TextureAtlasSprite, TextureAtlasSprite, float, EnumFacing, int, int)}*/ - @Deprecated // TODO: remove - public static List convertTexture(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color) - { - return convertTexture(format, transform, template, sprite, z, facing, color, -1); - } - /** * Takes a texture and converts it into BakedQuads. * The conversion is done by scanning the texture horizontally and vertically and creating "strips" of the texture. @@ -67,13 +60,6 @@ public final class ItemTextureQuadConverter return horizontal.size() >= vertical.size() ? horizontal : vertical; } - /** @deprecated use {@link #convertTextureHorizontal(VertexFormat, TRSRTransformation, TextureAtlasSprite, TextureAtlasSprite, float, EnumFacing, int, int)} */ - @Deprecated // TODO: remove - public static List convertTextureHorizontal(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color) - { - return convertTextureHorizontal(format, transform, template, sprite, z, facing, color, -1); - } - /** * Scans a texture and converts it into a list of horizontal strips stacked on top of each other. * The height of the strips is as big as possible. @@ -145,13 +131,6 @@ public final class ItemTextureQuadConverter return quads; } - /** @deprecated use {@link #convertTextureVertical(VertexFormat, TRSRTransformation, TextureAtlasSprite, TextureAtlasSprite, float, EnumFacing, int, int)} */ - @Deprecated // TODO: remove - public static List convertTextureVertical(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color) - { - return convertTextureVertical(format, transform, template, sprite, z, facing, color, -1); - } - /** * Scans a texture and converts it into a list of vertical strips stacked next to each other from left to right. * The width of the strips is as big as possible. @@ -228,13 +207,6 @@ public final class ItemTextureQuadConverter return (color >> 24 & 255) / 255f > 0.1f; } - /** @deprecated use {@link #genQuad(VertexFormat, TRSRTransformation, float, float, float, float, float, TextureAtlasSprite, EnumFacing, int, int)} */ - @Deprecated // TODO: remove - public static UnpackedBakedQuad genQuad(VertexFormat format, TRSRTransformation transform, float x1, float y1, float x2, float y2, float z, TextureAtlasSprite sprite, EnumFacing facing, int color) - { - return genQuad(format, transform, x1, y1, x2, y2, z, sprite, facing, color, -1); - } - /** * Generates a Front/Back quad for an itemmodel. Therefore only supports facing NORTH and SOUTH. * Coordinates are [0,16] to match the usual coordinates used in TextureAtlasSprites diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java index 3b4dd423d..971830deb 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java @@ -571,7 +571,6 @@ public interface IForgeBlockState return getBlockState().getBlock().rotate(getBlockState(), world, pos, direction); } - /** * Determines the amount of enchanting power this block can provide to an enchanting table. * @param world The World diff --git a/src/main/java/net/minecraftforge/common/model/animation/AnimationStateMachine.java b/src/main/java/net/minecraftforge/common/model/animation/AnimationStateMachine.java index f86eeb10e..90e41f5d3 100644 --- a/src/main/java/net/minecraftforge/common/model/animation/AnimationStateMachine.java +++ b/src/main/java/net/minecraftforge/common/model/animation/AnimationStateMachine.java @@ -93,12 +93,6 @@ public final class AnimationStateMachine implements IAnimationStateMachine } }); - @Deprecated - public AnimationStateMachine(ImmutableMap parameters, ImmutableMap clips, ImmutableList states, ImmutableMap transitions, String startState) - { - this(parameters, clips, states, ImmutableMultimap.copyOf(Multimaps.newSetMultimap(Maps.transformValues(transitions, ImmutableSet::of), Sets::newHashSet)), startState); - } - public AnimationStateMachine(ImmutableMap parameters, ImmutableMap clips, ImmutableList states, ImmutableMultimap transitions, String startState) { this.parameters = parameters; diff --git a/src/main/java/net/minecraftforge/event/world/BlockEvent.java b/src/main/java/net/minecraftforge/event/world/BlockEvent.java index e873be9f3..c57316045 100644 --- a/src/main/java/net/minecraftforge/event/world/BlockEvent.java +++ b/src/main/java/net/minecraftforge/event/world/BlockEvent.java @@ -194,9 +194,6 @@ public class BlockEvent extends Event } public EntityPlayer getPlayer() { return player; } - @Nonnull - @Deprecated - public ItemStack getItemInHand() { return player.getHeldItem(hand); } public BlockSnapshot getBlockSnapshot() { return blockSnapshot; } public IBlockState getPlacedBlock() { return placedBlock; } public IBlockState getPlacedAgainst() { return placedAgainst; }