FixedIssuesWithRegistry

This commit is contained in:
DarkGuardsman 2013-09-20 12:01:56 -04:00
parent cfebdfe9de
commit 1bc1169375
7 changed files with 19 additions and 44 deletions

View file

@ -34,7 +34,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
@Override @Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{ {
if (block.blockID == AssemblyLine.recipeLoader.blockConveyorBelt.blockID) if (AssemblyLine.recipeLoader.blockConveyorBelt != null && block.blockID == AssemblyLine.recipeLoader.blockConveyorBelt.blockID)
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 1.5F, 0.0F); GL11.glTranslatef(0.0F, 1.5F, 0.0F);
@ -43,7 +43,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
modelConveyorBelt.render(0.0625F, 0, false, false, false, false); modelConveyorBelt.render(0.0625F, 0, false, false, false, false);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.recipeLoader.blockRejector.blockID) else if (AssemblyLine.recipeLoader.blockRejector != null && block.blockID == AssemblyLine.recipeLoader.blockRejector.blockID)
{ {
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "rejector.png")); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "rejector.png"));
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -54,7 +54,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
modelEjector.renderPiston(0.0625F, 1); modelEjector.renderPiston(0.0625F, 1);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.recipeLoader.blockManipulator.blockID) else if (AssemblyLine.recipeLoader.blockManipulator != null && block.blockID == AssemblyLine.recipeLoader.blockManipulator.blockID)
{ {
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "manipulator1.png")); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "manipulator1.png"));
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -64,7 +64,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
modelInjector.render(0.0625F, true, 0); modelInjector.render(0.0625F, true, 0);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.recipeLoader.blockArmbot.blockID) else if (AssemblyLine.recipeLoader.blockArmbot != null && block.blockID == AssemblyLine.recipeLoader.blockArmbot.blockID)
{ {
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + RenderArmbot.TEXTURE)); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + RenderArmbot.TEXTURE));
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -75,7 +75,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
RenderArmbot.MODEL.render(0.0625F, 0, 0); RenderArmbot.MODEL.render(0.0625F, 0, 0);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.processorMachine.blockID && metadata == 0) else if (AssemblyLine.processorMachine != null && block.blockID == AssemblyLine.processorMachine.blockID && metadata == 0)
{ {
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "CrusherBlock.png")); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "CrusherBlock.png"));
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -86,7 +86,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
this.modelCrushor.renderPiston(0.0625f, 4); this.modelCrushor.renderPiston(0.0625f, 4);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.processorMachine.blockID && metadata == 4) else if (AssemblyLine.processorMachine != null && block.blockID == AssemblyLine.processorMachine.blockID && metadata == 4)
{ {
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "GrinderBlock.png")); FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "GrinderBlock.png"));
GL11.glPushMatrix(); GL11.glPushMatrix();

View file

