Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
@@ -18,6 +18,7 @@
package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
@@ -34,39 +35,24 @@ import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.IAEAppEngInventory;
import appeng.tile.inventory.InvOperation;
public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IContainerCraftingPacket
{
public final PartCraftingTerminal ct;
final AppEngInternalInventory output = new AppEngInternalInventory( this, 1 );
final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
final SlotCraftingTerm outputSlot;
public final PartCraftingTerminal ct;
/**
* Callback for when the crafting matrix is changed.
*/
@Override
public void onCraftMatrixChanged(IInventory par1IInventory)
public ContainerCraftingTerm( InventoryPlayer ip, ITerminalHost monitorable )
{
ContainerNull cn = new ContainerNull();
InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 );
for (int x = 0; x < 9; x++)
ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() );
this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ) );
}
public ContainerCraftingTerm(InventoryPlayer ip, ITerminalHost monitorable) {
super( ip, monitorable, false );
this.ct = (PartCraftingTerminal) monitorable;
IInventory crafting = this.ct.getInventoryByName( "crafting" );
for (int y = 0; y < 3; y++)
for (int x = 0; x < 3; x++)
for( int y = 0; y < 3; y++ )
for( int x = 0; x < 3; x++ )
this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) );
this.addSlotToContainer( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.mySrc, this.powerSrc, monitorable, crafting, crafting, this.output, 131, -72 + 18, this ) );
@@ -76,6 +62,21 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
this.onCraftMatrixChanged( crafting );
}
/**
* Callback for when the crafting matrix is changed.
*/
@Override
public void onCraftMatrixChanged( IInventory par1IInventory )
{
ContainerNull cn = new ContainerNull();
InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 );
for( int x = 0; x < 9; x++ )
ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() );
this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ) );
}
@Override
public void saveChanges()
{
@@ -83,15 +84,15 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
}
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
{
}
@Override
public IInventory getInventoryByName(String name)
public IInventory getInventoryByName( String name )
{
if (name.equals("player"))
if( name.equals( "player" ) )
{
return this.invPlayer;
}