FixedIssuesWithRegistry
This commit is contained in:
parent
a3d0619843
commit
167dc1414d
5 changed files with 20 additions and 29 deletions
|
@ -38,7 +38,7 @@ public class BlockRenderHelper implements ISimpleBlockRenderingHandler
|
|||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
if (block.blockID == FMRecipeLoader.blockMachine.blockID && metadata < 4)
|
||||
if (FMRecipeLoader.blockPumpMachine != null && block.blockID == FMRecipeLoader.blockPumpMachine.blockID && metadata < 4)
|
||||
{
|
||||
GL11.glTranslatef(0.0F, 1.1F, 0.0F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
|
@ -47,14 +47,14 @@ public class BlockRenderHelper implements ISimpleBlockRenderingHandler
|
|||
modelPump.render(0.0725F);
|
||||
modelPump.renderMotion(0.0725F, 0);
|
||||
}
|
||||
else if (block.blockID == FMRecipeLoader.blockSink.blockID)
|
||||
else if (FMRecipeLoader.blockSink != null && block.blockID == FMRecipeLoader.blockSink.blockID)
|
||||
{
|
||||
GL11.glTranslatef(0.0F, .8F, 0.0F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "Sink.png"));
|
||||
sink.render(0.0565F);
|
||||
}
|
||||
else if (block.blockID == FMRecipeLoader.blockTank.blockID)
|
||||
else if (FMRecipeLoader.blockTank != null && block.blockID == FMRecipeLoader.blockTank.blockID)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.getDomain(), metadata == 1 ? "/textures/blocks/obsidian.png" : "/textures/blocks/iron_block.png"));
|
||||
GL11.glTranslatef(0.0F, -0.9F, 0.0F);
|
||||
|
@ -66,21 +66,21 @@ public class BlockRenderHelper implements ISimpleBlockRenderingHandler
|
|||
GL11.glRotatef(90f, 0f, 1f, 0f);
|
||||
tank.render(0.0625F, false, false, false, false);
|
||||
}
|
||||
if (block.blockID == FMRecipeLoader.blockRod.blockID)
|
||||
else if (FMRecipeLoader.blockRod != null && block.blockID == FMRecipeLoader.blockRod.blockID)
|
||||
{
|
||||
GL11.glTranslatef(0.0F, 1.5F, 0.0F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "mechanical/GearRod.png"));
|
||||
modelRod.render(0.0825F, 0);
|
||||
}
|
||||
else if (block.blockID == FMRecipeLoader.blockGenerator.blockID)
|
||||
else if (FMRecipeLoader.blockGenerator != null && block.blockID == FMRecipeLoader.blockGenerator.blockID)
|
||||
{
|
||||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "mechanical/Generator.png"));
|
||||
modelGen.render(null);
|
||||
}
|
||||
else if (block.blockID == FMRecipeLoader.blockConPump.blockID && metadata < 4)
|
||||
else if (FMRecipeLoader.blockConPump != null && block.blockID == FMRecipeLoader.blockConPump.blockID && metadata < 4)
|
||||
{
|
||||
GL11.glTranslatef(0.0F, 1.2F, 0.0F);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
|
|
|
@ -2,7 +2,7 @@ package dark.fluid.common;
|
|||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import dark.core.common.DarkMain;
|
||||
import dark.core.common.DMCreativeTab;
|
||||
import dark.core.prefab.IExtraObjectInfo;
|
||||
import dark.core.prefab.machine.BlockMachine;
|
||||
import dark.core.registration.ModObjectRegistry.BlockBuildData;
|
||||
|
@ -12,7 +12,7 @@ public abstract class BlockFM extends BlockMachine implements IExtraObjectInfo
|
|||
|
||||
public BlockFM(Class<? extends BlockFM> blockClass, String name, Material material)
|
||||
{
|
||||
super(new BlockBuildData(blockClass, name, material).setConfigProvider(FluidMech.CONFIGURATION).setCreativeTab(DarkMain.tabHydrualic));
|
||||
super(new BlockBuildData(blockClass, name, material).setConfigProvider(FluidMech.CONFIGURATION).setCreativeTab(DMCreativeTab.tabHydrualic));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,7 @@ public class FMRecipeLoader extends RecipeLoader
|
|||
|
||||
public static Block blockPipe;
|
||||
public static Block blockTank;
|
||||
public static Block blockMachine;
|
||||
public static Block blockPumpMachine;
|
||||
public static Block blockRod;
|
||||
public static Block blockGenerator;
|
||||
public static Block blockReleaseValve;
|
||||
|
@ -42,12 +42,12 @@ public class FMRecipeLoader extends RecipeLoader
|
|||
this.registerTanks();
|
||||
|
||||
// generator
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FMRecipeLoader.blockGenerator, 1), new Object[] { "@T@", "OVO", "@T@", 'T', new ItemStack(blockRod, 1), '@', "plateSteel", 'O', "basicCircuit", 'V', "motor" }));
|
||||
//GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FMRecipeLoader.blockGenerator, 1), new Object[] { "@T@", "OVO", "@T@", 'T', new ItemStack(blockRod, 1), '@', "plateSteel", 'O', "basicCircuit", 'V', "motor" }));
|
||||
// mechanical rod
|
||||
GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { "I@I", 'I', Item.ingotIron, '@', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Iron.ordinal()) });
|
||||
//GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { "I@I", 'I', Item.ingotIron, '@', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Iron.ordinal()) });
|
||||
|
||||
// pump
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockMachine, 1, 0), new Object[] { "C@C", "BMB", "@X@", '@', "plateSteel", 'X', new ItemStack(blockPipe, 1), 'B', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()), 'C', "basicCircuit", 'M', "motor" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockPumpMachine, 1, 0), new Object[] { "C@C", "BMB", "@X@", '@', "plateSteel", 'X', new ItemStack(blockPipe, 1), 'B', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()), 'C', "basicCircuit", 'M', "motor" }));
|
||||
// construction pump
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConPump, 1, 0), new Object[] { "@C@", "BMB", "@@@", '@', "plateSteel", 'B', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()), 'C', "advancedCircuit", 'M', "motor" }));
|
||||
// Drain
|
||||
|
|
|
@ -129,13 +129,13 @@ public class FluidMech extends ModPrefab
|
|||
|
||||
FMRecipeLoader.blockWasteLiquid = ModObjectRegistry.createNewFluidBlock(this.PREFIX, FluidMech.CONFIGURATION, new Fluid(WASTE_FLUID_NAME).setUnlocalizedName("fluid.waste.name").setDensity(1300).setViscosity(1800));
|
||||
FMRecipeLoader.blockOilLiquid = ModObjectRegistry.createNewFluidBlock(this.PREFIX, FluidMech.CONFIGURATION, new Fluid(OIL_FLUID_NAME).setUnlocalizedName("fluid.oil.name").setDensity(1500).setViscosity(4700));
|
||||
FMRecipeLoader.blockPipe = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockPipe.class, ItemBlockPipe.class);
|
||||
FMRecipeLoader.blockMachine = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockPumpMachine.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockReleaseValve = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockReleaseValve.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockTank = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockTank.class, ItemBlockPipe.class);
|
||||
FMRecipeLoader.blockSink = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockSink.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockDrain = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockDrain.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockConPump = ModObjectRegistry.createNewBlock(FluidMech.MOD_ID, BlockConstructionPump.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockPipe = ModObjectRegistry.createNewBlock("FMBlockPipe",FluidMech.MOD_ID, BlockPipe.class, ItemBlockPipe.class);
|
||||
FMRecipeLoader.blockPumpMachine = ModObjectRegistry.createNewBlock("FMBlockPump",FluidMech.MOD_ID, BlockPumpMachine.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockReleaseValve = ModObjectRegistry.createNewBlock("FMBlockReleaseValve",FluidMech.MOD_ID, BlockReleaseValve.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockTank = ModObjectRegistry.createNewBlock("FMBlockTank",FluidMech.MOD_ID, BlockTank.class, ItemBlockPipe.class);
|
||||
FMRecipeLoader.blockSink = ModObjectRegistry.createNewBlock("FMBlockSink",FluidMech.MOD_ID, BlockSink.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockDrain = ModObjectRegistry.createNewBlock("FMBlockDrain",FluidMech.MOD_ID, BlockDrain.class, ItemBlockHolder.class);
|
||||
FMRecipeLoader.blockConPump = ModObjectRegistry.createNewBlock("FMBlockConstructionPump",FluidMech.MOD_ID, BlockConstructionPump.class, ItemBlockHolder.class);
|
||||
|
||||
CONFIGURATION.save();
|
||||
}
|
||||
|
@ -158,15 +158,6 @@ public class FluidMech extends ModPrefab
|
|||
|
||||
}
|
||||
|
||||
public static final CreativeTabs TabFluidMech = new CreativeTabs("Hydraulics")
|
||||
{
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(FMRecipeLoader.blockPipe, 1, 4);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String getDomain()
|
||||
{
|
||||
|
|
|
@ -67,7 +67,7 @@ public class BlockPumpMachine extends BlockFM
|
|||
|
||||
if (meta < 4)
|
||||
{
|
||||
return new ItemStack(FMRecipeLoader.blockMachine, 1, 0);
|
||||
return new ItemStack(FMRecipeLoader.blockPumpMachine, 1, 0);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue