From 023e752f4fcd58e84a3532a16c2459bef59ecb14 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Fri, 13 Sep 2013 23:54:49 -0400 Subject: [PATCH] minor corrections --- .../client/render/BlockRenderingHandler.java | 13 +++++++ .../dark/assembly/common/AssemblyLine.java | 10 ++++- .../machine/processor/BlockProcessor.java | 39 ++++++++++++++----- .../processor/TileEntityProcessor.java | 12 +++--- 4 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java index df882ac2..f2d66ff7 100644 --- a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java +++ b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java @@ -13,6 +13,7 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.client.model.ModelConveyorBelt; +import dark.assembly.client.model.ModelCrusher; import dark.assembly.client.model.ModelManipulator; import dark.assembly.client.model.ModelRejectorPiston; import dark.assembly.common.AssemblyLine; @@ -25,6 +26,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler private ModelConveyorBelt modelConveyorBelt = new ModelConveyorBelt(); private ModelRejectorPiston modelEjector = new ModelRejectorPiston(); private ModelManipulator modelInjector = new ModelManipulator(); + private ModelCrusher modelCrushor = new ModelCrusher(); @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) @@ -90,6 +92,17 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderCraneFrame.MODEL.render(true, true, false, false, false, false, false); GL11.glPopMatrix(); } + else if (block.blockID == AssemblyLine.processorMachine.blockID && metadata == 0) + { + FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + "CrusherBlock.png")); + GL11.glPushMatrix(); + GL11.glTranslatef(0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glRotatef(-90f, 0f, 1f, 0f); + this.modelCrushor.renderBody(0.0625f); + this.modelCrushor.renderPiston(0.0625f, 4); + GL11.glPopMatrix(); + } } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) diff --git a/src/minecraft/dark/assembly/common/AssemblyLine.java b/src/minecraft/dark/assembly/common/AssemblyLine.java index aacd9a73..33d36529 100644 --- a/src/minecraft/dark/assembly/common/AssemblyLine.java +++ b/src/minecraft/dark/assembly/common/AssemblyLine.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.List; import java.util.logging.Logger; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; @@ -50,13 +51,15 @@ import dark.assembly.common.machine.crane.TileEntityCraneRail; import dark.assembly.common.machine.encoder.BlockEncoder; import dark.assembly.common.machine.encoder.ItemDisk; import dark.assembly.common.machine.encoder.TileEntityEncoder; +import dark.assembly.common.machine.processor.BlockProcessor; import dark.core.common.BlockRegistry.BlockData; import dark.core.common.DarkMain; import dark.core.prefab.ModPrefab; +import dark.core.prefab.items.ItemBlockHolder; @ModstatInfo(prefix = "asmline") @Mod(modid = AssemblyLine.MOD_ID, name = AssemblyLine.MOD_NAME, version = DarkMain.VERSION, dependencies = "required-after:DarkCore", useMetadata = true) -@NetworkMod( clientSideRequired = true, serverSideRequired = false) +@NetworkMod(clientSideRequired = true, serverSideRequired = false) public class AssemblyLine extends ModPrefab { @@ -69,7 +72,6 @@ public class AssemblyLine extends ModPrefab public static final String MOD_ID = "AssemblyLine"; public static final String MOD_NAME = "Assembly Line"; - @SidedProxy(clientSide = "dark.assembly.client.ClientProxy", serverSide = "dark.assembly.common.CommonProxy") public static CommonProxy proxy; @@ -94,6 +96,8 @@ public class AssemblyLine extends ModPrefab public static boolean REQUIRE_NO_POWER = false; public static boolean VINALLA_RECIPES = false; + public static Block processorMachine; + @EventHandler public void preInit(FMLPreInitializationEvent event) { @@ -164,6 +168,8 @@ public class AssemblyLine extends ModPrefab recipeLoader.blockCraneController = new BlockCraneController(getNextID()); recipeLoader.blockCraneFrame = new BlockCraneFrame(getNextID()); recipeLoader.blockTurntable = new BlockTurntable(getNextID()); + this.processorMachine = new BlockProcessor(getNextID()); + dataList.add(new BlockData(this.processorMachine, ItemBlockHolder.class, "OreProcessor")); recipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); recipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); diff --git a/src/minecraft/dark/assembly/common/machine/processor/BlockProcessor.java b/src/minecraft/dark/assembly/common/machine/processor/BlockProcessor.java index c929b3b7..0054272a 100644 --- a/src/minecraft/dark/assembly/common/machine/processor/BlockProcessor.java +++ b/src/minecraft/dark/assembly/common/machine/processor/BlockProcessor.java @@ -11,9 +11,9 @@ import net.minecraftforge.common.Configuration; import universalelectricity.core.UniversalElectricity; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.common.AssemblyLine; import dark.assembly.common.TabAssemblyLine; -import dark.assembly.common.machine.processor.ProcessorRecipes.ProcessorType; import dark.core.common.DarkMain; import dark.core.prefab.BlockMachine; import dark.core.prefab.IExtraObjectInfo; @@ -21,6 +21,9 @@ import dark.core.prefab.helpers.Pair; public class BlockProcessor extends BlockMachine implements IExtraObjectInfo { + public static float crusherWattPerTick = .125f; + public static float grinderWattPerTick = .125f; + public static float pressWattPerTick = .2f; public BlockProcessor(int blockID) { @@ -86,25 +89,21 @@ public class BlockProcessor extends BlockMachine implements IExtraObjectInfo @Override public TileEntity createTileEntity(World world, int metadata) { - if (metadata == 0 || metadata == 1) - { - return new TileEntityProcessor(ProcessorType.CRUSHER); - } - return super.createTileEntity(world, metadata); + return new TileEntityProcessor(); } @Override public boolean hasExtraConfigs() { - // TODO Auto-generated method stub - return false; + return true; } @Override public void loadExtraConfigs(Configuration config) { - // TODO Auto-generated method stub - + crusherWattPerTick = (float) (config.get("settings", "CrusherWattPerTick", 125).getDouble(125) / 1000); + grinderWattPerTick = (float) (config.get("settings", "GrinderWattPerTick", 125).getDouble(125) / 1000); + pressWattPerTick = (float) (config.get("settings", "PressWattPerTick", 200).getDouble(200) / 1000); } @Override @@ -121,4 +120,24 @@ public class BlockProcessor extends BlockMachine implements IExtraObjectInfo } + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @SideOnly(Side.CLIENT) + @Override + public int getRenderType() + { + return BlockRenderingHandler.BLOCK_RENDER_ID; + } + } diff --git a/src/minecraft/dark/assembly/common/machine/processor/TileEntityProcessor.java b/src/minecraft/dark/assembly/common/machine/processor/TileEntityProcessor.java index 113d494f..74fa44f3 100644 --- a/src/minecraft/dark/assembly/common/machine/processor/TileEntityProcessor.java +++ b/src/minecraft/dark/assembly/common/machine/processor/TileEntityProcessor.java @@ -21,14 +21,16 @@ public class TileEntityProcessor extends TileEntityMachine public ProcessorType type; - public TileEntityProcessor(ProcessorType type) - { - this.type = type; - } - @Override public void updateEntity() { + if (this.type == null) + { + if (this.getBlockMetadata() == 0 || this.getBlockMetadata() == 1) + { + this.type = ProcessorType.CRUSHER; + } + } super.updateEntity(); if (this.running) {