@ -46,6 +46,7 @@ import dark.assembly.common.machine.encoder.BlockEncoder;
import dark.assembly.common.machine.encoder.ItemDisk; import dark.assembly.common.machine.encoder.ItemDisk;
import dark.assembly.common.machine.encoder.TileEntityEncoder; import dark.assembly.common.machine.encoder.TileEntityEncoder;
import dark.assembly.common.machine.processor.BlockProcessor; import dark.assembly.common.machine.processor.BlockProcessor;
import dark.core.common.DMCreativeTab;
import dark.core.common.DarkMain; import dark.core.common.DarkMain;
import dark.core.prefab.ModPrefab; import dark.core.prefab.ModPrefab;
import dark.core.prefab.items.ItemBlockHolder; import dark.core.prefab.items.ItemBlockHolder;
@ -111,8 +112,6 @@ public class AssemblyLine extends ModPrefab
GameRegistry.registerBlock(recipeLoader.blockRejector, "Rejector"); GameRegistry.registerBlock(recipeLoader.blockRejector, "Rejector");
GameRegistry.registerBlock(recipeLoader.blockArmbot, "Armbot"); GameRegistry.registerBlock(recipeLoader.blockArmbot, "Armbot");
GameRegistry.registerBlock(recipeLoader.blockTurntable, "Turntable"); GameRegistry.registerBlock(recipeLoader.blockTurntable, "Turntable");
GameRegistry.registerBlock(recipeLoader.blockCraneController, "CraneController");
GameRegistry.registerBlock(recipeLoader.blockCraneFrame, "Crane Frame");
GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "ALConveyorBelt"); GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "ALConveyorBelt");
GameRegistry.registerTileEntity(TileEntityRejector.class, "ALSorter"); GameRegistry.registerTileEntity(TileEntityRejector.class, "ALSorter");
@ -123,7 +122,7 @@ public class AssemblyLine extends ModPrefab
GameRegistry.registerTileEntity(TileEntityArmbot.class, "ALArmbot"); GameRegistry.registerTileEntity(TileEntityArmbot.class, "ALArmbot");
GameRegistry.registerTileEntity(TileEntityImprinter.class, "ALImprinter"); GameRegistry.registerTileEntity(TileEntityImprinter.class, "ALImprinter");
TabAssemblyLine.itemStack = new ItemStack(recipeLoader.blockConveyorBelt); DMCreativeTab.tabAutomation.setIconItemStack(new ItemStack(recipeLoader.blockConveyorBelt));
proxy.preInit(); proxy.preInit();
} }
@ -148,7 +147,7 @@ public class AssemblyLine extends ModPrefab
recipeLoader = new ALRecipeLoader(); recipeLoader = new ALRecipeLoader();
} }
CONFIGURATION.load(); CONFIGURATION.load();
recipeLoader.blockConveyorBelt = ModObjectRegistry.createNewBlock(AssemblyLine.MOD_ID, BlockConveyorBelt.class); recipeLoader.blockConveyorBelt = ModObjectRegistry.createNewBlock("ALBlockConveyor", AssemblyLine.MOD_ID, BlockConveyorBelt.class);
recipeLoader.blockManipulator = new BlockManipulator(); recipeLoader.blockManipulator = new BlockManipulator();
recipeLoader.blockCrate = new BlockCrate(); recipeLoader.blockCrate = new BlockCrate();
recipeLoader.blockImprinter = new BlockImprinter(); recipeLoader.blockImprinter = new BlockImprinter();
@ -157,7 +156,7 @@ public class AssemblyLine extends ModPrefab
recipeLoader.blockEncoder = new BlockEncoder(); recipeLoader.blockEncoder = new BlockEncoder();
recipeLoader.blockArmbot = new BlockArmbot(); recipeLoader.blockArmbot = new BlockArmbot();
recipeLoader.blockTurntable = new BlockTurntable(); recipeLoader.blockTurntable = new BlockTurntable();
AssemblyLine.processorMachine = ModObjectRegistry.createNewBlock(AssemblyLine.MOD_ID, BlockProcessor.class, ItemBlockHolder.class); AssemblyLine.processorMachine = ModObjectRegistry.createNewBlock("ALBlockProcessor", AssemblyLine.MOD_ID, BlockProcessor.class, ItemBlockHolder.class);
recipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); recipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt());
recipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); recipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt());

View file

@ -1,21 +0,0 @@
package dark.assembly.common;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class TabAssemblyLine extends CreativeTabs
{
public static final TabAssemblyLine INSTANCE = new TabAssemblyLine("assemblyline");
public static ItemStack itemStack;
public TabAssemblyLine(String par2Str)
{
super(CreativeTabs.getNextID(), par2Str);
}
@Override
public ItemStack getIconItemStack()
{
return itemStack;
}
}

View file

