Upgrade Forge. JEI crashes with it, so this build is unusable.

This commit is contained in:
Raoul Van den Berge
2016-04-02 22:44:28 +02:00
parent f6812ee809
commit b087d86f9a
12 changed files with 77 additions and 33 deletions

View File

@@ -17,7 +17,7 @@ group = "refinedstorage"
archivesBaseName = "refinedstorage"
minecraft {
version = "1.9-12.16.0.1811-1.9"
version = "1.9-12.16.0.1826-1.9"
runDir = "run"
useDepAts = true
mappings = "snapshot_20160312"

View File

@@ -8,6 +8,7 @@ import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
@@ -30,6 +31,7 @@ public abstract class BlockBase extends Block {
this.name = name;
setHardness(0.6F);
setRegistryName(RefinedStorage.ID, name);
setCreativeTab(RefinedStorage.TAB);
}
@@ -123,4 +125,11 @@ public abstract class BlockBase extends Block {
super.breakBlock(world, pos, state);
}
public ItemBlock createItemForBlock() {
ItemBlock itemBlock = new ItemBlock(this);
itemBlock.setRegistryName(getRegistryName());
return itemBlock;
}
}

View File

@@ -8,6 +8,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
@@ -17,6 +18,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageGui;
import refinedstorage.item.ItemBlockController;
import refinedstorage.tile.TileController;
import java.util.List;
@@ -96,4 +98,9 @@ public class BlockController extends BlockBase {
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
return ((TileController) world.getTileEntity(pos)).getEnergyScaled(15);
}
@Override
public ItemBlock createItemForBlock() {
return new ItemBlockController();
}
}

View File

@@ -7,6 +7,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
@@ -15,6 +16,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageGui;
import refinedstorage.item.ItemBlockGrid;
import refinedstorage.tile.grid.TileGrid;
import java.util.List;
@@ -65,4 +67,9 @@ public class BlockGrid extends BlockMachine {
return true;
}
@Override
public ItemBlock createItemForBlock() {
return new ItemBlockGrid();
}
}

View File

@@ -8,6 +8,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@@ -113,4 +114,9 @@ public class BlockStorage extends BlockMachine {
world.setBlockToAir(pos);
}
@Override
public ItemBlock createItemForBlock() {
return new ItemBlockStorage();
}
}

View File

