From 9cb7091ce7ee47624339ace9d992268eb1f83fcd Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Mon, 2 May 2022 16:21:56 +0100 Subject: [PATCH] Fix several deprecated warnings --- .../computercraft/shared/computer/blocks/BlockComputer.java | 2 ++ .../shared/peripheral/diskdrive/BlockDiskDrive.java | 2 ++ .../shared/peripheral/modem/wireless/BlockWirelessModem.java | 2 ++ .../computercraft/shared/peripheral/monitor/BlockMonitor.java | 2 ++ .../computercraft/shared/peripheral/printer/BlockPrinter.java | 2 ++ .../computercraft/shared/peripheral/speaker/BlockSpeaker.java | 2 ++ .../computercraft/shared/turtle/FurnaceRefuelHandler.java | 2 +- .../dan200/computercraft/shared/turtle/blocks/BlockTurtle.java | 2 ++ 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index 0a6b73cc9..61bdc76aa 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -54,6 +54,7 @@ public class BlockComputer extends BlockComputerBase @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -61,6 +62,7 @@ public class BlockComputer extends BlockComputerBase @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/BlockDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/BlockDiskDrive.java index ff9a3ac8a..e426bdcad 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/BlockDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/BlockDiskDrive.java @@ -51,6 +51,7 @@ public class BlockDiskDrive extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -58,6 +59,7 @@ public class BlockDiskDrive extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wireless/BlockWirelessModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wireless/BlockWirelessModem.java index 94889afb7..6b87f7c3a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wireless/BlockWirelessModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wireless/BlockWirelessModem.java @@ -99,6 +99,7 @@ public class BlockWirelessModem extends BlockGeneric implements IWaterLoggable @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -106,6 +107,7 @@ public class BlockWirelessModem extends BlockGeneric implements IWaterLoggable @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/BlockMonitor.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/BlockMonitor.java index a86d23128..ae77ad488 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/BlockMonitor.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/BlockMonitor.java @@ -55,6 +55,7 @@ public class BlockMonitor extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -62,6 +63,7 @@ public class BlockMonitor extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/BlockPrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/BlockPrinter.java index b86a35532..a03611816 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/BlockPrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/BlockPrinter.java @@ -52,6 +52,7 @@ public class BlockPrinter extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -59,6 +60,7 @@ public class BlockPrinter extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/BlockSpeaker.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/BlockSpeaker.java index cd0350095..0867b3a8b 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/BlockSpeaker.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/BlockSpeaker.java @@ -39,6 +39,7 @@ public class BlockSpeaker extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -46,6 +47,7 @@ public class BlockSpeaker extends BlockGeneric @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/FurnaceRefuelHandler.java b/src/main/java/dan200/computercraft/shared/turtle/FurnaceRefuelHandler.java index 9c2fa1ece..018e95067 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/FurnaceRefuelHandler.java +++ b/src/main/java/dan200/computercraft/shared/turtle/FurnaceRefuelHandler.java @@ -52,7 +52,7 @@ public final class FurnaceRefuelHandler implements TurtleRefuelEvent.Handler private static int getFuelPerItem( @Nonnull ItemStack stack ) { - return (ForgeHooks.getBurnTime( stack ) * 5) / 100; + return (ForgeHooks.getBurnTime( stack, null ) * 5) / 100; } @SubscribeEvent diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java index c0c48aede..1c5e82ca1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java @@ -75,6 +75,7 @@ public class BlockTurtle extends BlockComputerBase implements IWater @Nonnull @Override + @Deprecated public BlockState mirror( BlockState state, Mirror mirrorIn ) { return state.rotate( mirrorIn.getRotation( state.getValue( FACING ) ) ); @@ -82,6 +83,7 @@ public class BlockTurtle extends BlockComputerBase implements IWater @Nonnull @Override + @Deprecated public BlockState rotate( BlockState state, Rotation rot ) { return state.setValue( FACING, rot.rotate( state.getValue( FACING ) ) );