Skip to content

Commit

Permalink
Switch to IntelliJ
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Mar 24, 2016
1 parent e7f588e commit f419dcd
Show file tree
Hide file tree
Showing 275 changed files with 7,803 additions and 9,396 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE.md
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified build.gradle
100644 → 100755
Empty file.
Empty file modified gradlew
100644 → 100755
Empty file.
Empty file modified gradlew.bat
100644 → 100755
Empty file.
Empty file modified logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified screenshots/crafting_grid.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified screenshots/interface.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified screenshots/overview.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified screenshots/relays.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified screenshots/storage_block.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/java/cofh/api/CoFHAPIProps.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/EnergyStorage.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/IEnergyConnection.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/IEnergyContainerItem.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/IEnergyHandler.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/IEnergyProvider.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/IEnergyReceiver.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/IEnergyStorage.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/ItemEnergyContainer.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/TileEnergyHandler.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/energy/package-info.java
100644 → 100755
Empty file.
Empty file modified src/main/java/cofh/api/package-info.java
100644 → 100755
Empty file.
83 changes: 38 additions & 45 deletions src/main/java/refinedstorage/RefinedStorage.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,42 @@
import refinedstorage.proxy.CommonProxy;

@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION)
public final class RefinedStorage
{
public static final String ID = "refinedstorage";
public static final String VERSION = "0.5";

public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(ID);

public static final CreativeTabs TAB = new CreativeTabs(ID)
{
@Override
public ItemStack getIconItemStack()
{
return new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_1K);
}

@Override
public Item getTabIconItem()
{
return null;
}
};

@SidedProxy(clientSide = "refinedstorage.proxy.ClientProxy", serverSide = "refinedstorage.proxy.ServerProxy")
public static CommonProxy PROXY;

@Instance
public static RefinedStorage INSTANCE;

@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
PROXY.preInit(e);
}

@EventHandler
public void init(FMLInitializationEvent e)
{
PROXY.init(e);
}

@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
PROXY.postInit(e);
}
public final class RefinedStorage {
public static final String ID = "refinedstorage";
public static final String VERSION = "0.5";

public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(ID);

public static final CreativeTabs TAB = new CreativeTabs(ID) {
@Override
public ItemStack getIconItemStack() {
return new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_1K);
}

@Override
public Item getTabIconItem() {
return null;
}
};

@SidedProxy(clientSide = "refinedstorage.proxy.ClientProxy", serverSide = "refinedstorage.proxy.ServerProxy")
public static CommonProxy PROXY;

@Instance
public static RefinedStorage INSTANCE;

@EventHandler
public void preInit(FMLPreInitializationEvent e) {
PROXY.preInit(e);
}

@EventHandler
public void init(FMLInitializationEvent e) {
PROXY.init(e);
}

@EventHandler
public void postInit(FMLPostInitializationEvent e) {
PROXY.postInit(e);
}
}
35 changes: 17 additions & 18 deletions src/main/java/refinedstorage/RefinedStorageBlocks.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

import refinedstorage.block.*;