@@ -10,6 +10,7 @@ public abstract class ItemBase extends Item {
public ItemBase(String name) {
this.name = name;
setRegistryName(RefinedStorage.ID, name);
setCreativeTab(RefinedStorage.TAB);
}

View File

@@ -7,6 +7,8 @@ import net.minecraft.item.ItemStack;
public abstract class ItemBlockBase extends ItemColored {
public ItemBlockBase(Block block) {
super(block, true);
setRegistryName(block.getRegistryName());
}
@Override

View File

@@ -1,9 +1,9 @@
package refinedstorage.item;
import net.minecraft.block.Block;
import refinedstorage.RefinedStorageBlocks;
public class ItemBlockController extends ItemBlockBase {
public ItemBlockController(Block block) {
super(block);
public ItemBlockController() {
super(RefinedStorageBlocks.CONTROLLER);
}
}

View File

@@ -1,9 +1,9 @@
package refinedstorage.item;
import net.minecraft.block.Block;
import refinedstorage.RefinedStorageBlocks;
public class ItemBlockGrid extends ItemBlockBase {
public ItemBlockGrid(Block block) {
super(block);
public ItemBlockGrid() {
super(RefinedStorageBlocks.GRID);
}
}

View File

@@ -1,11 +1,11 @@
package refinedstorage.item;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.block.EnumStorageType;
import refinedstorage.storage.NBTStorage;
import refinedstorage.tile.TileStorage;
@@ -13,8 +13,8 @@ import refinedstorage.tile.TileStorage;
import java.util.List;
public class ItemBlockStorage extends ItemBlockBase {
public ItemBlockStorage(Block block) {
super(block);
public ItemBlockStorage() {
super(RefinedStorageBlocks.STORAGE);
}
@Override

View File

@@ -45,6 +45,7 @@ public class ItemWirelessGrid extends ItemEnergyContainer {
}
});
setRegistryName(RefinedStorage.ID, "wireless_grid");
setMaxDamage(3200);
setMaxStackSize(1);
setHasSubtypes(false);

View File

@@ -1,7 +1,9 @@
package refinedstorage.proxy;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
@@ -12,11 +14,15 @@ import net.minecraftforge.fml.relauncher.Side;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.RefinedStorageItems;
import refinedstorage.block.BlockBase;
import refinedstorage.block.EnumControllerType;
import refinedstorage.block.EnumGridType;
import refinedstorage.block.EnumStorageType;
import refinedstorage.gui.GuiHandler;
import refinedstorage.item.*;
import refinedstorage.item.ItemCore;
import refinedstorage.item.ItemProcessor;
import refinedstorage.item.ItemStorageDisk;
import refinedstorage.item.ItemStoragePart;
import refinedstorage.network.*;
import refinedstorage.storage.NBTStorage;
import refinedstorage.tile.*;
@@ -58,29 +64,29 @@ public class CommonProxy {
GameRegistry.registerTileEntity(TileRelay.class, ID + ":relay");
GameRegistry.registerTileEntity(TileInterface.class, ID + ":interface");
GameRegistry.registerBlock(RefinedStorageBlocks.CONTROLLER, ItemBlockController.class, ID + ":controller");
GameRegistry.registerBlock(RefinedStorageBlocks.CABLE, ID + ":cable");
GameRegistry.registerBlock(RefinedStorageBlocks.GRID, ItemBlockGrid.class, ID + ":grid");
GameRegistry.registerBlock(RefinedStorageBlocks.DISK_DRIVE, ID + ":disk_drive");
GameRegistry.registerBlock(RefinedStorageBlocks.EXTERNAL_STORAGE, ID + ":external_storage");
GameRegistry.registerBlock(RefinedStorageBlocks.IMPORTER, ID + ":importer");
GameRegistry.registerBlock(RefinedStorageBlocks.EXPORTER, ID + ":exporter");
GameRegistry.registerBlock(RefinedStorageBlocks.DETECTOR, ID + ":detector");
GameRegistry.registerBlock(RefinedStorageBlocks.MACHINE_CASING, ID + ":machine_casing");
GameRegistry.registerBlock(RefinedStorageBlocks.SOLDERER, ID + ":solderer");
GameRegistry.registerBlock(RefinedStorageBlocks.DESTRUCTOR, ID + ":destructor");
GameRegistry.registerBlock(RefinedStorageBlocks.CONSTRUCTOR, ID + ":constructor");
GameRegistry.registerBlock(RefinedStorageBlocks.STORAGE, ItemBlockStorage.class, ID + ":storage");
GameRegistry.registerBlock(RefinedStorageBlocks.RELAY, ID + ":relay");
GameRegistry.registerBlock(RefinedStorageBlocks.INTERFACE, ID + ":interface");
registerBlock(RefinedStorageBlocks.CONTROLLER);
registerBlock(RefinedStorageBlocks.CABLE);
registerBlock(RefinedStorageBlocks.GRID);
registerBlock(RefinedStorageBlocks.DISK_DRIVE);
registerBlock(RefinedStorageBlocks.EXTERNAL_STORAGE);
registerBlock(RefinedStorageBlocks.IMPORTER);
registerBlock(RefinedStorageBlocks.EXPORTER);
registerBlock(RefinedStorageBlocks.DETECTOR);
registerBlock(RefinedStorageBlocks.MACHINE_CASING);
registerBlock(RefinedStorageBlocks.SOLDERER);
registerBlock(RefinedStorageBlocks.DESTRUCTOR);
registerBlock(RefinedStorageBlocks.CONSTRUCTOR);
registerBlock(RefinedStorageBlocks.STORAGE);
registerBlock(RefinedStorageBlocks.RELAY);
registerBlock(RefinedStorageBlocks.INTERFACE);
GameRegistry.registerItem(RefinedStorageItems.STORAGE_DISK, ID + ":storage_disk");
GameRegistry.registerItem(RefinedStorageItems.WIRELESS_GRID, ID + ":wireless_grid");
GameRegistry.registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON, ID + ":quartz_enriched_iron");
GameRegistry.registerItem(RefinedStorageItems.CORE, ID + ":core");
GameRegistry.registerItem(RefinedStorageItems.SILICON, ID + ":silicon");
GameRegistry.registerItem(RefinedStorageItems.PROCESSOR, ID + ":processor");
GameRegistry.registerItem(RefinedStorageItems.STORAGE_PART, ID + ":storage_part");
GameRegistry.<Item>register(RefinedStorageItems.STORAGE_DISK);
GameRegistry.<Item>register(RefinedStorageItems.WIRELESS_GRID);
GameRegistry.<Item>register(RefinedStorageItems.QUARTZ_ENRICHED_IRON);
GameRegistry.<Item>register(RefinedStorageItems.CORE);
GameRegistry.<Item>register(RefinedStorageItems.SILICON);
GameRegistry.<Item>register(RefinedStorageItems.PROCESSOR);
GameRegistry.<Item>register(RefinedStorageItems.STORAGE_PART);
// Processors
SoldererRegistry.addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_BASIC));
@@ -350,4 +356,9 @@ public class CommonProxy {
public void postInit(FMLPostInitializationEvent e) {
}
private void registerBlock(BlockBase block) {
GameRegistry.<Block>register(block);
GameRegistry.<Item>register(block.createItemForBlock());
}
}