mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-30 21:23:00 +00:00 
			
		
		
		
	Fix all the deprecated warnings
This commit is contained in:
		| @@ -83,3 +83,8 @@ processResources | ||||
|     } | ||||
| } | ||||
|  | ||||
| gradle.projectsEvaluated { | ||||
|     tasks.withType(JavaCompile) { | ||||
|         options.compilerArgs << "-Xlint" | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -84,11 +84,13 @@ import java.util.Map; | ||||
| /////////////// | ||||
|  | ||||
| @Mod( | ||||
|     modid = "ComputerCraft", name = "ComputerCraft", version = "${version}", | ||||
|     modid = ComputerCraft.MOD_ID, name = "ComputerCraft", version = "${version}", | ||||
|     guiFactory = "dan200.computercraft.client.gui.GuiConfigCC$Factory" | ||||
| ) | ||||
| public class ComputerCraft | ||||
| { | ||||
|     public static final String MOD_ID = "ComputerCraft"; | ||||
|  | ||||
|     // GUI IDs | ||||
|     public static final int diskDriveGUIID = 100; | ||||
|     public static final int computerGUIID = 101; | ||||
| @@ -212,7 +214,7 @@ public class ComputerCraft | ||||
|     private static final Map<String, IPocketUpgrade> pocketUpgrades = new HashMap<String, IPocketUpgrade>(); | ||||
|  | ||||
|     // Implementation | ||||
|     @Mod.Instance( value = "ComputerCraft" ) | ||||
|     @Mod.Instance( value = ComputerCraft.MOD_ID ) | ||||
|     public static ComputerCraft instance; | ||||
|  | ||||
|     @SidedProxy( clientSide = "dan200.computercraft.client.proxy.ComputerCraftProxyClient", serverSide = "dan200.computercraft.server.proxy.ComputerCraftProxyServer" ) | ||||
|   | ||||
| @@ -18,7 +18,7 @@ public class GuiConfigCC extends GuiConfig | ||||
| { | ||||
|     public GuiConfigCC( GuiScreen parentScreen ) | ||||
|     { | ||||
|         super( parentScreen, getConfigElements(), "ComputerCraft", false, false, "ComputerCraft" ); | ||||
|         super( parentScreen, getConfigElements(), ComputerCraft.MOD_ID, false, false, "ComputerCraft" ); | ||||
|     } | ||||
|  | ||||
|     private static List<IConfigElement> getConfigElements() | ||||
|   | ||||
| @@ -118,6 +118,7 @@ public class TurtleMultiModel implements IBakedModel | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public ItemCameraTransforms getItemCameraTransforms() | ||||
|     { | ||||
|         return m_baseModel.getItemCameraTransforms(); | ||||
|   | ||||
| @@ -208,6 +208,7 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public ItemCameraTransforms getItemCameraTransforms() | ||||
|     { | ||||
|         return getDefaultModel().getItemCameraTransforms(); | ||||
|   | ||||
| @@ -18,14 +18,6 @@ import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.regex.Pattern; | ||||
|  | ||||
| class HTTPRequestException extends Exception { | ||||
|     private static final long serialVersionUID = 7591208619422744652L; | ||||
|  | ||||
|     public HTTPRequestException( String s ) { | ||||
|         super( s ); | ||||
|     } | ||||
| } | ||||
|  | ||||
| public class HTTPRequest | ||||
| { | ||||
|     public static URL checkURL( String urlString ) throws HTTPRequestException | ||||
|   | ||||
| @@ -0,0 +1,11 @@ | ||||
| package dan200.computercraft.core.apis; | ||||
|  | ||||
| public class HTTPRequestException extends Exception | ||||
| { | ||||
|     private static final long serialVersionUID = 7591208619422744652L; | ||||
|  | ||||
|     public HTTPRequestException( String s ) | ||||
|     { | ||||
|         super( s ); | ||||
|     } | ||||
| } | ||||
| @@ -152,6 +152,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final void neighborChanged( IBlockState state, World world, BlockPos pos, Block block ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
| @@ -208,6 +209,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
| @@ -221,12 +223,14 @@ public abstract class BlockGeneric extends Block implements | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final AxisAlignedBB getSelectedBoundingBox( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos ) | ||||
|     { | ||||
|         return getBoundingBox( state, world, pos ).offset( pos ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final AxisAlignedBB getCollisionBoundingBox( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
| @@ -254,6 +258,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final void addCollisionBoxToList( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB bigBox, @Nonnull List<AxisAlignedBB> list, Entity entity ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
| @@ -277,6 +282,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean canProvidePower( IBlockState state ) | ||||
|     { | ||||
|         return true; | ||||
| @@ -295,6 +301,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final int getStrongPower( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing oppositeSide ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
| @@ -307,6 +314,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final int getWeakPower( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing oppositeSide ) | ||||
|     { | ||||
|         return getStrongPower( state, world, pos, oppositeSide ); | ||||
| @@ -335,6 +343,7 @@ public abstract class BlockGeneric extends Block implements | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public boolean eventReceived( IBlockState state, World world, BlockPos pos, int eventID, int eventParameter ) | ||||
|     { | ||||
|         if( world.isRemote ) | ||||
|   | ||||
| @@ -59,6 +59,7 @@ public class BlockCommandComputer extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getStateFromMeta( int meta ) | ||||
|     { | ||||
|         EnumFacing dir = EnumFacing.getFront( meta & 0x7 ); | ||||
| @@ -77,6 +78,7 @@ public class BlockCommandComputer extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
|   | ||||
| @@ -62,6 +62,7 @@ public class BlockComputer extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getStateFromMeta( int meta ) | ||||
|     { | ||||
|         EnumFacing dir = EnumFacing.getFront( meta & 0x7 ); | ||||
| @@ -118,6 +119,7 @@ public class BlockComputer extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         TileEntity tile = world.getTileEntity( pos ); | ||||
|   | ||||
| @@ -92,6 +92,7 @@ public class BlockCable extends BlockPeripheralBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getStateFromMeta( int meta ) | ||||
|     { | ||||
|         IBlockState state = getDefaultState(); | ||||
| @@ -179,6 +180,7 @@ public class BlockCable extends BlockPeripheralBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         state = state.withProperty( Properties.NORTH, doesConnect( state, world, pos, EnumFacing.NORTH ) ); | ||||
| @@ -213,6 +215,7 @@ public class BlockCable extends BlockPeripheralBase | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public boolean shouldSideBeRendered( IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side ) | ||||
|     { | ||||
|         return true; | ||||
|   | ||||
| @@ -66,6 +66,7 @@ public class BlockPeripheral extends BlockPeripheralBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getStateFromMeta( int meta ) | ||||
|     { | ||||
|         IBlockState state = getDefaultState(); | ||||
| @@ -169,6 +170,7 @@ public class BlockPeripheral extends BlockPeripheralBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         int anim; | ||||
|   | ||||
| @@ -32,12 +32,14 @@ public abstract class BlockPeripheralBase extends BlockDirectional | ||||
|     protected abstract TilePeripheralBase createTile( PeripheralType type ); | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isOpaqueCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public final boolean isFullCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|   | ||||
| @@ -49,6 +49,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getStateFromMeta( int meta ) | ||||
|     { | ||||
|         IBlockState state = getDefaultState(); | ||||
| @@ -66,6 +67,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         int anim; | ||||
|   | ||||
| @@ -24,6 +24,7 @@ import dan200.computercraft.shared.turtle.upgrades.*; | ||||
| import dan200.computercraft.shared.util.IEntityDropConsumer; | ||||
| import dan200.computercraft.shared.util.ImpostorRecipe; | ||||
| import dan200.computercraft.shared.util.InventoryUtil; | ||||
| import net.minecraft.block.Block; | ||||
| import net.minecraft.entity.Entity; | ||||
| import net.minecraft.entity.item.EntityItem; | ||||
| import net.minecraft.init.Blocks; | ||||
| @@ -326,14 +327,14 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy | ||||
|         // Blocks | ||||
|         // Turtle | ||||
|         ComputerCraft.Blocks.turtle = BlockTurtle.createTurtleBlock(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.turtle, ItemTurtleLegacy.class, "CC-Turtle" ); | ||||
|         registerBlock( ComputerCraft.Blocks.turtle, new ItemTurtleLegacy(ComputerCraft.Blocks.turtle), "CC-Turtle" ); | ||||
|  | ||||
|         ComputerCraft.Blocks.turtleExpanded = BlockTurtle.createTurtleBlock(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.turtleExpanded, ItemTurtleNormal.class, "CC-TurtleExpanded" ); | ||||
|         registerBlock( ComputerCraft.Blocks.turtleExpanded, new ItemTurtleNormal( ComputerCraft.Blocks.turtleExpanded ), "CC-TurtleExpanded" ); | ||||
|  | ||||
|         // Advanced Turtle | ||||
|         ComputerCraft.Blocks.turtleAdvanced = BlockTurtle.createTurtleBlock(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.turtleAdvanced, ItemTurtleAdvanced.class, "CC-TurtleAdvanced" ); | ||||
|         registerBlock( ComputerCraft.Blocks.turtleAdvanced, new ItemTurtleAdvanced( ComputerCraft.Blocks.turtleAdvanced ), "CC-TurtleAdvanced" ); | ||||
|  | ||||
|         // Recipe types | ||||
|         RecipeSorter.register( "computercraft:turtle", TurtleRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapeless" ); | ||||
| @@ -403,6 +404,11 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy | ||||
|         registerTurtleUpgradeInternal( ComputerCraft.Upgrades.advancedModem ); | ||||
|     } | ||||
|  | ||||
|     private void registerBlock( Block block, Item item, String name) { | ||||
|         GameRegistry.register( block.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); | ||||
|         GameRegistry.register( item.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); | ||||
|     } | ||||
|  | ||||
|     private void registerTileEntities() | ||||
|     { | ||||
|         // TileEntities | ||||
|   | ||||
| @@ -9,6 +9,7 @@ package dan200.computercraft.shared.proxy; | ||||
| import dan200.computercraft.ComputerCraft; | ||||
| import dan200.computercraft.api.ComputerCraftAPI; | ||||
| import dan200.computercraft.api.pocket.IPocketUpgrade; | ||||
| import dan200.computercraft.core.computer.Computer; | ||||
| import dan200.computercraft.core.computer.MainThread; | ||||
| import dan200.computercraft.shared.common.DefaultBundledRedstoneProvider; | ||||
| import dan200.computercraft.shared.common.TileGeneric; | ||||
| @@ -51,6 +52,7 @@ import dan200.computercraft.shared.pocket.recipes.PocketComputerUpgradeRecipe; | ||||
| import dan200.computercraft.shared.turtle.blocks.TileTurtle; | ||||
| import dan200.computercraft.shared.turtle.inventory.ContainerTurtle; | ||||
| import dan200.computercraft.shared.util.*; | ||||
| import net.minecraft.block.Block; | ||||
| import net.minecraft.creativetab.CreativeTabs; | ||||
| import net.minecraft.entity.player.EntityPlayer; | ||||
| import net.minecraft.entity.player.EntityPlayerMP; | ||||
| @@ -65,6 +67,7 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity; | ||||
| import net.minecraft.tileentity.TileEntity; | ||||
| import net.minecraft.util.EnumHand; | ||||
| import net.minecraft.util.IThreadListener; | ||||
| import net.minecraft.util.ResourceLocation; | ||||
| import net.minecraft.util.SoundEvent; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.world.World; | ||||
| @@ -231,43 +234,43 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy | ||||
|         // Blocks | ||||
|         // Computer | ||||
|         ComputerCraft.Blocks.computer = new BlockComputer(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.computer, ItemComputer.class, "CC-Computer" ); | ||||
|         registerBlock( ComputerCraft.Blocks.computer, new ItemComputer( ComputerCraft.Blocks.computer ), "CC-Computer" ); | ||||
|  | ||||
|         // Peripheral | ||||
|         ComputerCraft.Blocks.peripheral = new BlockPeripheral(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.peripheral, ItemPeripheral.class, "CC-Peripheral" ); | ||||
|         registerBlock( ComputerCraft.Blocks.peripheral, new ItemPeripheral( ComputerCraft.Blocks.peripheral ), "CC-Peripheral" ); | ||||
|  | ||||
|         // Cable | ||||
|         ComputerCraft.Blocks.cable = new BlockCable(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.cable, ItemCable.class, "CC-Cable" ); | ||||
|         registerBlock( ComputerCraft.Blocks.cable, new ItemCable( ComputerCraft.Blocks.cable ), "CC-Cable" ); | ||||
|  | ||||
|         // Command Computer | ||||
|         ComputerCraft.Blocks.commandComputer = new BlockCommandComputer(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.commandComputer, ItemCommandComputer.class, "command_computer" ); | ||||
|         registerBlock( ComputerCraft.Blocks.commandComputer, new ItemCommandComputer( ComputerCraft.Blocks.commandComputer ), "command_computer" ); | ||||
|  | ||||
|         // Command Computer | ||||
|         ComputerCraft.Blocks.advancedModem = new BlockAdvancedModem(); | ||||
|         GameRegistry.registerBlock( ComputerCraft.Blocks.advancedModem, ItemAdvancedModem.class, "advanced_modem" ); | ||||
|         registerBlock( ComputerCraft.Blocks.advancedModem, new ItemAdvancedModem( ComputerCraft.Blocks.advancedModem ), "advanced_modem" ); | ||||
|  | ||||
|         // Items | ||||
|         // Floppy Disk | ||||
|         ComputerCraft.Items.disk = new ItemDiskLegacy(); | ||||
|         GameRegistry.registerItem( ComputerCraft.Items.disk, "disk" ); | ||||
|         GameRegistry.register( ComputerCraft.Items.disk.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "disk" ) ) ); | ||||
|  | ||||
|         ComputerCraft.Items.diskExpanded = new ItemDiskExpanded(); | ||||
|         GameRegistry.registerItem( ComputerCraft.Items.diskExpanded, "diskExpanded" ); | ||||
|         GameRegistry.register( ComputerCraft.Items.diskExpanded.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "diskExpanded" ) ) ); | ||||
|  | ||||
|         // Treasure Disk | ||||
|         ComputerCraft.Items.treasureDisk = new ItemTreasureDisk(); | ||||
|         GameRegistry.registerItem( ComputerCraft.Items.treasureDisk, "treasureDisk" ); | ||||
|         GameRegistry.register( ComputerCraft.Items.treasureDisk.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "treasureDisk" ) ) ); | ||||
|  | ||||
|         // Printout | ||||
|         ComputerCraft.Items.printout = new ItemPrintout(); | ||||
|         GameRegistry.registerItem( ComputerCraft.Items.printout, "printout" ); | ||||
|         GameRegistry.register( ComputerCraft.Items.printout.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "printout" ) ) ); | ||||
|  | ||||
|         // Pocket computer | ||||
|         ComputerCraft.Items.pocketComputer = new ItemPocketComputer(); | ||||
|         GameRegistry.registerItem( ComputerCraft.Items.pocketComputer, "pocketComputer" ); | ||||
|         GameRegistry.register( ComputerCraft.Items.pocketComputer.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "pocketComputer" ) ) ); | ||||
|  | ||||
|         // Recipe types | ||||
|         RecipeSorter.register( "computercraft:impostor", ImpostorRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapeless" ); | ||||
| @@ -470,6 +473,11 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy | ||||
|         GameRegistry.addShapelessRecipe( cloudyHead, monitor, new ItemStack( Items.SKULL, 1, 1 ) ); | ||||
|     } | ||||
|  | ||||
|     private void registerBlock( Block block, Item item, String name) { | ||||
|         GameRegistry.register( block.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); | ||||
|         GameRegistry.register( item.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); | ||||
|     } | ||||
|  | ||||
|     private void registerTileEntities() | ||||
|     { | ||||
|         // Tile Entities | ||||
| @@ -673,7 +681,7 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy | ||||
|  | ||||
|         @SubscribeEvent | ||||
|         public void onConfigChanged( ConfigChangedEvent.OnConfigChangedEvent event) { | ||||
|             if( event.getModID().equals( "ComputerCraft" ) ) | ||||
|             if( event.getModID().equals( ComputerCraft.MOD_ID ) ) | ||||
|             { | ||||
|                 ComputerCraft.syncConfig(); | ||||
|             } | ||||
|   | ||||
| @@ -55,18 +55,21 @@ public class BlockTurtle extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public EnumBlockRenderType getRenderType( IBlockState state ) | ||||
|     { | ||||
|         return EnumBlockRenderType.INVISIBLE; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public boolean isOpaqueCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public boolean isFullCube( IBlockState state ) | ||||
|     { | ||||
|         return false; | ||||
| @@ -81,6 +84,7 @@ public class BlockTurtle extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getStateFromMeta( int meta ) | ||||
|     { | ||||
|         return getDefaultState(); | ||||
| @@ -94,6 +98,7 @@ public class BlockTurtle extends BlockComputerBase | ||||
|  | ||||
|     @Nonnull | ||||
|     @Override | ||||
|     @Deprecated | ||||
|     public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) | ||||
|     { | ||||
|         return state.withProperty( Properties.FACING, getDirection( world, pos ) ); | ||||
|   | ||||
| @@ -17,7 +17,10 @@ import dan200.computercraft.shared.computer.core.ServerComputer; | ||||
| import dan200.computercraft.shared.turtle.apis.TurtleAPI; | ||||
| import dan200.computercraft.shared.turtle.core.TurtleBrain; | ||||
| import dan200.computercraft.shared.turtle.items.TurtleItemFactory; | ||||
| import dan200.computercraft.shared.util.*; | ||||
| import dan200.computercraft.shared.util.Colour; | ||||
| import dan200.computercraft.shared.util.InventoryUtil; | ||||
| import dan200.computercraft.shared.util.RedstoneUtil; | ||||
| import dan200.computercraft.shared.util.WorldUtil; | ||||
| import net.minecraft.entity.Entity; | ||||
| import net.minecraft.entity.EntityLivingBase; | ||||
| import net.minecraft.entity.player.EntityPlayer; | ||||
| @@ -27,9 +30,16 @@ import net.minecraft.inventory.IInventory; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.nbt.NBTTagCompound; | ||||
| import net.minecraft.nbt.NBTTagList; | ||||
| import net.minecraft.util.*; | ||||
| import net.minecraft.util.math.*; | ||||
| import net.minecraft.util.text.*; | ||||
| import net.minecraft.util.EnumFacing; | ||||
| import net.minecraft.util.EnumHand; | ||||
| import net.minecraft.util.ITickable; | ||||
| import net.minecraft.util.ResourceLocation; | ||||
| import net.minecraft.util.math.AxisAlignedBB; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.util.math.Vec3d; | ||||
| import net.minecraft.util.text.ITextComponent; | ||||
| import net.minecraft.util.text.TextComponentString; | ||||
| import net.minecraft.util.text.TextComponentTranslation; | ||||
| import net.minecraftforge.common.util.Constants; | ||||
|  | ||||
| import javax.annotation.Nonnull; | ||||
| @@ -195,7 +205,8 @@ public class TileTurtle extends TileComputerBase | ||||
|                         m_brain.setDyeColour( -1 ); | ||||
|                         if( !player.capabilities.isCreativeMode ) | ||||
|                         { | ||||
|                             currentItem.setItem( Items.BUCKET ); | ||||
|                             player.setHeldItem( EnumHand.MAIN_HAND, new ItemStack( Items.BUCKET ) ); | ||||
|                             player.inventory.markDirty(); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SquidDev
					SquidDev