Skip to content

Commit

Permalink
Handle some deprecated for removal methods
Browse files Browse the repository at this point in the history
The two copper blocks just override both methods now, bit redundant but not too much work
The two JEI ones were just missed in the JEI update
  • Loading branch information
KnightMiner committed May 1, 2022
1 parent 531defd commit 92f1a27
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public ResourceLocation getUid() {
return TConstructJEIConstants.SEVERING.getUid();
}

@SuppressWarnings("removal")
@Override
public Class<? extends SeveringRecipe> getRecipeClass() {
return SeveringRecipe.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public Class<TinkerStationContainerMenu> getContainerClass() {
return TinkerStationContainerMenu.class;
}

@SuppressWarnings("removal")
@Override
public Class<IDisplayModifierRecipe> getRecipeClass() {
return IDisplayModifierRecipe.class;
}

@SuppressWarnings("removal")
@Override
public ResourceLocation getRecipeCategoryUid() {
return TConstructJEIConstants.MODIFIERS.getUid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.WeatheringCopper.WeatherState;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.ToolAction;
import net.minecraftforge.common.ToolActions;
import org.jetbrains.annotations.Nullable;
import slimeknights.tconstruct.common.TinkerTags;
import slimeknights.tconstruct.shared.TinkerCommons;

Expand All @@ -23,6 +25,17 @@ protected boolean verticalConnect(BlockState state) {
return state.is(TinkerTags.Blocks.COPPER_PLATFORMS);
}

@Nullable
@Override
public BlockState getToolModifiedState(BlockState state, UseOnContext context, ToolAction toolAction, boolean simulate) {
if (ToolActions.AXE_WAX_OFF.equals(toolAction)) {
return TinkerCommons.copperPlatform.get(age).withPropertiesOf(state);
}
return null;
}

@Deprecated
@SuppressWarnings("removal")
@Override
public BlockState getToolModifiedState(BlockState state, Level world, BlockPos pos, Player player, ItemStack stack, ToolAction toolAction) {
if (ToolActions.AXE_WAX_OFF.equals(toolAction)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.WeatheringCopper;
import net.minecraft.world.level.block.state.BlockState;
Expand Down Expand Up @@ -74,6 +75,20 @@ private static WeatherState getPrevious(WeatherState original) {
};
}

@org.jetbrains.annotations.Nullable
@Override
public BlockState getToolModifiedState(BlockState state, UseOnContext context, ToolAction toolAction, boolean simulate) {
if (ToolActions.AXE_SCRAPE.equals(toolAction)) {
WeatherState prev = getPrevious(age);
if (prev != null) {
return TinkerCommons.copperPlatform.get(prev).withPropertiesOf(state);
}
}
return null;
}

@Deprecated
@SuppressWarnings("removal")
@Override
public BlockState getToolModifiedState(BlockState state, Level world, BlockPos pos, Player player, ItemStack stack, ToolAction toolAction) {
if (ToolActions.AXE_SCRAPE.equals(toolAction)) {
Expand Down

0 comments on commit 92f1a27

Please sign in to comment.