reformat + optimize imports
This commit is contained in:
0
src/main/java/storagecraft/StorageCraft.java
Normal file → Executable file
0
src/main/java/storagecraft/StorageCraft.java
Normal file → Executable file
@@ -1,18 +1,6 @@
|
|||||||
package storagecraft;
|
package storagecraft;
|
||||||
|
|
||||||
import storagecraft.block.BlockCable;
|
import storagecraft.block.*;
|
||||||
import storagecraft.block.BlockConstructor;
|
|
||||||
import storagecraft.block.BlockController;
|
|
||||||
import storagecraft.block.BlockDestructor;
|
|
||||||
import storagecraft.block.BlockDetector;
|
|
||||||
import storagecraft.block.BlockDrive;
|
|
||||||
import storagecraft.block.BlockExporter;
|
|
||||||
import storagecraft.block.BlockGrid;
|
|
||||||
import storagecraft.block.BlockImporter;
|
|
||||||
import storagecraft.block.BlockMachineCasing;
|
|
||||||
import storagecraft.block.BlockSolderer;
|
|
||||||
import storagecraft.block.BlockExternalStorage;
|
|
||||||
import storagecraft.block.BlockWirelessTransmitter;
|
|
||||||
|
|
||||||
public final class StorageCraftBlocks
|
public final class StorageCraftBlocks
|
||||||
{
|
{
|
||||||
|
9
src/main/java/storagecraft/StorageCraftItems.java
Normal file → Executable file
9
src/main/java/storagecraft/StorageCraftItems.java
Normal file → Executable file
@@ -1,13 +1,6 @@
|
|||||||
package storagecraft;
|
package storagecraft;
|
||||||
|
|
||||||
import storagecraft.item.ItemCore;
|
import storagecraft.item.*;
|
||||||
import storagecraft.item.ItemProcessor;
|
|
||||||
import storagecraft.item.ItemSilicon;
|
|
||||||
import storagecraft.item.ItemStorageCell;
|
|
||||||
import storagecraft.item.ItemQuartzEnrichedIron;
|
|
||||||
import storagecraft.item.ItemStoragePart;
|
|
||||||
import storagecraft.item.ItemWirelessGrid;
|
|
||||||
import storagecraft.item.ItemWirelessGridPlate;
|
|
||||||
|
|
||||||
public final class StorageCraftItems
|
public final class StorageCraftItems
|
||||||
{
|
{
|
||||||
|
@@ -43,9 +43,9 @@ public abstract class BlockBase extends Block
|
|||||||
protected BlockState createBlockState()
|
protected BlockState createBlockState()
|
||||||
{
|
{
|
||||||
return new BlockState(this, new IProperty[]
|
return new BlockState(this, new IProperty[]
|
||||||
{
|
{
|
||||||
DIRECTION,
|
DIRECTION,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package storagecraft.block;
|
package storagecraft.block;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.block.ITileEntityProvider;
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.state.BlockState;
|
import net.minecraft.block.state.BlockState;
|
||||||
@@ -13,6 +11,8 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.tile.TileCable;
|
import storagecraft.tile.TileCable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BlockCable extends BlockBase
|
public class BlockCable extends BlockBase
|
||||||
{
|
{
|
||||||
public static final PropertyBool SENSITIVE = PropertyBool.create("sensitive");
|
public static final PropertyBool SENSITIVE = PropertyBool.create("sensitive");
|
||||||
@@ -26,10 +26,10 @@ public class BlockCable extends BlockBase
|
|||||||
protected BlockState createBlockState()
|
protected BlockState createBlockState()
|
||||||
{
|
{
|
||||||
return new BlockState(this, new IProperty[]
|
return new BlockState(this, new IProperty[]
|
||||||
{
|
{
|
||||||
DIRECTION,
|
DIRECTION,
|
||||||
SENSITIVE
|
SENSITIVE
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,7 +51,8 @@ public class BlockCable extends BlockBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileCable();
|
return new TileCable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,7 +18,8 @@ public class BlockConstructor extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileConstructor();
|
return new TileConstructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,10 +27,10 @@ public class BlockController extends BlockBase
|
|||||||
protected BlockState createBlockState()
|
protected BlockState createBlockState()
|
||||||
{
|
{
|
||||||
return new BlockState(this, new IProperty[]
|
return new BlockState(this, new IProperty[]
|
||||||
{
|
{
|
||||||
DIRECTION,
|
DIRECTION,
|
||||||
ENERGY
|
ENERGY
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -47,7 +47,8 @@ public class BlockController extends BlockBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileController();
|
return new TileController();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,7 +18,8 @@ public class BlockDestructor extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileDestructor();
|
return new TileDestructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,7 +19,8 @@ public class BlockDetector extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileDetector();
|
return new TileDetector();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileDrive;
|
import storagecraft.tile.TileDrive;
|
||||||
|
|
||||||
public class BlockDrive extends BlockMachine
|
public class BlockDrive extends BlockMachine
|
||||||
@@ -19,7 +18,8 @@ public class BlockDrive extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileDrive();
|
return new TileDrive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileExporter;
|
import storagecraft.tile.TileExporter;
|
||||||
|
|
||||||
public class BlockExporter extends BlockMachine
|
public class BlockExporter extends BlockMachine
|
||||||
@@ -19,7 +18,8 @@ public class BlockExporter extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileExporter();
|
return new TileExporter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileExternalStorage;
|
import storagecraft.tile.TileExternalStorage;
|
||||||
|
|
||||||
public class BlockExternalStorage extends BlockMachine
|
public class BlockExternalStorage extends BlockMachine
|
||||||
@@ -19,7 +18,8 @@ public class BlockExternalStorage extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileExternalStorage();
|
return new TileExternalStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package storagecraft.block;
|
package storagecraft.block;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockState;
|
import net.minecraft.block.state.BlockState;
|
||||||
@@ -15,11 +14,10 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import static storagecraft.block.BlockMachine.CONNECTED;
|
|
||||||
|
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileGrid;
|
import storagecraft.tile.TileGrid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BlockGrid extends BlockMachine
|
public class BlockGrid extends BlockMachine
|
||||||
{
|
{
|
||||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumGridType.class);
|
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumGridType.class);
|
||||||
@@ -30,7 +28,8 @@ public class BlockGrid extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileGrid();
|
return new TileGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,11 +46,11 @@ public class BlockGrid extends BlockMachine
|
|||||||
protected BlockState createBlockState()
|
protected BlockState createBlockState()
|
||||||
{
|
{
|
||||||
return new BlockState(this, new IProperty[]
|
return new BlockState(this, new IProperty[]
|
||||||
{
|
{
|
||||||
DIRECTION,
|
DIRECTION,
|
||||||
CONNECTED,
|
CONNECTED,
|
||||||
TYPE
|
TYPE
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -8,7 +8,6 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileImporter;
|
import storagecraft.tile.TileImporter;
|
||||||
|
|
||||||
public class BlockImporter extends BlockMachine
|
public class BlockImporter extends BlockMachine
|
||||||
@@ -19,7 +18,8 @@ public class BlockImporter extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileImporter();
|
return new TileImporter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,10 +27,10 @@ public abstract class BlockMachine extends BlockBase
|
|||||||
protected BlockState createBlockState()
|
protected BlockState createBlockState()
|
||||||
{
|
{
|
||||||
return new BlockState(this, new IProperty[]
|
return new BlockState(this, new IProperty[]
|
||||||
{
|
{
|
||||||
DIRECTION,
|
DIRECTION,
|
||||||
CONNECTED
|
CONNECTED
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -8,7 +8,6 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileSolderer;
|
import storagecraft.tile.TileSolderer;
|
||||||
|
|
||||||
public class BlockSolderer extends BlockMachine
|
public class BlockSolderer extends BlockMachine
|
||||||
@@ -19,7 +18,8 @@ public class BlockSolderer extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileSolderer();
|
return new TileSolderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileWirelessTransmitter;
|
import storagecraft.tile.TileWirelessTransmitter;
|
||||||
|
|
||||||
// @TODO: This texture behaves differently
|
// @TODO: This texture behaves differently
|
||||||
@@ -20,7 +19,8 @@ public class BlockWirelessTransmitter extends BlockMachine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
public TileEntity createTileEntity(World world, IBlockState state)
|
||||||
|
{
|
||||||
return new TileWirelessTransmitter();
|
return new TileWirelessTransmitter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
src/main/java/storagecraft/container/ContainerBase.java
Normal file → Executable file
8
src/main/java/storagecraft/container/ContainerBase.java
Normal file → Executable file
@@ -1,13 +1,14 @@
|
|||||||
package storagecraft.container;
|
package storagecraft.container;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import storagecraft.container.slot.SlotSpecimen;
|
import storagecraft.container.slot.SlotSpecimen;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class ContainerBase extends Container
|
public abstract class ContainerBase extends Container
|
||||||
{
|
{
|
||||||
private EntityPlayer player;
|
private EntityPlayer player;
|
||||||
@@ -64,8 +65,7 @@ public abstract class ContainerBase extends Container
|
|||||||
if (clickedButton == 2 || player.inventory.getItemStack() == null)
|
if (clickedButton == 2 || player.inventory.getItemStack() == null)
|
||||||
{
|
{
|
||||||
slot.putStack(null);
|
slot.putStack(null);
|
||||||
}
|
} else if (slot.isItemValid(player.inventory.getItemStack()))
|
||||||
else if (slot.isItemValid(player.inventory.getItemStack()))
|
|
||||||
{
|
{
|
||||||
slot.putStack(player.inventory.getItemStack().copy());
|
slot.putStack(player.inventory.getItemStack().copy());
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/container/ContainerDetector.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerDetector.java
Normal file → Executable file
9
src/main/java/storagecraft/container/ContainerDrive.java
Normal file → Executable file
9
src/main/java/storagecraft/container/ContainerDrive.java
Normal file → Executable file
@@ -24,8 +24,7 @@ public class ContainerDrive extends ContainerBase
|
|||||||
{
|
{
|
||||||
x = 71;
|
x = 71;
|
||||||
y += 18;
|
y += 18;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
x += 18;
|
x += 18;
|
||||||
}
|
}
|
||||||
@@ -51,8 +50,7 @@ public class ContainerDrive extends ContainerBase
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
} else if (!mergeItemStack(stack, 0, 8, false))
|
||||||
else if (!mergeItemStack(stack, 0, 8, false))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -60,8 +58,7 @@ public class ContainerDrive extends ContainerBase
|
|||||||
if (stack.stackSize == 0)
|
if (stack.stackSize == 0)
|
||||||
{
|
{
|
||||||
slot.putStack(null);
|
slot.putStack(null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
slot.onSlotChanged();
|
slot.onSlotChanged();
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/container/ContainerExporter.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerExporter.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerExternalStorage.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerExternalStorage.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerGrid.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerGrid.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerImporter.java
Normal file → Executable file
0
src/main/java/storagecraft/container/ContainerImporter.java
Normal file → Executable file
@@ -44,8 +44,7 @@ public class ContainerSolderer extends ContainerBase
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
} else if (!mergeItemStack(stack, 0, 3, false))
|
||||||
else if (!mergeItemStack(stack, 0, 3, false))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -53,8 +52,7 @@ public class ContainerSolderer extends ContainerBase
|
|||||||
if (stack.stackSize == 0)
|
if (stack.stackSize == 0)
|
||||||
{
|
{
|
||||||
slot.putStack(null);
|
slot.putStack(null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
slot.onSlotChanged();
|
slot.onSlotChanged();
|
||||||
}
|
}
|
||||||
|
@@ -39,8 +39,7 @@ public class ContainerWirelessTransmitter extends ContainerBase
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
} else if (!mergeItemStack(stack, 0, 3, false))
|
||||||
else if (!mergeItemStack(stack, 0, 3, false))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -48,8 +47,7 @@ public class ContainerWirelessTransmitter extends ContainerBase
|
|||||||
if (stack.stackSize == 0)
|
if (stack.stackSize == 0)
|
||||||
{
|
{
|
||||||
slot.putStack(null);
|
slot.putStack(null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
slot.onSlotChanged();
|
slot.onSlotChanged();
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/container/slot/SlotItemFilter.java
Normal file → Executable file
0
src/main/java/storagecraft/container/slot/SlotItemFilter.java
Normal file → Executable file
0
src/main/java/storagecraft/container/slot/SlotSpecimen.java
Normal file → Executable file
0
src/main/java/storagecraft/container/slot/SlotSpecimen.java
Normal file → Executable file
9
src/main/java/storagecraft/gui/GuiBase.java
Normal file → Executable file
9
src/main/java/storagecraft/gui/GuiBase.java
Normal file → Executable file
@@ -1,9 +1,5 @@
|
|||||||
package storagecraft.gui;
|
package storagecraft.gui;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
@@ -16,6 +12,11 @@ import org.lwjgl.opengl.GL11;
|
|||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.gui.sidebutton.SideButton;
|
import storagecraft.gui.sidebutton.SideButton;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class GuiBase extends GuiContainer
|
public abstract class GuiBase extends GuiContainer
|
||||||
{
|
{
|
||||||
public static final int SIDE_BUTTON_WIDTH = 20;
|
public static final int SIDE_BUTTON_WIDTH = 20;
|
||||||
|
6
src/main/java/storagecraft/gui/GuiDetector.java
Normal file → Executable file
6
src/main/java/storagecraft/gui/GuiDetector.java
Normal file → Executable file
@@ -1,7 +1,6 @@
|
|||||||
package storagecraft.gui;
|
package storagecraft.gui;
|
||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import java.io.IOException;
|
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.container.ContainerDetector;
|
import storagecraft.container.ContainerDetector;
|
||||||
@@ -11,6 +10,8 @@ import storagecraft.network.MessageDetectorAmountUpdate;
|
|||||||
import storagecraft.tile.TileDetector;
|
import storagecraft.tile.TileDetector;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class GuiDetector extends GuiBase
|
public class GuiDetector extends GuiBase
|
||||||
{
|
{
|
||||||
private TileDetector detector;
|
private TileDetector detector;
|
||||||
@@ -74,8 +75,7 @@ public class GuiDetector extends GuiBase
|
|||||||
{
|
{
|
||||||
StorageCraft.NETWORK.sendToServer(new MessageDetectorAmountUpdate(detector, result));
|
StorageCraft.NETWORK.sendToServer(new MessageDetectorAmountUpdate(detector, result));
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
super.keyTyped(character, keyCode);
|
super.keyTyped(character, keyCode);
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/gui/GuiDrive.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/GuiDrive.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/GuiExporter.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/GuiExporter.java
Normal file → Executable file
@@ -1,10 +1,5 @@
|
|||||||
package storagecraft.gui;
|
package storagecraft.gui;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
@@ -26,6 +21,12 @@ import storagecraft.storage.StorageItem;
|
|||||||
import storagecraft.tile.TileController;
|
import storagecraft.tile.TileController;
|
||||||
import storagecraft.tile.TileGrid;
|
import storagecraft.tile.TileGrid;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class GuiGrid extends GuiBase
|
public class GuiGrid extends GuiBase
|
||||||
{
|
{
|
||||||
public static final int SORTING_DIRECTION_ASCENDING = 0;
|
public static final int SORTING_DIRECTION_ASCENDING = 0;
|
||||||
@@ -132,8 +133,7 @@ public class GuiGrid extends GuiBase
|
|||||||
if (grid.getType() == EnumGridType.CRAFTING)
|
if (grid.getType() == EnumGridType.CRAFTING)
|
||||||
{
|
{
|
||||||
bindTexture("gui/crafting_grid.png");
|
bindTexture("gui/crafting_grid.png");
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
bindTexture("gui/grid.png");
|
bindTexture("gui/grid.png");
|
||||||
}
|
}
|
||||||
@@ -306,16 +306,13 @@ public class GuiGrid extends GuiBase
|
|||||||
if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null)
|
if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null)
|
||||||
{
|
{
|
||||||
StorageCraft.NETWORK.sendToServer(new MessageStoragePush(controller.getPos().getX(), controller.getPos().getY(), controller.getPos().getZ(), -1, clickedButton == 1));
|
StorageCraft.NETWORK.sendToServer(new MessageStoragePush(controller.getPos().getX(), controller.getPos().getY(), controller.getPos().getZ(), -1, clickedButton == 1));
|
||||||
}
|
} else if (isHoveringOverValidSlot() && container.getPlayer().inventory.getItemStack() == null)
|
||||||
else if (isHoveringOverValidSlot() && container.getPlayer().inventory.getItemStack() == null)
|
|
||||||
{
|
{
|
||||||
StorageCraft.NETWORK.sendToServer(new MessageStoragePull(controller.getPos().getX(), controller.getPos().getY(), controller.getPos().getZ(), hoveringId, clickedButton == 1, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
|
StorageCraft.NETWORK.sendToServer(new MessageStoragePull(controller.getPos().getX(), controller.getPos().getY(), controller.getPos().getZ(), hoveringId, clickedButton == 1, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
|
||||||
}
|
} else if (clickedClear)
|
||||||
else if (clickedClear)
|
|
||||||
{
|
{
|
||||||
StorageCraft.NETWORK.sendToServer(new MessageGridCraftingClear(grid));
|
StorageCraft.NETWORK.sendToServer(new MessageGridCraftingClear(grid));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for (Slot slot : container.getPlayerInventorySlots())
|
for (Slot slot : container.getPlayerInventorySlots())
|
||||||
{
|
{
|
||||||
@@ -341,8 +338,7 @@ public class GuiGrid extends GuiBase
|
|||||||
{
|
{
|
||||||
if (!checkHotbarKeys(keyCode) && searchField.textboxKeyTyped(character, keyCode))
|
if (!checkHotbarKeys(keyCode) && searchField.textboxKeyTyped(character, keyCode))
|
||||||
{
|
{
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
super.keyTyped(character, keyCode);
|
super.keyTyped(character, keyCode);
|
||||||
}
|
}
|
||||||
|
@@ -7,28 +7,8 @@ import net.minecraft.util.BlockPos;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||||
import storagecraft.StorageCraftGUI;
|
import storagecraft.StorageCraftGUI;
|
||||||
import storagecraft.container.ContainerConstructor;
|
import storagecraft.container.*;
|
||||||
import storagecraft.container.ContainerController;
|
import storagecraft.tile.*;
|
||||||
import storagecraft.container.ContainerDestructor;
|
|
||||||
import storagecraft.container.ContainerDetector;
|
|
||||||
import storagecraft.container.ContainerDrive;
|
|
||||||
import storagecraft.container.ContainerExporter;
|
|
||||||
import storagecraft.container.ContainerGrid;
|
|
||||||
import storagecraft.container.ContainerImporter;
|
|
||||||
import storagecraft.container.ContainerSolderer;
|
|
||||||
import storagecraft.container.ContainerExternalStorage;
|
|
||||||
import storagecraft.container.ContainerWirelessTransmitter;
|
|
||||||
import storagecraft.tile.TileConstructor;
|
|
||||||
import storagecraft.tile.TileController;
|
|
||||||
import storagecraft.tile.TileDestructor;
|
|
||||||
import storagecraft.tile.TileDetector;
|
|
||||||
import storagecraft.tile.TileDrive;
|
|
||||||
import storagecraft.tile.TileExporter;
|
|
||||||
import storagecraft.tile.TileGrid;
|
|
||||||
import storagecraft.tile.TileImporter;
|
|
||||||
import storagecraft.tile.TileSolderer;
|
|
||||||
import storagecraft.tile.TileExternalStorage;
|
|
||||||
import storagecraft.tile.TileWirelessTransmitter;
|
|
||||||
|
|
||||||
public class GuiHandler implements IGuiHandler
|
public class GuiHandler implements IGuiHandler
|
||||||
{
|
{
|
||||||
|
0
src/main/java/storagecraft/gui/GuiImporter.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/GuiImporter.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButton.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButton.java
Normal file → Executable file
@@ -27,8 +27,7 @@ public class SideButtonCompare extends SideButton
|
|||||||
if ((setting.getCompare() & mask) == mask)
|
if ((setting.getCompare() & mask) == mask)
|
||||||
{
|
{
|
||||||
builder.append(gui.t("misc.storagecraft:yes"));
|
builder.append(gui.t("misc.storagecraft:yes"));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
builder.append(gui.t("misc.storagecraft:no"));
|
builder.append(gui.t("misc.storagecraft:no"));
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/gui/sidebutton/SideButtonDetectorMode.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonDetectorMode.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonGridSortingDirection.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonGridSortingDirection.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonGridSortingType.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonGridSortingType.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonImporterMode.java
Normal file → Executable file
0
src/main/java/storagecraft/gui/sidebutton/SideButtonImporterMode.java
Normal file → Executable file
@@ -40,8 +40,7 @@ public class InventorySimple implements IInventory
|
|||||||
if (stack.stackSize <= amount)
|
if (stack.stackSize <= amount)
|
||||||
{
|
{
|
||||||
setInventorySlotContents(slot, null);
|
setInventorySlotContents(slot, null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
stack = stack.splitStack(amount);
|
stack = stack.splitStack(amount);
|
||||||
|
|
||||||
|
0
src/main/java/storagecraft/item/ItemBase.java
Normal file → Executable file
0
src/main/java/storagecraft/item/ItemBase.java
Normal file → Executable file
0
src/main/java/storagecraft/item/ItemBlockBase.java
Normal file → Executable file
0
src/main/java/storagecraft/item/ItemBlockBase.java
Normal file → Executable file
0
src/main/java/storagecraft/item/ItemBlockCable.java
Normal file → Executable file
0
src/main/java/storagecraft/item/ItemBlockCable.java
Normal file → Executable file
@@ -1,10 +1,11 @@
|
|||||||
package storagecraft.item;
|
package storagecraft.item;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemCore extends ItemBase
|
public class ItemCore extends ItemBase
|
||||||
{
|
{
|
||||||
public static final int TYPE_CONSTRUCTION = 0;
|
public static final int TYPE_CONSTRUCTION = 0;
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
package storagecraft.item;
|
package storagecraft.item;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemProcessor extends ItemBase
|
public class ItemProcessor extends ItemBase
|
||||||
{
|
{
|
||||||
public static final int TYPE_PRINTED_BASIC = 0;
|
public static final int TYPE_PRINTED_BASIC = 0;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package storagecraft.item;
|
package storagecraft.item;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
@@ -11,6 +10,8 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.storage.CellStorage;
|
import storagecraft.storage.CellStorage;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemStorageCell extends ItemBase
|
public class ItemStorageCell extends ItemBase
|
||||||
{
|
{
|
||||||
public static final int TYPE_1K = 0;
|
public static final int TYPE_1K = 0;
|
||||||
@@ -43,8 +44,7 @@ public class ItemStorageCell extends ItemBase
|
|||||||
if (getCapacity(cell) == -1)
|
if (getCapacity(cell) == -1)
|
||||||
{
|
{
|
||||||
list.add(String.format(StatCollector.translateToLocal("misc.storagecraft:storage_cell_stored"), getStored(cell)));
|
list.add(String.format(StatCollector.translateToLocal("misc.storagecraft:storage_cell_stored"), getStored(cell)));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
list.add(String.format(StatCollector.translateToLocal("misc.storagecraft:storage_cell_stored_capacity"), getStored(cell), getCapacity(cell)));
|
list.add(String.format(StatCollector.translateToLocal("misc.storagecraft:storage_cell_stored_capacity"), getStored(cell), getCapacity(cell)));
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
package storagecraft.item;
|
package storagecraft.item;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemStoragePart extends ItemBase
|
public class ItemStoragePart extends ItemBase
|
||||||
{
|
{
|
||||||
public static final int TYPE_1K = 0;
|
public static final int TYPE_1K = 0;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package storagecraft.item;
|
package storagecraft.item;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
@@ -16,6 +15,8 @@ import storagecraft.block.EnumGridType;
|
|||||||
import storagecraft.tile.TileGrid;
|
import storagecraft.tile.TileGrid;
|
||||||
import storagecraft.tile.TileWirelessTransmitter;
|
import storagecraft.tile.TileWirelessTransmitter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemWirelessGrid extends ItemBase
|
public class ItemWirelessGrid extends ItemBase
|
||||||
{
|
{
|
||||||
public static final String NBT_WIRELESS_TRANSMITTER_X = "WirelessTransmitterX";
|
public static final String NBT_WIRELESS_TRANSMITTER_X = "WirelessTransmitterX";
|
||||||
@@ -75,28 +76,23 @@ public class ItemWirelessGrid extends ItemBase
|
|||||||
if (grid == null)
|
if (grid == null)
|
||||||
{
|
{
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.no_grid." + stack.getItemDamage())));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.no_grid." + stack.getItemDamage())));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.openGui(StorageCraft.INSTANCE, StorageCraftGUI.GRID, world, grid.getPos().getX(), grid.getPos().getY(), grid.getPos().getZ());
|
player.openGui(StorageCraft.INSTANCE, StorageCraftGUI.GRID, world, grid.getPos().getX(), grid.getPos().getY(), grid.getPos().getZ());
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.not_working")));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.not_working")));
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.not_found")));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.not_found")));
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.out_of_range")));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.out_of_range")));
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.not_set." + stack.getItemDamage())));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("misc.storagecraft:wireless_grid.not_set." + stack.getItemDamage())));
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/network/MessageDetectorAmountUpdate.java
Normal file → Executable file
0
src/main/java/storagecraft/network/MessageDetectorAmountUpdate.java
Normal file → Executable file
0
src/main/java/storagecraft/network/MessageDetectorModeUpdate.java
Normal file → Executable file
0
src/main/java/storagecraft/network/MessageDetectorModeUpdate.java
Normal file → Executable file
0
src/main/java/storagecraft/network/MessageImporterModeUpdate.java
Normal file → Executable file
0
src/main/java/storagecraft/network/MessageImporterModeUpdate.java
Normal file → Executable file
3
src/main/java/storagecraft/network/MessageStoragePull.java
Normal file → Executable file
3
src/main/java/storagecraft/network/MessageStoragePull.java
Normal file → Executable file
@@ -89,8 +89,7 @@ public class MessageStoragePull extends MessageHandlerPlayerToServer<MessageStor
|
|||||||
{
|
{
|
||||||
controller.push(took);
|
controller.push(took);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.inventory.setItemStack(took);
|
player.inventory.setItemStack(took);
|
||||||
player.updateHeldItem();
|
player.updateHeldItem();
|
||||||
|
9
src/main/java/storagecraft/network/MessageStoragePush.java
Normal file → Executable file
9
src/main/java/storagecraft/network/MessageStoragePush.java
Normal file → Executable file
@@ -68,8 +68,7 @@ public class MessageStoragePush extends MessageHandlerPlayerToServer<MessageStor
|
|||||||
{
|
{
|
||||||
stack.stackSize = 1;
|
stack.stackSize = 1;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
stack = player.inventory.getStackInSlot(message.slot);
|
stack = player.inventory.getStackInSlot(message.slot);
|
||||||
}
|
}
|
||||||
@@ -90,15 +89,13 @@ public class MessageStoragePush extends MessageHandlerPlayerToServer<MessageStor
|
|||||||
{
|
{
|
||||||
player.inventory.setItemStack(null);
|
player.inventory.setItemStack(null);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.inventory.setItemStack(null);
|
player.inventory.setItemStack(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.updateHeldItem();
|
player.updateHeldItem();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player.inventory.setInventorySlotContents(message.slot, null);
|
player.inventory.setInventorySlotContents(message.slot, null);
|
||||||
}
|
}
|
||||||
|
0
src/main/java/storagecraft/network/MessageTileUpdate.java
Normal file → Executable file
0
src/main/java/storagecraft/network/MessageTileUpdate.java
Normal file → Executable file
@@ -6,7 +6,6 @@ import net.minecraft.client.resources.model.ModelBakery;
|
|||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
|
||||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
@@ -13,40 +13,10 @@ import storagecraft.StorageCraft;
|
|||||||
import storagecraft.StorageCraftBlocks;
|
import storagecraft.StorageCraftBlocks;
|
||||||
import storagecraft.StorageCraftItems;
|
import storagecraft.StorageCraftItems;
|
||||||
import storagecraft.gui.GuiHandler;
|
import storagecraft.gui.GuiHandler;
|
||||||
import storagecraft.item.ItemBlockCable;
|
import storagecraft.item.*;
|
||||||
import storagecraft.item.ItemBlockGrid;
|
import storagecraft.network.*;
|
||||||
import storagecraft.item.ItemCore;
|
import storagecraft.tile.*;
|
||||||
import storagecraft.item.ItemProcessor;
|
import storagecraft.tile.solderer.*;
|
||||||
import storagecraft.item.ItemStorageCell;
|
|
||||||
import storagecraft.item.ItemStoragePart;
|
|
||||||
import storagecraft.network.MessageCompareUpdate;
|
|
||||||
import storagecraft.network.MessageDetectorAmountUpdate;
|
|
||||||
import storagecraft.network.MessageDetectorModeUpdate;
|
|
||||||
import storagecraft.network.MessageGridCraftingClear;
|
|
||||||
import storagecraft.network.MessageGridCraftingUpdate;
|
|
||||||
import storagecraft.network.MessageImporterModeUpdate;
|
|
||||||
import storagecraft.network.MessageRedstoneModeUpdate;
|
|
||||||
import storagecraft.network.MessageStoragePull;
|
|
||||||
import storagecraft.network.MessageStoragePush;
|
|
||||||
import storagecraft.network.MessageTileUpdate;
|
|
||||||
import storagecraft.tile.TileCable;
|
|
||||||
import storagecraft.tile.TileConstructor;
|
|
||||||
import storagecraft.tile.TileController;
|
|
||||||
import storagecraft.tile.TileDestructor;
|
|
||||||
import storagecraft.tile.TileDetector;
|
|
||||||
import storagecraft.tile.TileDrive;
|
|
||||||
import storagecraft.tile.TileExporter;
|
|
||||||
import storagecraft.tile.TileGrid;
|
|
||||||
import storagecraft.tile.TileImporter;
|
|
||||||
import storagecraft.tile.TileSolderer;
|
|
||||||
import storagecraft.tile.TileExternalStorage;
|
|
||||||
import storagecraft.tile.TileWirelessTransmitter;
|
|
||||||
import storagecraft.tile.solderer.SoldererRecipeCraftingGrid;
|
|
||||||
import storagecraft.tile.solderer.SoldererRecipeDrive;
|
|
||||||
import storagecraft.tile.solderer.SoldererRecipePrintedProcessor;
|
|
||||||
import storagecraft.tile.solderer.SoldererRecipeProcessor;
|
|
||||||
import storagecraft.tile.solderer.SoldererRecipeWirelessGrid;
|
|
||||||
import storagecraft.tile.solderer.SoldererRegistry;
|
|
||||||
|
|
||||||
public class CommonProxy
|
public class CommonProxy
|
||||||
{
|
{
|
||||||
|
0
src/main/java/storagecraft/render/BlockCableRenderer.java
Normal file → Executable file
0
src/main/java/storagecraft/render/BlockCableRenderer.java
Normal file → Executable file
9
src/main/java/storagecraft/render/model/CableModel.java
Normal file → Executable file
9
src/main/java/storagecraft/render/model/CableModel.java
Normal file → Executable file
@@ -58,8 +58,7 @@ public class CableModel extends ModelBase
|
|||||||
if (cable.getItemDamage() == 1)
|
if (cable.getItemDamage() == 1)
|
||||||
{
|
{
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_UNPOWERED_RESOURCE);
|
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_UNPOWERED_RESOURCE);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_RESOURCE);
|
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_RESOURCE);
|
||||||
}
|
}
|
||||||
@@ -82,13 +81,11 @@ public class CableModel extends ModelBase
|
|||||||
if (cable.isPowered())
|
if (cable.isPowered())
|
||||||
{
|
{
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_POWERED_RESOURCE);
|
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_POWERED_RESOURCE);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_UNPOWERED_RESOURCE);
|
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_UNPOWERED_RESOURCE);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_RESOURCE);
|
Minecraft.getMinecraft().renderEngine.bindTexture(CABLE_RESOURCE);
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
package storagecraft.storage;
|
package storagecraft.storage;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import storagecraft.item.ItemStorageCell;
|
import storagecraft.item.ItemStorageCell;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CellStorage implements IStorage
|
public class CellStorage implements IStorage
|
||||||
{
|
{
|
||||||
public static final String NBT_ITEMS = "Items";
|
public static final String NBT_ITEMS = "Items";
|
||||||
|
3
src/main/java/storagecraft/storage/IStorage.java
Normal file → Executable file
3
src/main/java/storagecraft/storage/IStorage.java
Normal file → Executable file
@@ -1,8 +1,9 @@
|
|||||||
package storagecraft.storage;
|
package storagecraft.storage;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface IStorage
|
public interface IStorage
|
||||||
{
|
{
|
||||||
public void addItems(List<StorageItem> items);
|
public void addItems(List<StorageItem> items);
|
||||||
|
0
src/main/java/storagecraft/storage/IStorageProvider.java
Normal file → Executable file
0
src/main/java/storagecraft/storage/IStorageProvider.java
Normal file → Executable file
0
src/main/java/storagecraft/storage/StorageItem.java
Normal file → Executable file
0
src/main/java/storagecraft/storage/StorageItem.java
Normal file → Executable file
0
src/main/java/storagecraft/tile/INetworkTile.java
Normal file → Executable file
0
src/main/java/storagecraft/tile/INetworkTile.java
Normal file → Executable file
@@ -8,28 +8,28 @@ public enum RedstoneMode
|
|||||||
IGNORE(0),
|
IGNORE(0),
|
||||||
HIGH(1),
|
HIGH(1),
|
||||||
LOW(2);
|
LOW(2);
|
||||||
|
|
||||||
public static final String NBT = "RedstoneMode";
|
public static final String NBT = "RedstoneMode";
|
||||||
|
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
RedstoneMode(int id)
|
RedstoneMode(int id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RedstoneMode next()
|
public RedstoneMode next()
|
||||||
{
|
{
|
||||||
RedstoneMode next = getById(id + 1);
|
RedstoneMode next = getById(id + 1);
|
||||||
|
|
||||||
if (next == null)
|
if (next == null)
|
||||||
{
|
{
|
||||||
return getById(0);
|
return getById(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled(World world, BlockPos pos)
|
public boolean isEnabled(World world, BlockPos pos)
|
||||||
{
|
{
|
||||||
switch (this)
|
switch (this)
|
||||||
@@ -41,10 +41,10 @@ public enum RedstoneMode
|
|||||||
case LOW:
|
case LOW:
|
||||||
return !world.isBlockPowered(pos);
|
return !world.isBlockPowered(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RedstoneMode getById(int id)
|
public static RedstoneMode getById(int id)
|
||||||
{
|
{
|
||||||
for (RedstoneMode control : values())
|
for (RedstoneMode control : values())
|
||||||
@@ -54,7 +54,7 @@ public enum RedstoneMode
|
|||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9
src/main/java/storagecraft/tile/TileCable.java
Normal file → Executable file
9
src/main/java/storagecraft/tile/TileCable.java
Normal file → Executable file
@@ -1,12 +1,13 @@
|
|||||||
package storagecraft.tile;
|
package storagecraft.tile;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import storagecraft.block.BlockCable;
|
import storagecraft.block.BlockCable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TileCable extends TileBase
|
public class TileCable extends TileBase
|
||||||
{
|
{
|
||||||
public static boolean isCable(World world, BlockPos pos)
|
public static boolean isCable(World world, BlockPos pos)
|
||||||
@@ -84,12 +85,10 @@ public class TileCable extends TileBase
|
|||||||
machines.add((TileMachine) tile);
|
machines.add((TileMachine) tile);
|
||||||
|
|
||||||
visited.add(newPos);
|
visited.add(newPos);
|
||||||
}
|
} else if (tile instanceof TileCable && ((TileCable) tile).isEnabled())
|
||||||
else if (tile instanceof TileCable && ((TileCable) tile).isEnabled())
|
|
||||||
{
|
{
|
||||||
((TileCable) tile).addMachines(visited, machines, controller);
|
((TileCable) tile).addMachines(visited, machines, controller);
|
||||||
}
|
} else if (tile instanceof TileController && !controller.getPos().equals(newPos))
|
||||||
else if (tile instanceof TileController && !controller.getPos().equals(newPos))
|
|
||||||
{
|
{
|
||||||
worldObj.createExplosion(null, pos.getX(), pos.getY(), pos.getZ(), 4.5f, true);
|
worldObj.createExplosion(null, pos.getX(), pos.getY(), pos.getZ(), 4.5f, true);
|
||||||
}
|
}
|
||||||
|
@@ -205,8 +205,8 @@ public class TileConstructor extends TileMachine implements IInventory, ISidedIn
|
|||||||
public int[] getSlotsForFace(EnumFacing side)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return new int[]
|
return new int[]
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -3,8 +3,6 @@ package storagecraft.tile;
|
|||||||
import cofh.api.energy.EnergyStorage;
|
import cofh.api.energy.EnergyStorage;
|
||||||
import cofh.api.energy.IEnergyReceiver;
|
import cofh.api.energy.IEnergyReceiver;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -15,6 +13,9 @@ import storagecraft.storage.IStorageProvider;
|
|||||||
import storagecraft.storage.StorageItem;
|
import storagecraft.storage.StorageItem;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TileController extends TileBase implements IEnergyReceiver, INetworkTile, IRedstoneModeSetting
|
public class TileController extends TileBase implements IEnergyReceiver, INetworkTile, IRedstoneModeSetting
|
||||||
{
|
{
|
||||||
private List<StorageItem> items = new ArrayList<StorageItem>();
|
private List<StorageItem> items = new ArrayList<StorageItem>();
|
||||||
@@ -48,8 +49,7 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
if (!isActive())
|
if (!isActive())
|
||||||
{
|
{
|
||||||
disconnectAll();
|
disconnectAll();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
visitedCables.clear();
|
visitedCables.clear();
|
||||||
|
|
||||||
@@ -246,8 +246,7 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
if (newStack == null)
|
if (newStack == null)
|
||||||
{
|
{
|
||||||
newStack = took;
|
newStack = took;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
newStack.stackSize += took.stackSize;
|
newStack.stackSize += took.stackSize;
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
package storagecraft.tile;
|
package storagecraft.tile;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TileDestructor extends TileMachine
|
public class TileDestructor extends TileMachine
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@@ -83,18 +83,15 @@ public class TileDetector extends TileMachine implements IInventory, ISidedInven
|
|||||||
if (mode == MODE_UNDER && amount != 0)
|
if (mode == MODE_UNDER && amount != 0)
|
||||||
{
|
{
|
||||||
providesPower = true;
|
providesPower = true;
|
||||||
}
|
} else if (mode == MODE_EQUAL && amount == 0)
|
||||||
else if (mode == MODE_EQUAL && amount == 0)
|
|
||||||
{
|
{
|
||||||
providesPower = true;
|
providesPower = true;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
providesPower = false;
|
providesPower = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
providesPower = false;
|
providesPower = false;
|
||||||
}
|
}
|
||||||
@@ -311,8 +308,8 @@ public class TileDetector extends TileMachine implements IInventory, ISidedInven
|
|||||||
public int[] getSlotsForFace(EnumFacing side)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return new int[]
|
return new int[]
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package storagecraft.tile;
|
package storagecraft.tile;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -12,6 +11,8 @@ import storagecraft.storage.IStorage;
|
|||||||
import storagecraft.storage.IStorageProvider;
|
import storagecraft.storage.IStorageProvider;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TileDrive extends TileMachine implements IInventory, IStorageProvider
|
public class TileDrive extends TileMachine implements IInventory, IStorageProvider
|
||||||
{
|
{
|
||||||
private InventorySimple inventory = new InventorySimple("drive", 8);
|
private InventorySimple inventory = new InventorySimple("drive", 8);
|
||||||
|
@@ -73,12 +73,10 @@ public class TileExporter extends TileMachine implements IInventory, ISidedInven
|
|||||||
{
|
{
|
||||||
getController().push(took);
|
getController().push(took);
|
||||||
}
|
}
|
||||||
}
|
} else if (InventoryUtils.canPushToInventory(connectedInventory, took))
|
||||||
else if (InventoryUtils.canPushToInventory(connectedInventory, took))
|
|
||||||
{
|
{
|
||||||
InventoryUtils.pushToInventory(connectedInventory, took);
|
InventoryUtils.pushToInventory(connectedInventory, took);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
getController().push(took);
|
getController().push(took);
|
||||||
}
|
}
|
||||||
@@ -248,8 +246,8 @@ public class TileExporter extends TileMachine implements IInventory, ISidedInven
|
|||||||
public int[] getSlotsForFace(EnumFacing side)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return new int[]
|
return new int[]
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package storagecraft.tile;
|
package storagecraft.tile;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -9,6 +8,8 @@ import storagecraft.storage.IStorageProvider;
|
|||||||
import storagecraft.storage.StorageItem;
|
import storagecraft.storage.StorageItem;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TileExternalStorage extends TileMachine implements IStorageProvider, IStorage
|
public class TileExternalStorage extends TileMachine implements IStorageProvider, IStorage
|
||||||
{
|
{
|
||||||
public IInventory getInventory()
|
public IInventory getInventory()
|
||||||
|
0
src/main/java/storagecraft/tile/TileGrid.java
Normal file → Executable file
0
src/main/java/storagecraft/tile/TileGrid.java
Normal file → Executable file
@@ -69,8 +69,7 @@ public class TileImporter extends TileMachine implements IInventory, ISidedInven
|
|||||||
connectedInventory.setInventorySlotContents(currentSlot, null);
|
connectedInventory.setInventorySlotContents(currentSlot, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (getController().push(slot.copy()))
|
||||||
else if (getController().push(slot.copy()))
|
|
||||||
{
|
{
|
||||||
connectedInventory.setInventorySlotContents(currentSlot, null);
|
connectedInventory.setInventorySlotContents(currentSlot, null);
|
||||||
}
|
}
|
||||||
@@ -105,8 +104,7 @@ public class TileImporter extends TileMachine implements IInventory, ISidedInven
|
|||||||
if (mode == MODE_WHITELIST)
|
if (mode == MODE_WHITELIST)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
} else if (mode == MODE_BLACKLIST)
|
||||||
else if (mode == MODE_BLACKLIST)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -301,8 +299,8 @@ public class TileImporter extends TileMachine implements IInventory, ISidedInven
|
|||||||
public int[] getSlotsForFace(EnumFacing side)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return new int[]
|
return new int[]
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -41,16 +41,14 @@ public class TileSolderer extends TileMachine implements IInventory, ISidedInven
|
|||||||
if (newRecipe == null)
|
if (newRecipe == null)
|
||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
}
|
} else if (newRecipe != recipe && inventory.getStackInSlot(3) == null)
|
||||||
else if (newRecipe != recipe && inventory.getStackInSlot(3) == null)
|
|
||||||
{
|
{
|
||||||
recipe = newRecipe;
|
recipe = newRecipe;
|
||||||
progress = 0;
|
progress = 0;
|
||||||
working = true;
|
working = true;
|
||||||
|
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
} else if (working)
|
||||||
else if (working)
|
|
||||||
{
|
{
|
||||||
progress++;
|
progress++;
|
||||||
|
|
||||||
@@ -276,16 +274,16 @@ public class TileSolderer extends TileMachine implements IInventory, ISidedInven
|
|||||||
if (side != EnumFacing.DOWN)
|
if (side != EnumFacing.DOWN)
|
||||||
{
|
{
|
||||||
return new int[]
|
return new int[]
|
||||||
{
|
{
|
||||||
0, 1, 2
|
0, 1, 2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// On the bottom we can only reach the output slot
|
// On the bottom we can only reach the output slot
|
||||||
return new int[]
|
return new int[]
|
||||||
{
|
{
|
||||||
3
|
3
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -40,8 +40,7 @@ public class TileWirelessTransmitter extends TileMachine implements IInventory
|
|||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
}
|
} else if (inventory.getStackInSlot(0) != null)
|
||||||
else if (inventory.getStackInSlot(0) != null)
|
|
||||||
{
|
{
|
||||||
inventory.decrStackSize(0, 1);
|
inventory.decrStackSize(0, 1);
|
||||||
|
|
||||||
|
@@ -14,12 +14,10 @@ public class SoldererRecipeCraftingGrid implements ISoldererRecipe
|
|||||||
if (row == 0)
|
if (row == 0)
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
||||||
}
|
} else if (row == 1)
|
||||||
else if (row == 1)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftBlocks.GRID, 1, 0);
|
return new ItemStack(StorageCraftBlocks.GRID, 1, 0);
|
||||||
}
|
} else if (row == 2)
|
||||||
else if (row == 2)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(Blocks.crafting_table);
|
return new ItemStack(Blocks.crafting_table);
|
||||||
}
|
}
|
||||||
|
@@ -14,12 +14,10 @@ public class SoldererRecipeDrive implements ISoldererRecipe
|
|||||||
if (row == 0)
|
if (row == 0)
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
||||||
}
|
} else if (row == 1)
|
||||||
else if (row == 1)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftBlocks.MACHINE_CASING);
|
return new ItemStack(StorageCraftBlocks.MACHINE_CASING);
|
||||||
}
|
} else if (row == 2)
|
||||||
else if (row == 2)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(Blocks.chest);
|
return new ItemStack(Blocks.chest);
|
||||||
}
|
}
|
||||||
|
@@ -28,12 +28,10 @@ public class SoldererRecipeProcessor implements ISoldererRecipe
|
|||||||
case ItemProcessor.TYPE_ADVANCED:
|
case ItemProcessor.TYPE_ADVANCED:
|
||||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_ADVANCED);
|
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_ADVANCED);
|
||||||
}
|
}
|
||||||
}
|
} else if (row == 1)
|
||||||
else if (row == 1)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(Items.redstone);
|
return new ItemStack(Items.redstone);
|
||||||
}
|
} else if (row == 2)
|
||||||
else if (row == 2)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON);
|
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON);
|
||||||
}
|
}
|
||||||
|
@@ -20,12 +20,10 @@ public class SoldererRecipeWirelessGrid implements ISoldererRecipe
|
|||||||
if (row == 0)
|
if (row == 0)
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftItems.WIRELESS_GRID_PLATE);
|
return new ItemStack(StorageCraftItems.WIRELESS_GRID_PLATE);
|
||||||
}
|
} else if (row == 1)
|
||||||
else if (row == 1)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftBlocks.GRID, 1, type);
|
return new ItemStack(StorageCraftBlocks.GRID, 1, type);
|
||||||
}
|
} else if (row == 2)
|
||||||
else if (row == 2)
|
|
||||||
{
|
{
|
||||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
package storagecraft.tile.solderer;
|
package storagecraft.tile.solderer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class SoldererRegistry
|
public class SoldererRegistry
|
||||||
{
|
{
|
||||||
public static List<ISoldererRecipe> recipes = new ArrayList<ISoldererRecipe>();
|
public static List<ISoldererRecipe> recipes = new ArrayList<ISoldererRecipe>();
|
||||||
|
9
src/main/java/storagecraft/util/InventoryUtils.java
Normal file → Executable file
9
src/main/java/storagecraft/util/InventoryUtils.java
Normal file → Executable file
@@ -107,8 +107,7 @@ public class InventoryUtils
|
|||||||
if (slot == null)
|
if (slot == null)
|
||||||
{
|
{
|
||||||
inventory.setInventorySlotContents(i, stack);
|
inventory.setInventorySlotContents(i, stack);
|
||||||
}
|
} else if (compareStackNoQuantity(slot, stack))
|
||||||
else if (compareStackNoQuantity(slot, stack))
|
|
||||||
{
|
{
|
||||||
slot.stackSize += stack.stackSize;
|
slot.stackSize += stack.stackSize;
|
||||||
}
|
}
|
||||||
@@ -144,8 +143,7 @@ public class InventoryUtils
|
|||||||
inventory.setInventorySlotContents(i, stack);
|
inventory.setInventorySlotContents(i, stack);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
} else if (compareStackNoQuantity(slot, stack))
|
||||||
else if (compareStackNoQuantity(slot, stack))
|
|
||||||
{
|
{
|
||||||
int toAdd = toGo;
|
int toAdd = toGo;
|
||||||
|
|
||||||
@@ -177,8 +175,7 @@ public class InventoryUtils
|
|||||||
if (slot == null)
|
if (slot == null)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
} else if (compareStackNoQuantity(slot, stack))
|
||||||
else if (compareStackNoQuantity(slot, stack))
|
|
||||||
{
|
{
|
||||||
int toAdd = toGo;
|
int toAdd = toGo;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user