public final class RefinedStorageBlocks
{
public static final BlockController CONTROLLER = new BlockController();
public static final BlockCable CABLE = new BlockCable();
public static final BlockGrid GRID = new BlockGrid();
public static final BlockDrive DRIVE = new BlockDrive();
public static final BlockExternalStorage EXTERNAL_STORAGE = new BlockExternalStorage();
public static final BlockImporter IMPORTER = new BlockImporter();
public static final BlockExporter EXPORTER = new BlockExporter();
public static final BlockDetector DETECTOR = new BlockDetector();
public static final BlockMachineCasing MACHINE_CASING = new BlockMachineCasing();
public static final BlockSolderer SOLDERER = new BlockSolderer();
public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter();
public static final BlockDestructor DESTRUCTOR = new BlockDestructor();
public static final BlockConstructor CONSTRUCTOR = new BlockConstructor();
public static final BlockStorage STORAGE = new BlockStorage();
public static final BlockRelay RELAY = new BlockRelay();
public static final BlockInterface INTERFACE = new BlockInterface();
public final class RefinedStorageBlocks {
public static final BlockController CONTROLLER = new BlockController();
public static final BlockCable CABLE = new BlockCable();
public static final BlockGrid GRID = new BlockGrid();
public static final BlockDrive DRIVE = new BlockDrive();
public static final BlockExternalStorage EXTERNAL_STORAGE = new BlockExternalStorage();
public static final BlockImporter IMPORTER = new BlockImporter();
public static final BlockExporter EXPORTER = new BlockExporter();
public static final BlockDetector DETECTOR = new BlockDetector();
public static final BlockMachineCasing MACHINE_CASING = new BlockMachineCasing();
public static final BlockSolderer SOLDERER = new BlockSolderer();
public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter();
public static final BlockDestructor DESTRUCTOR = new BlockDestructor();
public static final BlockConstructor CONSTRUCTOR = new BlockConstructor();
public static final BlockStorage STORAGE = new BlockStorage();
public static final BlockRelay RELAY = new BlockRelay();
public static final BlockInterface INTERFACE = new BlockInterface();
}
29 changes: 14 additions & 15 deletions src/main/java/refinedstorage/RefinedStorageGui.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package refinedstorage;

public final class RefinedStorageGui
{
public static final int CONTROLLER = 0;
public static final int GRID = 1;
public static final int DRIVE = 2;
public static final int IMPORTER = 4;
public static final int EXPORTER = 5;
public static final int DETECTOR = 6;
public static final int SOLDERER = 7;
public static final int WIRELESS_TRANSMITTER = 8;
public static final int DESTRUCTOR = 9;
public static final int CONSTRUCTOR = 10;
public static final int STORAGE = 11;
public static final int RELAY = 12;
public static final int INTERFACE = 13;
public final class RefinedStorageGui {
public static final int CONTROLLER = 0;
public static final int GRID = 1;
public static final int DRIVE = 2;
public static final int IMPORTER = 4;
public static final int EXPORTER = 5;
public static final int DETECTOR = 6;
public static final int SOLDERER = 7;
public static final int WIRELESS_TRANSMITTER = 8;
public static final int DESTRUCTOR = 9;
public static final int CONSTRUCTOR = 10;
public static final int STORAGE = 11;
public static final int RELAY = 12;
public static final int INTERFACE = 13;
}
19 changes: 9 additions & 10 deletions src/main/java/refinedstorage/RefinedStorageItems.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import refinedstorage.item.*;

public final class RefinedStorageItems
{
public static final ItemStorageCell STORAGE_CELL = new ItemStorageCell();
public static final ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid();
public static final ItemWirelessGridPlate WIRELESS_GRID_PLATE = new ItemWirelessGridPlate();
public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron();
public static final ItemCore CORE = new ItemCore();
public static final ItemSilicon SILICON = new ItemSilicon();
public static final ItemProcessor PROCESSOR = new ItemProcessor();
public static final ItemStoragePart STORAGE_PART = new ItemStoragePart();
public final class RefinedStorageItems {
public static final ItemStorageCell STORAGE_CELL = new ItemStorageCell();
public static final ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid();
public static final ItemWirelessGridPlate WIRELESS_GRID_PLATE = new ItemWirelessGridPlate();
public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron();
public static final ItemCore CORE = new ItemCore();
public static final ItemSilicon SILICON = new ItemSilicon();
public static final ItemProcessor PROCESSOR = new ItemProcessor();
public static final ItemStoragePart STORAGE_PART = new ItemStoragePart();
}
210 changes: 97 additions & 113 deletions src/main/java/refinedstorage/block/BlockBase.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,117 +18,101 @@
import refinedstorage.tile.TileBase;
import refinedstorage.util.InventoryUtils;

public abstract class BlockBase extends Block
{
public static final PropertyDirection DIRECTION = PropertyDirection.create("direction");

private String name;

public BlockBase(String name)
{
super(Material.rock);

this.name = name;

setHardness(0.6F);
setCreativeTab(RefinedStorage.TAB);
}

@Override
public String getUnlocalizedName()
{
return "block." + RefinedStorage.ID + ":" + name;
}

@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[]
{
DIRECTION,
});
}

@Override
public IBlockState getStateFromMeta(int meta)
{
return getDefaultState();
}

@Override
public int getMetaFromState(IBlockState state)
{
return 0;
}

@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase)
{
return state.withProperty(DIRECTION, ((TileBase) tile).getDirection());
}

return state;
}

@Override
public int damageDropped(IBlockState state)
{
return getMetaFromState(state);
}

@Override
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
{
TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase)
{
EnumFacing dir = ((TileBase) tile).getDirection();

int newDir = dir.ordinal() + 1;

if (newDir > EnumFacing.VALUES.length - 1)
{
newDir = 0;
}

((TileBase) tile).setDirection(EnumFacing.getFront(newDir));

world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 2 | 4);

return true;
}

return false;
}

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemStack)
{
super.onBlockPlacedBy(world, pos, state, player, itemStack);

TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase)
{
((TileBase) tile).setDirection(BlockPistonBase.getFacingFromEntity(pos, player));
}
}

@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase && ((TileBase) tile).getDroppedInventory() != null)
{
InventoryUtils.dropInventory(world, ((TileBase) tile).getDroppedInventory(), pos.getX(), pos.getY(), pos.getZ());
}

super.breakBlock(world, pos, state);
}
public abstract class BlockBase extends Block {
public static final PropertyDirection DIRECTION = PropertyDirection.create("direction");

private String name;

public BlockBase(String name) {
super(Material.rock);

this.name = name;

setHardness(0.6F);
setCreativeTab(RefinedStorage.TAB);
}

@Override
public String getUnlocalizedName() {
return "block." + RefinedStorage.ID + ":" + name;
}

@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[]
{
DIRECTION,
});
}

@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState();
}

@Override
public int getMetaFromState(IBlockState state) {
return 0;
}

@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase) {
return state.withProperty(DIRECTION, ((TileBase) tile).getDirection());
}

return state;
}

@Override
public int damageDropped(IBlockState state) {
return getMetaFromState(state);
}

@Override
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase) {
EnumFacing dir = ((TileBase) tile).getDirection();

int newDir = dir.ordinal() + 1;

if (newDir > EnumFacing.VALUES.length - 1) {
newDir = 0;
}

((TileBase) tile).setDirection(EnumFacing.getFront(newDir));

world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 2 | 4);

return true;
}

return false;
}

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemStack) {
super.onBlockPlacedBy(world, pos, state, player, itemStack);

TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase) {
((TileBase) tile).setDirection(BlockPistonBase.getFacingFromEntity(pos, player));
}
}

@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
TileEntity tile = world.getTileEntity(pos);

if (tile instanceof TileBase && ((TileBase) tile).getDroppedInventory() != null) {
InventoryUtils.dropInventory(world, ((TileBase) tile).getDroppedInventory(), pos.getX(), pos.getY(), pos.getZ());
}

super.breakBlock(world, pos, state);
}
}
Loading

0 comments on commit f419dcd

Please sign in to comment.