1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-09 18:03:08 +00:00

Remove most raw types

This means we can remove even more casts and what not.
This commit is contained in:
SquidDev
2017-05-07 01:16:08 +01:00
parent 9af15d1e30
commit db9cd15fb3
38 changed files with 106 additions and 141 deletions

View File

@@ -10,15 +10,14 @@ import dan200.computercraft.ComputerCraft;
import dan200.computercraft.shared.peripheral.PeripheralType;
import dan200.computercraft.shared.peripheral.modem.TileCable;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import javax.annotation.Nonnull;
@@ -79,7 +78,7 @@ public class BlockCable extends BlockPeripheralBase
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] {
return new BlockStateContainer( this,
Properties.MODEM,
Properties.CABLE,
Properties.NORTH,
@@ -87,8 +86,8 @@ public class BlockCable extends BlockPeripheralBase
Properties.EAST,
Properties.WEST,
Properties.UP,
Properties.DOWN,
});
Properties.DOWN
);
}
@Nonnull

View File

@@ -13,7 +13,6 @@ import dan200.computercraft.shared.peripheral.modem.TileWirelessModem;
import dan200.computercraft.shared.peripheral.monitor.TileMonitor;
import dan200.computercraft.shared.peripheral.printer.TilePrinter;
import dan200.computercraft.shared.util.DirectionUtil;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
@@ -22,9 +21,9 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -62,10 +61,7 @@ public class BlockPeripheral extends BlockPeripheralBase
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] {
Properties.FACING,
Properties.VARIANT
});
return new BlockStateContainer( this, Properties.FACING, Properties.VARIANT );
}
@Nonnull

View File

@@ -49,7 +49,7 @@ public class ItemAdvancedModem extends ItemPeripheralBase
}
@Override
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list )
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List<ItemStack> list )
{
list.add( PeripheralItemFactory.create( PeripheralType.AdvancedModem, null, 1 ) );
}

View File

@@ -63,7 +63,7 @@ public class ItemCable extends ItemPeripheralBase
}
@Override
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list )
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List<ItemStack> list )
{
list.add( PeripheralItemFactory.create( PeripheralType.WiredModem, null, 1 ) );
list.add( PeripheralItemFactory.create( PeripheralType.Cable, null, 1 ) );

View File

@@ -69,7 +69,7 @@ public class ItemPeripheral extends ItemPeripheralBase
}
@Override
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list )
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List<ItemStack> list )
{
list.add( PeripheralItemFactory.create( PeripheralType.DiskDrive, null, 1 ) );
list.add( PeripheralItemFactory.create( PeripheralType.Printer, null, 1 ) );

View File

@@ -10,7 +10,6 @@ import dan200.computercraft.ComputerCraft;
import dan200.computercraft.shared.peripheral.PeripheralType;
import dan200.computercraft.shared.peripheral.common.BlockPeripheralBase;
import dan200.computercraft.shared.peripheral.common.TilePeripheralBase;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
@@ -45,10 +44,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] {
Properties.FACING,
Properties.ON
});
return new BlockStateContainer(this, Properties.FACING, Properties.ON );
}
@Nonnull

View File

@@ -79,10 +79,9 @@ public class ContainerPrinter extends Container
boolean printing = m_printer.isPrinting();
for( IContainerListener listener : listeners )
{
IContainerListener icrafting = listener;
if( printing != m_lastPrinting )
{
icrafting.sendProgressBarUpdate( this, 0, printing ? 1 : 0 );
listener.sendProgressBarUpdate( this, 0, printing ? 1 : 0 );
}
}
m_lastPrinting = printing;