mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-03-06 16:29:44 +00:00
Converted tabs to spaces throughout
This commit is contained in:
@@ -85,30 +85,30 @@ import java.io.File;
|
||||
|
||||
public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
{
|
||||
public ComputerCraftProxyCommon()
|
||||
{
|
||||
}
|
||||
|
||||
// IComputerCraftProxy implementation
|
||||
public ComputerCraftProxyCommon()
|
||||
{
|
||||
}
|
||||
|
||||
// IComputerCraftProxy implementation
|
||||
|
||||
@Override
|
||||
public void preInit()
|
||||
{
|
||||
registerItems();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
registerTileEntities();
|
||||
registerForgeHandlers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract boolean isClient();
|
||||
|
||||
@Override
|
||||
public abstract boolean getGlobalCursorBlink();
|
||||
@Override
|
||||
public void preInit()
|
||||
{
|
||||
registerItems();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
registerTileEntities();
|
||||
registerForgeHandlers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract boolean isClient();
|
||||
|
||||
@Override
|
||||
public abstract boolean getGlobalCursorBlink();
|
||||
|
||||
@Override
|
||||
public abstract long getRenderFrame();
|
||||
@@ -119,45 +119,45 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract Object getFixedWidthFontRenderer();
|
||||
|
||||
@Override
|
||||
public String getRecordInfo( ItemStack recordStack )
|
||||
{
|
||||
Item item = recordStack.getItem();
|
||||
if( item instanceof ItemRecord )
|
||||
{
|
||||
ItemRecord record = (ItemRecord)item;
|
||||
return record.getRecordNameLocal();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos );
|
||||
|
||||
@Override
|
||||
public abstract Object getDiskDriveGUI( InventoryPlayer inventory, TileDiskDrive drive );
|
||||
|
||||
@Override
|
||||
public abstract Object getComputerGUI( TileComputer computer );
|
||||
public abstract Object getFixedWidthFontRenderer();
|
||||
|
||||
@Override
|
||||
public String getRecordInfo( ItemStack recordStack )
|
||||
{
|
||||
Item item = recordStack.getItem();
|
||||
if( item instanceof ItemRecord )
|
||||
{
|
||||
ItemRecord record = (ItemRecord)item;
|
||||
return record.getRecordNameLocal();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos );
|
||||
|
||||
@Override
|
||||
public abstract Object getDiskDriveGUI( InventoryPlayer inventory, TileDiskDrive drive );
|
||||
|
||||
@Override
|
||||
public abstract Object getComputerGUI( TileComputer computer );
|
||||
|
||||
@Override
|
||||
public abstract Object getPrinterGUI( InventoryPlayer inventory, TilePrinter printer );
|
||||
@Override
|
||||
public abstract Object getPrinterGUI( InventoryPlayer inventory, TilePrinter printer );
|
||||
|
||||
@Override
|
||||
public abstract Object getTurtleGUI( InventoryPlayer inventory, TileTurtle turtle );
|
||||
|
||||
@Override
|
||||
public abstract Object getPrintoutGUI( InventoryPlayer inventory );
|
||||
@Override
|
||||
public abstract Object getPrintoutGUI( InventoryPlayer inventory );
|
||||
|
||||
@Override
|
||||
public abstract Object getPocketComputerGUI( InventoryPlayer inventory );
|
||||
|
||||
public abstract File getWorldDir( World world );
|
||||
|
||||
@Override
|
||||
public void handlePacket( final ComputerCraftPacket packet, final EntityPlayer player )
|
||||
public abstract File getWorldDir( World world );
|
||||
|
||||
@Override
|
||||
public void handlePacket( final ComputerCraftPacket packet, final EntityPlayer player )
|
||||
{
|
||||
IThreadListener listener = player.getServer();
|
||||
if( listener != null )
|
||||
@@ -182,11 +182,11 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
|
||||
private void processPacket( ComputerCraftPacket packet, EntityPlayer player )
|
||||
{
|
||||
switch( packet.m_packetType )
|
||||
{
|
||||
///////////////////////////////////
|
||||
// Packets from Client to Server //
|
||||
///////////////////////////////////
|
||||
switch( packet.m_packetType )
|
||||
{
|
||||
///////////////////////////////////
|
||||
// Packets from Client to Server //
|
||||
///////////////////////////////////
|
||||
case ComputerCraftPacket.TurnOn:
|
||||
case ComputerCraftPacket.Shutdown:
|
||||
case ComputerCraftPacket.Reboot:
|
||||
@@ -221,18 +221,18 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void registerItems()
|
||||
{
|
||||
// Creative tab
|
||||
ComputerCraft.mainCreativeTab = new CreativeTabMain( CreativeTabs.getNextID() );
|
||||
private void registerItems()
|
||||
{
|
||||
// Creative tab
|
||||
ComputerCraft.mainCreativeTab = new CreativeTabMain( CreativeTabs.getNextID() );
|
||||
|
||||
// Blocks
|
||||
// Computer
|
||||
ComputerCraft.Blocks.computer = new BlockComputer();
|
||||
GameRegistry.registerBlock( ComputerCraft.Blocks.computer, ItemComputer.class, "CC-Computer" );
|
||||
// Computer
|
||||
ComputerCraft.Blocks.computer = new BlockComputer();
|
||||
GameRegistry.registerBlock( ComputerCraft.Blocks.computer, ItemComputer.class, "CC-Computer" );
|
||||
|
||||
// Peripheral
|
||||
ComputerCraft.Blocks.peripheral = new BlockPeripheral();
|
||||
@@ -278,80 +278,80 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
RecipeSorter.register( "computercraft:pocket_computer_upgrade", PocketComputerUpgradeRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless" );
|
||||
|
||||
// Recipes
|
||||
// Computer
|
||||
ItemStack computer = ComputerItemFactory.create( -1, null, ComputerFamily.Normal );
|
||||
GameRegistry.addRecipe( computer,
|
||||
"XXX", "XYX", "XZX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE,
|
||||
'Z', Blocks.GLASS_PANE
|
||||
);
|
||||
// Computer
|
||||
ItemStack computer = ComputerItemFactory.create( -1, null, ComputerFamily.Normal );
|
||||
GameRegistry.addRecipe( computer,
|
||||
"XXX", "XYX", "XZX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE,
|
||||
'Z', Blocks.GLASS_PANE
|
||||
);
|
||||
|
||||
// Advanced Computer
|
||||
ItemStack advancedComputer = ComputerItemFactory.create( -1, null, ComputerFamily.Advanced );
|
||||
GameRegistry.addRecipe( advancedComputer,
|
||||
"XXX", "XYX", "XZX",
|
||||
'X', Items.GOLD_INGOT,
|
||||
'Y', Items.REDSTONE,
|
||||
'Z', Blocks.GLASS_PANE
|
||||
);
|
||||
ItemStack advancedComputer = ComputerItemFactory.create( -1, null, ComputerFamily.Advanced );
|
||||
GameRegistry.addRecipe( advancedComputer,
|
||||
"XXX", "XYX", "XZX",
|
||||
'X', Items.GOLD_INGOT,
|
||||
'Y', Items.REDSTONE,
|
||||
'Z', Blocks.GLASS_PANE
|
||||
);
|
||||
|
||||
// Disk Drive
|
||||
ItemStack diskDrive = PeripheralItemFactory.create( PeripheralType.DiskDrive, null, 1 );
|
||||
GameRegistry.addRecipe( diskDrive,
|
||||
"XXX", "XYX", "XYX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE
|
||||
);
|
||||
|
||||
// Wireless Modem
|
||||
ItemStack wirelessModem = PeripheralItemFactory.create( PeripheralType.WirelessModem, null, 1 );
|
||||
GameRegistry.addRecipe( wirelessModem,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.ENDER_PEARL
|
||||
);
|
||||
|
||||
// Monitor
|
||||
ItemStack monitor = PeripheralItemFactory.create( PeripheralType.Monitor, null, 1 );
|
||||
GameRegistry.addRecipe( monitor,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Blocks.GLASS_PANE
|
||||
);
|
||||
|
||||
// PrinterEmpty
|
||||
ItemStack printer = PeripheralItemFactory.create( PeripheralType.Printer, null, 1 );
|
||||
GameRegistry.addRecipe( printer,
|
||||
"XXX", "XYX", "XZX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE,
|
||||
'Z', new ItemStack( Items.DYE, 1, 0 ) // 0 = Black
|
||||
);
|
||||
ItemStack diskDrive = PeripheralItemFactory.create( PeripheralType.DiskDrive, null, 1 );
|
||||
GameRegistry.addRecipe( diskDrive,
|
||||
"XXX", "XYX", "XYX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE
|
||||
);
|
||||
|
||||
// Wireless Modem
|
||||
ItemStack wirelessModem = PeripheralItemFactory.create( PeripheralType.WirelessModem, null, 1 );
|
||||
GameRegistry.addRecipe( wirelessModem,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.ENDER_PEARL
|
||||
);
|
||||
|
||||
// Monitor
|
||||
ItemStack monitor = PeripheralItemFactory.create( PeripheralType.Monitor, null, 1 );
|
||||
GameRegistry.addRecipe( monitor,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Blocks.GLASS_PANE
|
||||
);
|
||||
|
||||
// PrinterEmpty
|
||||
ItemStack printer = PeripheralItemFactory.create( PeripheralType.Printer, null, 1 );
|
||||
GameRegistry.addRecipe( printer,
|
||||
"XXX", "XYX", "XZX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE,
|
||||
'Z', new ItemStack( Items.DYE, 1, 0 ) // 0 = Black
|
||||
);
|
||||
|
||||
// Advanced Monitor
|
||||
ItemStack advancedMonitors = PeripheralItemFactory.create( PeripheralType.AdvancedMonitor, null, 4 );
|
||||
GameRegistry.addRecipe( advancedMonitors,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Items.GOLD_INGOT,
|
||||
'Y', Blocks.GLASS_PANE
|
||||
);
|
||||
// Advanced Monitor
|
||||
ItemStack advancedMonitors = PeripheralItemFactory.create( PeripheralType.AdvancedMonitor, null, 4 );
|
||||
GameRegistry.addRecipe( advancedMonitors,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Items.GOLD_INGOT,
|
||||
'Y', Blocks.GLASS_PANE
|
||||
);
|
||||
|
||||
// Networking Cable
|
||||
ItemStack cable = PeripheralItemFactory.create( PeripheralType.Cable, null, 6 );
|
||||
GameRegistry.addRecipe( cable,
|
||||
" X ", "XYX", " X ",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE
|
||||
);
|
||||
|
||||
// Wired Modem
|
||||
ItemStack wiredModem = PeripheralItemFactory.create( PeripheralType.WiredModem, null, 1 );
|
||||
GameRegistry.addRecipe( wiredModem,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE
|
||||
);
|
||||
// Networking Cable
|
||||
ItemStack cable = PeripheralItemFactory.create( PeripheralType.Cable, null, 6 );
|
||||
GameRegistry.addRecipe( cable,
|
||||
" X ", "XYX", " X ",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE
|
||||
);
|
||||
|
||||
// Wired Modem
|
||||
ItemStack wiredModem = PeripheralItemFactory.create( PeripheralType.WiredModem, null, 1 );
|
||||
GameRegistry.addRecipe( wiredModem,
|
||||
"XXX", "XYX", "XXX",
|
||||
'X', Blocks.STONE,
|
||||
'Y', Items.REDSTONE
|
||||
);
|
||||
|
||||
// Computer
|
||||
ItemStack commandComputer = ComputerItemFactory.create( -1, null, ComputerFamily.Command );
|
||||
@@ -371,46 +371,46 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
);
|
||||
|
||||
// Disk
|
||||
GameRegistry.addRecipe( new DiskRecipe() );
|
||||
GameRegistry.addRecipe( new DiskRecipe() );
|
||||
|
||||
// Impostor Disk recipes (to fool NEI)
|
||||
ItemStack paper = new ItemStack( Items.PAPER, 1 );
|
||||
ItemStack redstone = new ItemStack( Items.REDSTONE, 1 );
|
||||
ItemStack basicDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.Blue.getHex() );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( basicDisk, new Object[] { redstone, paper } ) );
|
||||
ItemStack paper = new ItemStack( Items.PAPER, 1 );
|
||||
ItemStack redstone = new ItemStack( Items.REDSTONE, 1 );
|
||||
ItemStack basicDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.Blue.getHex() );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( basicDisk, new Object[] { redstone, paper } ) );
|
||||
|
||||
for( int colour=0; colour<16; ++colour )
|
||||
{
|
||||
ItemStack disk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.values()[ colour ].getHex() );
|
||||
ItemStack dye = new ItemStack( Items.DYE, 1, colour );
|
||||
for( int otherColour=0; otherColour<16; ++otherColour )
|
||||
{
|
||||
if( colour != otherColour )
|
||||
{
|
||||
ItemStack otherDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.values()[ colour ].getHex() );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new Object[] {
|
||||
for( int colour=0; colour<16; ++colour )
|
||||
{
|
||||
ItemStack disk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.values()[ colour ].getHex() );
|
||||
ItemStack dye = new ItemStack( Items.DYE, 1, colour );
|
||||
for( int otherColour=0; otherColour<16; ++otherColour )
|
||||
{
|
||||
if( colour != otherColour )
|
||||
{
|
||||
ItemStack otherDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.values()[ colour ].getHex() );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new Object[] {
|
||||
otherDisk, dye
|
||||
} ) );
|
||||
}
|
||||
}
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new Object[] {
|
||||
}
|
||||
}
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new Object[] {
|
||||
redstone, paper, dye
|
||||
} ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Printout
|
||||
// Printout
|
||||
GameRegistry.addRecipe( new PrintoutRecipe() );
|
||||
|
||||
ItemStack singlePrintout = ItemPrintout.createSingleFromTitleAndText( null, null, null );
|
||||
ItemStack multiplePrintout = ItemPrintout.createMultipleFromTitleAndText( null, null, null );
|
||||
ItemStack bookPrintout = ItemPrintout.createBookFromTitleAndText( null, null, null );
|
||||
ItemStack singlePrintout = ItemPrintout.createSingleFromTitleAndText( null, null, null );
|
||||
ItemStack multiplePrintout = ItemPrintout.createMultipleFromTitleAndText( null, null, null );
|
||||
ItemStack bookPrintout = ItemPrintout.createBookFromTitleAndText( null, null, null );
|
||||
|
||||
// Impostor Printout recipes (to fool NEI)
|
||||
ItemStack string = new ItemStack( Items.STRING, 1, 0 );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( multiplePrintout, new Object[] { singlePrintout, singlePrintout, string } ) );
|
||||
// Impostor Printout recipes (to fool NEI)
|
||||
ItemStack string = new ItemStack( Items.STRING, 1, 0 );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( multiplePrintout, new Object[] { singlePrintout, singlePrintout, string } ) );
|
||||
|
||||
ItemStack leather = new ItemStack( Items.LEATHER, 1, 0 );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( bookPrintout, new Object[] { leather, singlePrintout, string } ) );
|
||||
ItemStack leather = new ItemStack( Items.LEATHER, 1, 0 );
|
||||
GameRegistry.addRecipe( new ImpostorShapelessRecipe( bookPrintout, new Object[] { leather, singlePrintout, string } ) );
|
||||
|
||||
// Pocket Computer
|
||||
ItemStack pocketComputer = PocketComputerItemFactory.create( -1, null, ComputerFamily.Normal, false );
|
||||
@@ -443,98 +443,98 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
|
||||
// Skulls (Easter Egg)
|
||||
// Dan
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString( "SkullOwner", "dan200" );
|
||||
ItemStack danHead = new ItemStack( Items.SKULL, 1, 3 );
|
||||
danHead.setTagCompound( tag );
|
||||
GameRegistry.addShapelessRecipe( danHead, computer, new ItemStack( Items.SKULL, 1, 1 ) );
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString( "SkullOwner", "dan200" );
|
||||
ItemStack danHead = new ItemStack( Items.SKULL, 1, 3 );
|
||||
danHead.setTagCompound( tag );
|
||||
GameRegistry.addShapelessRecipe( danHead, computer, new ItemStack( Items.SKULL, 1, 1 ) );
|
||||
|
||||
// Cloudy
|
||||
tag = new NBTTagCompound();
|
||||
tag.setString( "SkullOwner", "Cloudhunter" );
|
||||
ItemStack cloudyHead = new ItemStack( Items.SKULL, 1, 3 );
|
||||
cloudyHead.setTagCompound( tag );
|
||||
GameRegistry.addShapelessRecipe( cloudyHead, monitor, new ItemStack( Items.SKULL, 1, 1 ) );
|
||||
}
|
||||
|
||||
private void registerTileEntities()
|
||||
{
|
||||
// Tile Entities
|
||||
GameRegistry.registerTileEntity( TileComputer.class, "computer" );
|
||||
GameRegistry.registerTileEntity( TileDiskDrive.class, "diskdrive" );
|
||||
GameRegistry.registerTileEntity( TileWirelessModem.class, "wirelessmodem" );
|
||||
GameRegistry.registerTileEntity( TileMonitor.class, "monitor" );
|
||||
GameRegistry.registerTileEntity( TilePrinter.class, "ccprinter" );
|
||||
GameRegistry.registerTileEntity( TileCable.class, "wiredmodem" );
|
||||
tag = new NBTTagCompound();
|
||||
tag.setString( "SkullOwner", "Cloudhunter" );
|
||||
ItemStack cloudyHead = new ItemStack( Items.SKULL, 1, 3 );
|
||||
cloudyHead.setTagCompound( tag );
|
||||
GameRegistry.addShapelessRecipe( cloudyHead, monitor, new ItemStack( Items.SKULL, 1, 1 ) );
|
||||
}
|
||||
|
||||
private void registerTileEntities()
|
||||
{
|
||||
// Tile Entities
|
||||
GameRegistry.registerTileEntity( TileComputer.class, "computer" );
|
||||
GameRegistry.registerTileEntity( TileDiskDrive.class, "diskdrive" );
|
||||
GameRegistry.registerTileEntity( TileWirelessModem.class, "wirelessmodem" );
|
||||
GameRegistry.registerTileEntity( TileMonitor.class, "monitor" );
|
||||
GameRegistry.registerTileEntity( TilePrinter.class, "ccprinter" );
|
||||
GameRegistry.registerTileEntity( TileCable.class, "wiredmodem" );
|
||||
GameRegistry.registerTileEntity( TileCommandComputer.class, "command_computer" );
|
||||
GameRegistry.registerTileEntity( TileAdvancedModem.class, "advanced_modem" );
|
||||
|
||||
// Register peripheral providers
|
||||
// Register peripheral providers
|
||||
ComputerCraftAPI.registerPeripheralProvider( new DefaultPeripheralProvider() );
|
||||
if( ComputerCraft.enableCommandBlock )
|
||||
{
|
||||
ComputerCraftAPI.registerPeripheralProvider( new CommandBlockPeripheralProvider() );
|
||||
}
|
||||
if( ComputerCraft.enableCommandBlock )
|
||||
{
|
||||
ComputerCraftAPI.registerPeripheralProvider( new CommandBlockPeripheralProvider() );
|
||||
}
|
||||
|
||||
// Register bundled power providers
|
||||
ComputerCraftAPI.registerBundledRedstoneProvider( new DefaultBundledRedstoneProvider() );
|
||||
|
||||
// Register media providers
|
||||
ComputerCraftAPI.registerMediaProvider( new DefaultMediaProvider() );
|
||||
}
|
||||
|
||||
private void registerForgeHandlers()
|
||||
{
|
||||
ForgeHandlers handlers = new ForgeHandlers();
|
||||
}
|
||||
|
||||
private void registerForgeHandlers()
|
||||
{
|
||||
ForgeHandlers handlers = new ForgeHandlers();
|
||||
MinecraftForge.EVENT_BUS.register( handlers );
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler( ComputerCraft.instance, handlers );
|
||||
}
|
||||
|
||||
public class ForgeHandlers implements
|
||||
IGuiHandler
|
||||
{
|
||||
private ForgeHandlers()
|
||||
{
|
||||
}
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler( ComputerCraft.instance, handlers );
|
||||
}
|
||||
|
||||
public class ForgeHandlers implements
|
||||
IGuiHandler
|
||||
{
|
||||
private ForgeHandlers()
|
||||
{
|
||||
}
|
||||
|
||||
// IGuiHandler implementation
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement( int id, EntityPlayer player, World world, int x, int y, int z )
|
||||
{
|
||||
// IGuiHandler implementation
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement( int id, EntityPlayer player, World world, int x, int y, int z )
|
||||
{
|
||||
BlockPos pos = new BlockPos( x, y, z );
|
||||
switch( id )
|
||||
{
|
||||
case ComputerCraft.diskDriveGUIID:
|
||||
{
|
||||
switch( id )
|
||||
{
|
||||
case ComputerCraft.diskDriveGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
if( tile != null && tile instanceof TileDiskDrive )
|
||||
{
|
||||
TileDiskDrive drive = (TileDiskDrive)tile;
|
||||
return new ContainerDiskDrive( player.inventory, drive );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.computerGUIID:
|
||||
{
|
||||
if( tile != null && tile instanceof TileDiskDrive )
|
||||
{
|
||||
TileDiskDrive drive = (TileDiskDrive)tile;
|
||||
return new ContainerDiskDrive( player.inventory, drive );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.computerGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
if( tile != null && tile instanceof TileComputer )
|
||||
{
|
||||
TileComputer computer = (TileComputer)tile;
|
||||
return new ContainerComputer( computer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.printerGUIID:
|
||||
{
|
||||
if( tile != null && tile instanceof TileComputer )
|
||||
{
|
||||
TileComputer computer = (TileComputer)tile;
|
||||
return new ContainerComputer( computer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.printerGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
if( tile != null && tile instanceof TilePrinter )
|
||||
{
|
||||
TilePrinter printer = (TilePrinter)tile;
|
||||
return new ContainerPrinter( player.inventory, printer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
if( tile != null && tile instanceof TilePrinter )
|
||||
{
|
||||
TilePrinter printer = (TilePrinter)tile;
|
||||
return new ContainerPrinter( player.inventory, printer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.turtleGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
@@ -554,45 +554,45 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
return new ContainerHeldItem( player.inventory );
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement( int id, EntityPlayer player, World world, int x, int y, int z )
|
||||
{
|
||||
@Override
|
||||
public Object getClientGuiElement( int id, EntityPlayer player, World world, int x, int y, int z )
|
||||
{
|
||||
BlockPos pos = new BlockPos( x, y, z );
|
||||
switch( id )
|
||||
{
|
||||
case ComputerCraft.diskDriveGUIID:
|
||||
{
|
||||
switch( id )
|
||||
{
|
||||
case ComputerCraft.diskDriveGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
if( tile != null && tile instanceof TileDiskDrive )
|
||||
{
|
||||
TileDiskDrive drive = (TileDiskDrive)tile;
|
||||
return getDiskDriveGUI( player.inventory, drive );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.computerGUIID:
|
||||
{
|
||||
if( tile != null && tile instanceof TileDiskDrive )
|
||||
{
|
||||
TileDiskDrive drive = (TileDiskDrive)tile;
|
||||
return getDiskDriveGUI( player.inventory, drive );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.computerGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
if( tile != null && tile instanceof TileComputer )
|
||||
{
|
||||
TileComputer computer = (TileComputer)tile;
|
||||
return getComputerGUI( computer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.printerGUIID:
|
||||
{
|
||||
if( tile != null && tile instanceof TileComputer )
|
||||
{
|
||||
TileComputer computer = (TileComputer)tile;
|
||||
return getComputerGUI( computer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.printerGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
if( tile != null && tile instanceof TilePrinter )
|
||||
{
|
||||
TilePrinter printer = (TilePrinter)tile;
|
||||
return getPrinterGUI( player.inventory, printer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
if( tile != null && tile instanceof TilePrinter )
|
||||
{
|
||||
TilePrinter printer = (TilePrinter)tile;
|
||||
return getPrinterGUI( player.inventory, printer );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ComputerCraft.turtleGUIID:
|
||||
{
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
|
||||
Reference in New Issue
Block a user