rename classes

This commit is contained in:
Raoul Van den Berge
2015-12-18 13:25:28 +01:00
parent 4d5af85215
commit 8bf0f66530
29 changed files with 86 additions and 86 deletions

View File

@@ -13,8 +13,8 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import storagecraft.proxy.CommonProxy; import storagecraft.proxy.CommonProxy;
@Mod(modid = SC.ID, version = SC.VERSION) @Mod(modid = StorageCraft.ID, version = StorageCraft.VERSION)
public class SC { public class StorageCraft {
public static final class GUI { public static final class GUI {
public static final int CONTROLLER = 0; public static final int CONTROLLER = 0;
public static final int GRID = 1; public static final int GRID = 1;
@@ -28,13 +28,13 @@ public class SC {
public static final CreativeTabs TAB = new CreativeTabs(ID) { public static final CreativeTabs TAB = new CreativeTabs(ID) {
@Override @Override
public Item getTabIconItem() { public Item getTabIconItem() {
return Item.getItemFromBlock(SCBlocks.CONTROLLER); return Item.getItemFromBlock(StorageCraftBlocks.CONTROLLER);
} }
}; };
@SidedProxy(clientSide = "storagecraft.proxy.ClientProxy", serverSide = "storagecraft.proxy.ServerProxy") @SidedProxy(clientSide = "storagecraft.proxy.ClientProxy", serverSide = "storagecraft.proxy.ServerProxy")
public static CommonProxy PROXY; public static CommonProxy PROXY;
@Instance @Instance
public static SC INSTANCE; public static StorageCraft INSTANCE;
@EventHandler @EventHandler
public void preInit(FMLPreInitializationEvent e) { public void preInit(FMLPreInitializationEvent e) {

View File

@@ -7,7 +7,7 @@ import storagecraft.block.BlockGrid;
import storagecraft.block.BlockImporter; import storagecraft.block.BlockImporter;
import storagecraft.block.BlockStorageProxy; import storagecraft.block.BlockStorageProxy;
public class SCBlocks { public class StorageCraftBlocks {
public static final BlockController CONTROLLER = new BlockController(); public static final BlockController CONTROLLER = new BlockController();
public static final BlockCable CABLE = new BlockCable(); public static final BlockCable CABLE = new BlockCable();
public static final BlockGrid GRID = new BlockGrid(); public static final BlockGrid GRID = new BlockGrid();

View File

@@ -2,6 +2,6 @@ package storagecraft;
import storagecraft.item.ItemStorageCell; import storagecraft.item.ItemStorageCell;
public class SCItems { public class StorageCraftItems {
public static final ItemStorageCell STORAGE_CELL = new ItemStorageCell(); public static final ItemStorageCell STORAGE_CELL = new ItemStorageCell();
} }

View File

@@ -9,25 +9,25 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.tile.TileSC; import storagecraft.tile.TileBase;
import storagecraft.util.InventoryUtils; import storagecraft.util.InventoryUtils;
public class BlockSC extends Block { public class BlockBase extends Block {
private String name; private String name;
public BlockSC(String name) { public BlockBase(String name) {
super(Material.rock); super(Material.rock);
this.name = name; this.name = name;
setCreativeTab(SC.TAB); setCreativeTab(StorageCraft.TAB);
setBlockTextureName("storagecraft:" + name); setBlockTextureName("storagecraft:" + name);
} }
@Override @Override
public String getUnlocalizedName() { public String getUnlocalizedName() {
return "block." + SC.ID + ":" + name; return "block." + StorageCraft.ID + ":" + name;
} }
@Override @Override
@@ -36,8 +36,8 @@ public class BlockSC extends Block {
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileSC) { if (tile instanceof TileBase) {
((TileSC) tile).setDirection(ForgeDirection.getOrientation(BlockPistonBase.determineOrientation(world, x, y, z, entityLiving))); ((TileBase) tile).setDirection(ForgeDirection.getOrientation(BlockPistonBase.determineOrientation(world, x, y, z, entityLiving)));
} }
} }

View File

@@ -5,7 +5,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.tile.TileCable; import storagecraft.tile.TileCable;
public class BlockCable extends BlockSC implements ITileEntityProvider { public class BlockCable extends BlockBase implements ITileEntityProvider {
public BlockCable() { public BlockCable() {
super("cable"); super("cable");
} }

View File

@@ -7,10 +7,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.tile.TileController; import storagecraft.tile.TileController;
public class BlockController extends BlockSC implements ITileEntityProvider { public class BlockController extends BlockBase implements ITileEntityProvider {
private IIcon sideIcon; private IIcon sideIcon;
private IIcon[] icons = new IIcon[6]; private IIcon[] icons = new IIcon[6];
@@ -26,7 +26,7 @@ public class BlockController extends BlockSC implements ITileEntityProvider {
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) { if (!world.isRemote) {
player.openGui(SC.INSTANCE, SC.GUI.CONTROLLER, world, x, y, z); player.openGui(StorageCraft.INSTANCE, StorageCraft.GUI.CONTROLLER, world, x, y, z);
} }
return true; return true;

View File

@@ -7,10 +7,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.tile.TileDrive; import storagecraft.tile.TileDrive;
public class BlockDrive extends BlockSC implements ITileEntityProvider { public class BlockDrive extends BlockBase implements ITileEntityProvider {
private IIcon frontIcon; private IIcon frontIcon;
private IIcon sideIcon; private IIcon sideIcon;
@@ -21,7 +21,7 @@ public class BlockDrive extends BlockSC implements ITileEntityProvider {
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) { if (!world.isRemote) {
player.openGui(SC.INSTANCE, SC.GUI.DRIVE, world, x, y, z); player.openGui(StorageCraft.INSTANCE, StorageCraft.GUI.DRIVE, world, x, y, z);
} }
return true; return true;

View File

@@ -7,10 +7,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.tile.TileGrid; import storagecraft.tile.TileGrid;
public class BlockGrid extends BlockSC implements ITileEntityProvider { public class BlockGrid extends BlockBase implements ITileEntityProvider {
private IIcon sideIcon; private IIcon sideIcon;
private IIcon connectedIcon; private IIcon connectedIcon;
private IIcon disconnectedIcon; private IIcon disconnectedIcon;
@@ -27,7 +27,7 @@ public class BlockGrid extends BlockSC implements ITileEntityProvider {
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) { if (!world.isRemote) {
player.openGui(SC.INSTANCE, SC.GUI.GRID, world, x, y, z); player.openGui(StorageCraft.INSTANCE, StorageCraft.GUI.GRID, world, x, y, z);
} }
return true; return true;

View File

@@ -7,10 +7,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.tile.TileImporter; import storagecraft.tile.TileImporter;
public class BlockImporter extends BlockSC implements ITileEntityProvider { public class BlockImporter extends BlockBase implements ITileEntityProvider {
private IIcon frontIcon; private IIcon frontIcon;
private IIcon sideIcon; private IIcon sideIcon;
@@ -26,7 +26,7 @@ public class BlockImporter extends BlockSC implements ITileEntityProvider {
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) { if (!world.isRemote) {
player.openGui(SC.INSTANCE, SC.GUI.IMPORTER, world, x, y, z); player.openGui(StorageCraft.INSTANCE, StorageCraft.GUI.IMPORTER, world, x, y, z);
} }
return true; return true;

View File

@@ -8,7 +8,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.tile.TileStorageProxy; import storagecraft.tile.TileStorageProxy;
public class BlockStorageProxy extends BlockSC implements ITileEntityProvider { public class BlockStorageProxy extends BlockBase implements ITileEntityProvider {
private IIcon frontIcon; private IIcon frontIcon;
private IIcon sideIcon; private IIcon sideIcon;

View File

@@ -6,10 +6,10 @@ 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;
public class ContainerSC extends Container { public class ContainerBase extends Container {
private EntityPlayer player; private EntityPlayer player;
public ContainerSC(EntityPlayer player) { public ContainerBase(EntityPlayer player) {
this.player = player; this.player = player;
} }

View File

@@ -2,7 +2,7 @@ package storagecraft.container;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class ContainerController extends ContainerSC { public class ContainerController extends ContainerBase {
public ContainerController(EntityPlayer player) { public ContainerController(EntityPlayer player) {
super(player); super(player);

View File

@@ -1,11 +1,11 @@
package storagecraft.container; package storagecraft.container;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import storagecraft.SCItems; import storagecraft.StorageCraftItems;
import storagecraft.container.slot.SlotItemFilter; import storagecraft.container.slot.SlotItemFilter;
import storagecraft.tile.TileDrive; import storagecraft.tile.TileDrive;
public class ContainerDrive extends ContainerSC { public class ContainerDrive extends ContainerBase {
public ContainerDrive(EntityPlayer player, TileDrive drive) { public ContainerDrive(EntityPlayer player, TileDrive drive) {
super(player); super(player);
@@ -15,7 +15,7 @@ public class ContainerDrive extends ContainerSC {
int y = 20; int y = 20;
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
addSlotToContainer(new SlotItemFilter(drive, i, x, y, SCItems.STORAGE_CELL)); addSlotToContainer(new SlotItemFilter(drive, i, x, y, StorageCraftItems.STORAGE_CELL));
if ((i + 1) % 2 == 0) { if ((i + 1) % 2 == 0) {
x = 71; x = 71;

View File

@@ -2,7 +2,7 @@ package storagecraft.container;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class ContainerGrid extends ContainerSC { public class ContainerGrid extends ContainerBase {
public ContainerGrid(EntityPlayer player) { public ContainerGrid(EntityPlayer player) {
super(player); super(player);

View File

@@ -4,7 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
import storagecraft.container.slot.SlotSpecimen; import storagecraft.container.slot.SlotSpecimen;
import storagecraft.tile.TileImporter; import storagecraft.tile.TileImporter;
public class ContainerImporter extends ContainerSC { public class ContainerImporter extends ContainerBase {
public ContainerImporter(EntityPlayer player, TileImporter importer) { public ContainerImporter(EntityPlayer player, TileImporter importer) {
super(player); super(player);

View File

@@ -7,7 +7,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.container.ContainerGrid; import storagecraft.container.ContainerGrid;
import storagecraft.network.MessageStoragePull; import storagecraft.network.MessageStoragePull;
import storagecraft.network.MessageStoragePush; import storagecraft.network.MessageStoragePush;
@@ -99,16 +99,16 @@ public class GuiGrid extends GuiContainer {
TileController controller = grid.getController(); TileController controller = grid.getController();
if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null) { if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null) {
SC.NETWORK.sendToServer(new MessageStoragePush(controller.xCoord, controller.yCoord, controller.zCoord, -1, clickedButton == 1)); StorageCraft.NETWORK.sendToServer(new MessageStoragePush(controller.xCoord, controller.yCoord, controller.zCoord, -1, clickedButton == 1));
} else if (isHoveringOverValidSlot() && container.getPlayer().inventory.getItemStack() == null) { } else if (isHoveringOverValidSlot() && container.getPlayer().inventory.getItemStack() == null) {
SC.NETWORK.sendToServer(new MessageStoragePull(controller.xCoord, controller.yCoord, controller.zCoord, hoveringSlot, clickedButton == 1, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))); StorageCraft.NETWORK.sendToServer(new MessageStoragePull(controller.xCoord, controller.yCoord, controller.zCoord, hoveringSlot, clickedButton == 1, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
} else { } else {
for (int i = 0; i < container.inventorySlots.size(); ++i) { for (int i = 0; i < container.inventorySlots.size(); ++i) {
Slot slot = (Slot) container.inventorySlots.get(i); Slot slot = (Slot) container.inventorySlots.get(i);
if (func_146978_c(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY)) { if (func_146978_c(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY)) {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
SC.NETWORK.sendToServer(new MessageStoragePush(controller.xCoord, controller.yCoord, controller.zCoord, slot.slotNumber, clickedButton == 1)); StorageCraft.NETWORK.sendToServer(new MessageStoragePush(controller.xCoord, controller.yCoord, controller.zCoord, slot.slotNumber, clickedButton == 1));
} }
} }
} }

View File

@@ -5,7 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.container.ContainerController; import storagecraft.container.ContainerController;
import storagecraft.container.ContainerDrive; import storagecraft.container.ContainerDrive;
import storagecraft.container.ContainerGrid; import storagecraft.container.ContainerGrid;
@@ -18,13 +18,13 @@ import storagecraft.tile.TileImporter;
public class GuiHandler implements IGuiHandler { public class GuiHandler implements IGuiHandler {
private Container getContainer(int ID, EntityPlayer player, TileEntity tile) { private Container getContainer(int ID, EntityPlayer player, TileEntity tile) {
switch (ID) { switch (ID) {
case SC.GUI.CONTROLLER: case StorageCraft.GUI.CONTROLLER:
return new ContainerController(player); return new ContainerController(player);
case SC.GUI.GRID: case StorageCraft.GUI.GRID:
return new ContainerGrid(player); return new ContainerGrid(player);
case SC.GUI.DRIVE: case StorageCraft.GUI.DRIVE:
return new ContainerDrive(player, (TileDrive) tile); return new ContainerDrive(player, (TileDrive) tile);
case SC.GUI.IMPORTER: case StorageCraft.GUI.IMPORTER:
return new ContainerImporter(player, (TileImporter) tile); return new ContainerImporter(player, (TileImporter) tile);
default: default:
return null; return null;
@@ -41,13 +41,13 @@ public class GuiHandler implements IGuiHandler {
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);
switch (ID) { switch (ID) {
case SC.GUI.CONTROLLER: case StorageCraft.GUI.CONTROLLER:
return new GuiController((ContainerController) getContainer(ID, player, tile), (TileController) tile); return new GuiController((ContainerController) getContainer(ID, player, tile), (TileController) tile);
case SC.GUI.GRID: case StorageCraft.GUI.GRID:
return new GuiGrid((ContainerGrid) getContainer(ID, player, tile), (TileGrid) tile); return new GuiGrid((ContainerGrid) getContainer(ID, player, tile), (TileGrid) tile);
case SC.GUI.DRIVE: case StorageCraft.GUI.DRIVE:
return new GuiDrive((ContainerDrive) getContainer(ID, player, tile)); return new GuiDrive((ContainerDrive) getContainer(ID, player, tile));
case SC.GUI.IMPORTER: case StorageCraft.GUI.IMPORTER:
return new GuiImporter((ContainerImporter) getContainer(ID, player, tile), (TileImporter) tile); return new GuiImporter((ContainerImporter) getContainer(ID, player, tile), (TileImporter) tile);
default: default:
return null; return null;

View File

@@ -5,7 +5,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.container.ContainerImporter; import storagecraft.container.ContainerImporter;
import storagecraft.network.MessageImporterUpdate; import storagecraft.network.MessageImporterUpdate;
import storagecraft.tile.TileImporter; import storagecraft.tile.TileImporter;
@@ -91,6 +91,6 @@ public class GuiImporter extends GuiContainer {
flags ^= InventoryUtils.COMPARE_DAMAGE; flags ^= InventoryUtils.COMPARE_DAMAGE;
} }
SC.NETWORK.sendToServer(new MessageImporterUpdate(importer.xCoord, importer.yCoord, importer.zCoord, flags)); StorageCraft.NETWORK.sendToServer(new MessageImporterUpdate(importer.xCoord, importer.yCoord, importer.zCoord, flags));
} }
} }

View File

@@ -4,12 +4,12 @@ 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;
public class InventorySC implements IInventory { public class InventorySimple implements IInventory {
private ItemStack[] inventory; private ItemStack[] inventory;
private int size; private int size;
private String name; private String name;
public InventorySC(String name, int size) { public InventorySimple(String name, int size) {
this.name = name; this.name = name;
this.size = size; this.size = size;
this.inventory = new ItemStack[size]; this.inventory = new ItemStack[size];

View File

@@ -2,21 +2,21 @@ package storagecraft.item;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import storagecraft.SC; import storagecraft.StorageCraft;
public class ItemSC extends Item { public class ItemBase extends Item {
private String name; private String name;
public ItemSC(String name) { public ItemBase(String name) {
this.name = name; this.name = name;
setCreativeTab(SC.TAB); setCreativeTab(StorageCraft.TAB);
setTextureName("storagecraft:" + name); setTextureName("storagecraft:" + name);
} }
@Override @Override
public String getUnlocalizedName() { public String getUnlocalizedName() {
return "item." + SC.ID + ":" + name; return "item." + StorageCraft.ID + ":" + name;
} }
@Override @Override

View File

@@ -13,7 +13,7 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import storagecraft.storage.CellStorage; import storagecraft.storage.CellStorage;
public class ItemStorageCell extends ItemSC { public class ItemStorageCell extends ItemBase {
private IIcon[] icons = new IIcon[5]; private IIcon[] icons = new IIcon[5];
public ItemStorageCell() { public ItemStorageCell() {

View File

@@ -4,7 +4,7 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import storagecraft.SCBlocks; import storagecraft.StorageCraftBlocks;
import storagecraft.render.BlockCableRenderer; import storagecraft.render.BlockCableRenderer;
import storagecraft.render.ItemCableRenderer; import storagecraft.render.ItemCableRenderer;
import storagecraft.tile.TileCable; import storagecraft.tile.TileCable;
@@ -16,6 +16,6 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileCable.class, new BlockCableRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileCable.class, new BlockCableRenderer());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(SCBlocks.CABLE), new ItemCableRenderer()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(StorageCraftBlocks.CABLE), new ItemCableRenderer());
} }
} }

View File

@@ -6,9 +6,9 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.SCBlocks; import storagecraft.StorageCraftBlocks;
import storagecraft.SCItems; import storagecraft.StorageCraftItems;
import storagecraft.gui.GuiHandler; import storagecraft.gui.GuiHandler;
import storagecraft.network.MessageImporterUpdate; import storagecraft.network.MessageImporterUpdate;
import storagecraft.network.MessageStoragePull; import storagecraft.network.MessageStoragePull;
@@ -23,12 +23,12 @@ import storagecraft.tile.TileStorageProxy;
public class CommonProxy { public class CommonProxy {
public void preInit(FMLPreInitializationEvent e) { public void preInit(FMLPreInitializationEvent e) {
SC.NETWORK.registerMessage(MessageTileUpdate.class, MessageTileUpdate.class, 0, Side.CLIENT); StorageCraft.NETWORK.registerMessage(MessageTileUpdate.class, MessageTileUpdate.class, 0, Side.CLIENT);
SC.NETWORK.registerMessage(MessageStoragePush.class, MessageStoragePush.class, 1, Side.SERVER); StorageCraft.NETWORK.registerMessage(MessageStoragePush.class, MessageStoragePush.class, 1, Side.SERVER);
SC.NETWORK.registerMessage(MessageStoragePull.class, MessageStoragePull.class, 2, Side.SERVER); StorageCraft.NETWORK.registerMessage(MessageStoragePull.class, MessageStoragePull.class, 2, Side.SERVER);
SC.NETWORK.registerMessage(MessageImporterUpdate.class, MessageImporterUpdate.class, 3, Side.SERVER); StorageCraft.NETWORK.registerMessage(MessageImporterUpdate.class, MessageImporterUpdate.class, 3, Side.SERVER);
NetworkRegistry.INSTANCE.registerGuiHandler(SC.INSTANCE, new GuiHandler()); NetworkRegistry.INSTANCE.registerGuiHandler(StorageCraft.INSTANCE, new GuiHandler());
GameRegistry.registerTileEntity(TileController.class, "controller"); GameRegistry.registerTileEntity(TileController.class, "controller");
GameRegistry.registerTileEntity(TileCable.class, "cable"); GameRegistry.registerTileEntity(TileCable.class, "cable");
@@ -37,14 +37,14 @@ public class CommonProxy {
GameRegistry.registerTileEntity(TileStorageProxy.class, "storageProxy"); GameRegistry.registerTileEntity(TileStorageProxy.class, "storageProxy");
GameRegistry.registerTileEntity(TileImporter.class, "importer"); GameRegistry.registerTileEntity(TileImporter.class, "importer");
GameRegistry.registerBlock(SCBlocks.CONTROLLER, "controller"); GameRegistry.registerBlock(StorageCraftBlocks.CONTROLLER, "controller");
GameRegistry.registerBlock(SCBlocks.CABLE, "cable"); GameRegistry.registerBlock(StorageCraftBlocks.CABLE, "cable");
GameRegistry.registerBlock(SCBlocks.GRID, "grid"); GameRegistry.registerBlock(StorageCraftBlocks.GRID, "grid");
GameRegistry.registerBlock(SCBlocks.DRIVE, "drive"); GameRegistry.registerBlock(StorageCraftBlocks.DRIVE, "drive");
GameRegistry.registerBlock(SCBlocks.STORAGE_PROXY, "storageProxy"); GameRegistry.registerBlock(StorageCraftBlocks.STORAGE_PROXY, "storageProxy");
GameRegistry.registerBlock(SCBlocks.IMPORTER, "importer"); GameRegistry.registerBlock(StorageCraftBlocks.IMPORTER, "importer");
GameRegistry.registerItem(SCItems.STORAGE_CELL, "storageCell"); GameRegistry.registerItem(StorageCraftItems.STORAGE_CELL, "storageCell");
} }
public void init(FMLInitializationEvent e) { public void init(FMLInitializationEvent e) {

View File

@@ -7,10 +7,10 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import storagecraft.SC; import storagecraft.StorageCraft;
import storagecraft.network.MessageTileUpdate; import storagecraft.network.MessageTileUpdate;
public class TileSC extends TileEntity { public class TileBase extends TileEntity {
public static final int UPDATE_RANGE = 64; public static final int UPDATE_RANGE = 64;
private ForgeDirection direction; private ForgeDirection direction;
@@ -27,7 +27,7 @@ public class TileSC extends TileEntity {
if (this instanceof INetworkTile) { if (this instanceof INetworkTile) {
TargetPoint target = new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, UPDATE_RANGE); TargetPoint target = new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, UPDATE_RANGE);
SC.NETWORK.sendToAllAround(new MessageTileUpdate(this), target); StorageCraft.NETWORK.sendToAllAround(new MessageTileUpdate(this), target);
} }
} }
} }

View File

@@ -8,7 +8,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import storagecraft.block.BlockCable; import storagecraft.block.BlockCable;
public class TileCable extends TileSC { public class TileCable extends TileBase {
public static boolean isCable(World world, int x, int y, int z, ForgeDirection dir) { public static boolean isCable(World world, int x, int y, int z, ForgeDirection dir) {
Block block = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); Block block = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);

View File

@@ -16,7 +16,7 @@ import storagecraft.storage.IStorage;
import storagecraft.storage.IStorageProvider; import storagecraft.storage.IStorageProvider;
import storagecraft.storage.StorageItem; import storagecraft.storage.StorageItem;
public class TileController extends TileSC implements IEnergyReceiver, INetworkTile { public class TileController extends TileBase implements IEnergyReceiver, INetworkTile {
private List<StorageItem> items = new ArrayList<StorageItem>(); private List<StorageItem> items = new ArrayList<StorageItem>();
private List<IStorage> storages = new ArrayList<IStorage>(); private List<IStorage> storages = new ArrayList<IStorage>();

View File

@@ -5,14 +5,14 @@ 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;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import storagecraft.inventory.InventorySC; import storagecraft.inventory.InventorySimple;
import storagecraft.storage.CellStorage; import storagecraft.storage.CellStorage;
import storagecraft.storage.IStorage; import storagecraft.storage.IStorage;
import storagecraft.storage.IStorageProvider; import storagecraft.storage.IStorageProvider;
import storagecraft.util.InventoryUtils; import storagecraft.util.InventoryUtils;
public class TileDrive extends TileMachine implements IInventory, IStorageProvider { public class TileDrive extends TileMachine implements IInventory, IStorageProvider {
private InventorySC inventory = new InventorySC("drive", 8); private InventorySimple inventory = new InventorySimple("drive", 8);
@Override @Override
public int getEnergyUsage() { public int getEnergyUsage() {

View File

@@ -6,11 +6,11 @@ import net.minecraft.inventory.IInventory;
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;
import storagecraft.inventory.InventorySC; import storagecraft.inventory.InventorySimple;
import storagecraft.util.InventoryUtils; import storagecraft.util.InventoryUtils;
public class TileImporter extends TileMachine implements IInventory { public class TileImporter extends TileMachine implements IInventory {
private InventorySC inventory = new InventorySC("importer", 9); private InventorySimple inventory = new InventorySimple("importer", 9);
private int compareFlags = InventoryUtils.COMPARE_NBT | InventoryUtils.COMPARE_DAMAGE; private int compareFlags = InventoryUtils.COMPARE_NBT | InventoryUtils.COMPARE_DAMAGE;

View File

@@ -2,7 +2,7 @@ package storagecraft.tile;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
public abstract class TileMachine extends TileSC implements INetworkTile { public abstract class TileMachine extends TileBase implements INetworkTile {
protected boolean connected = false; protected boolean connected = false;
private int xController; private int xController;