@ -16,7 +16,7 @@ import net.minecraft.nbt.NBTTagList;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import dark.assembly.common.AssemblyLine; import dark.assembly.common.AssemblyLine;
import dark.assembly.common.TabAssemblyLine; import dark.core.common.DMCreativeTab;
public class ItemImprinter extends Item public class ItemImprinter extends Item
{ {
@ -24,7 +24,7 @@ public class ItemImprinter extends Item
{ {
super(id); super(id);
this.setUnlocalizedName("imprint"); this.setUnlocalizedName("imprint");
this.setCreativeTab(TabAssemblyLine.INSTANCE); this.setCreativeTab(DMCreativeTab.tabAutomation);
this.setHasSubtypes(true); this.setHasSubtypes(true);
this.maxStackSize = 1; this.maxStackSize = 1;
} }

View file

@ -5,7 +5,8 @@ import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
import dark.assembly.common.TabAssemblyLine; import dark.assembly.common.AssemblyLine;
import dark.core.common.DMCreativeTab;
import dark.core.prefab.machine.BlockMachine; import dark.core.prefab.machine.BlockMachine;
import dark.core.registration.ModObjectRegistry.BlockBuildData; import dark.core.registration.ModObjectRegistry.BlockBuildData;
@ -15,7 +16,7 @@ public abstract class BlockAssembly extends BlockMachine
public BlockAssembly(BlockBuildData buildBuildData) public BlockAssembly(BlockBuildData buildBuildData)
{ {
super(buildBuildData.setCreativeTab(TabAssemblyLine.INSTANCE)); super(buildBuildData.setCreativeTab(DMCreativeTab.tabAutomation).setConfigProvider(AssemblyLine.CONFIGURATION));
} }
@Override @Override

View file

@ -12,7 +12,7 @@ import net.minecraft.nbt.NBTTagList;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import dark.assembly.common.AssemblyLine; import dark.assembly.common.AssemblyLine;
import dark.assembly.common.TabAssemblyLine; import dark.core.common.DMCreativeTab;
public class ItemDisk extends Item public class ItemDisk extends Item
{ {
@ -20,7 +20,7 @@ public class ItemDisk extends Item
{ {
super(id); super(id);
this.setUnlocalizedName("disk"); this.setUnlocalizedName("disk");
this.setCreativeTab(TabAssemblyLine.INSTANCE); this.setCreativeTab(DMCreativeTab.tabAutomation);
this.setHasSubtypes(true); this.setHasSubtypes(true);
} }

View file

@ -19,8 +19,7 @@ import dark.api.ProcessorRecipes.ProcessorType;
import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.client.render.BlockRenderingHandler;
import dark.assembly.common.AssemblyLine; import dark.assembly.common.AssemblyLine;
import dark.assembly.common.CommonProxy; import dark.assembly.common.CommonProxy;
import dark.assembly.common.TabAssemblyLine; import dark.core.common.DMCreativeTab;
import dark.core.common.DarkMain;
import dark.core.prefab.IExtraObjectInfo; import dark.core.prefab.IExtraObjectInfo;
import dark.core.prefab.helpers.Pair; import dark.core.prefab.helpers.Pair;
import dark.core.prefab.machine.BlockMachine; import dark.core.prefab.machine.BlockMachine;
@ -28,14 +27,11 @@ import dark.core.registration.ModObjectRegistry.BlockBuildData;
public class BlockProcessor extends BlockMachine implements IExtraObjectInfo public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
{ {
public static float crusherWattPerTick = .125f;
public static float grinderWattPerTick = .125f;
public static float pressWattPerTick = .2f;
public BlockProcessor() public BlockProcessor()
{ {
super(new BlockBuildData(BlockProcessor.class, "OreProcessor", UniversalElectricity.machine).setConfigProvider(AssemblyLine.CONFIGURATION)); super(new BlockBuildData(BlockProcessor.class, "OreProcessor", UniversalElectricity.machine).setConfigProvider(AssemblyLine.CONFIGURATION));
this.setCreativeTab(TabAssemblyLine.INSTANCE); this.setCreativeTab(DMCreativeTab.tabIndustrial);
} }
@Override @Override