Worked on processor setup & added grinder

Laying the group work for the next two processors to be auto added when
done.
This commit is contained in:
DarkGuardsman 2013-09-17 01:09:47 -04:00
parent 575d016dbc
commit c4c9922aa8
5 changed files with 308 additions and 206 deletions

View file

@ -4,22 +4,21 @@
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package dark.assembly.client.model;
package net.minecraft.src;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelGrinder extends ModelBase
{
//fields
//fields
ModelRenderer base;
ModelRenderer rightSide;
ModelRenderer leftSide;
ModelRenderer front;
ModelRenderer back;
ModelRenderer base;
ModelRenderer top;
ModelRenderer uDisk1;
ModelRenderer uDisk2;
ModelRenderer uDisk3;
@ -32,156 +31,192 @@ public class ModelGrinder extends ModelBase
ModelRenderer dDisk4;
ModelRenderer dDisk5;
ModelRenderer dDisk6;
public ModelGrinder()
{
textureWidth = 128;
textureHeight = 128;
base = new ModelRenderer(this, 1, 109);
base.addBox(-8F, 0F, -8F, 16, 2, 16);
base.setRotationPoint(0F, 22F, 0F);
base.setTextureSize(128, 128);
base.mirror = true;
setRotation(base, 0F, 0F, 0F);
rightSide = new ModelRenderer(this, 0, 80);
rightSide.addBox(0F, 0F, 0F, 2, 13, 13);
rightSide.setRotationPoint(-8F, 9F, -6F);
rightSide.setTextureSize(128, 128);
rightSide.mirror = true;
setRotation(rightSide, 0F, 0F, 0F);
leftSide = new ModelRenderer(this, 40, 80);
leftSide.addBox(0F, 0F, 0F, 2, 13, 13);
leftSide.setRotationPoint(6F, 9F, -6F);
leftSide.setTextureSize(128, 128);
leftSide.mirror = true;
setRotation(leftSide, 0F, 0F, 0F);
front = new ModelRenderer(this, 78, 114);
front.addBox(-8F, 0F, -8F, 16, 5, 2);
front.setRotationPoint(0F, 17F, 0F);
front.setTextureSize(128, 128);
front.mirror = true;
setRotation(front, 0F, 0F, 0F);
back = new ModelRenderer(this, 78, 95);
back.addBox(-8F, 0F, -3F, 16, 13, 1);
back.setRotationPoint(0F, 9F, 10F);
back.setTextureSize(128, 128);
back.mirror = true;
setRotation(back, 0F, 0F, 0F);
base = new ModelRenderer(this, 1, 65);
base.addBox(-8F, 0F, -8F, 14, 1, 10);
base.setRotationPoint(1F, 8F, 5F);
base.setTextureSize(128, 128);
base.mirror = true;
setRotation(base, 0F, 0F, 0F);
uDisk1 = new ModelRenderer(this, 0, 0);
uDisk1.addBox(0F, -4F, -4F, 1, 8, 8);
uDisk1.setRotationPoint(-6F, 14F, 1F);
uDisk1.setTextureSize(128, 128);
uDisk1.mirror = true;
setRotation(uDisk1, 0.7853982F, 0F, 0F);
uDisk2 = new ModelRenderer(this, 0, 0);
uDisk2.addBox(0F, -4F, -4F, 1, 8, 8);
uDisk2.setRotationPoint(-4F, 14F, 1F);
uDisk2.setTextureSize(128, 128);
uDisk2.mirror = true;
setRotation(uDisk2, 0F, 0F, 0F);
uDisk3 = new ModelRenderer(this, 0, 0);
uDisk3.addBox(4F, -4F, -4F, 1, 8, 8);
uDisk3.setRotationPoint(-6F, 14F, 1F);
uDisk3.setTextureSize(128, 128);
uDisk3.mirror = true;
setRotation(uDisk3, 0.7853982F, 0F, 0F);
uDisk4 = new ModelRenderer(this, 0, 0);
uDisk4.addBox(6F, -4F, -4F, 1, 8, 8);
uDisk4.setRotationPoint(-6F, 14F, 1F);
uDisk4.setTextureSize(128, 128);
uDisk4.mirror = true;
setRotation(uDisk4, 0F, 0F, 0F);
uDisk5 = new ModelRenderer(this, 0, 0);
uDisk5.addBox(8F, -4F, -4F, 1, 8, 8);
uDisk5.setRotationPoint(-6F, 14F, 1F);
uDisk5.setTextureSize(128, 128);
uDisk5.mirror = true;
setRotation(uDisk5, 0.7853982F, 0F, 0F);
uDisk6 = new ModelRenderer(this, 0, 0);
uDisk6.addBox(10F, -4F, -4F, 1, 8, 8);
uDisk6.setRotationPoint(-6F, 14F, 1F);
uDisk6.setTextureSize(128, 128);
uDisk6.mirror = true;
setRotation(uDisk6, 0F, 0F, 0F);
dDisk1 = new ModelRenderer(this, 0, 0);
dDisk1.addBox(0F, -4F, -4F, 1, 8, 8);
dDisk1.setRotationPoint(-5F, 17F, 0F);
dDisk1.setTextureSize(128, 128);
dDisk1.mirror = true;
setRotation(dDisk1, 0F, 0F, 0F);
dDisk2 = new ModelRenderer(this, 0, 0);
dDisk2.addBox(2F, -4F, -4F, 1, 8, 8);
dDisk2.setRotationPoint(-5F, 17F, 0F);
dDisk2.setTextureSize(128, 128);
dDisk2.mirror = true;
setRotation(dDisk2, 0.7853982F, 0F, 0F);
dDisk3 = new ModelRenderer(this, 0, 0);
dDisk3.addBox(4F, -4F, -4F, 1, 8, 8);
dDisk3.setRotationPoint(-5F, 17F, 0F);
dDisk3.setTextureSize(128, 128);
dDisk3.mirror = true;
setRotation(dDisk3, 0F, 0F, 0F);
dDisk4 = new ModelRenderer(this, 0, 0);
dDisk4.addBox(6F, -4F, -4F, 1, 8, 8);
dDisk4.setRotationPoint(-5F, 17F, 0F);
dDisk4.setTextureSize(128, 128);
dDisk4.mirror = true;
setRotation(dDisk4, 0.7853982F, 0F, 0F);
dDisk5 = new ModelRenderer(this, 0, 0);
dDisk5.addBox(8F, -4F, -4F, 1, 8, 8);
dDisk5.setRotationPoint(-5F, 17F, 0F);
dDisk5.setTextureSize(128, 128);
dDisk5.mirror = true;
setRotation(dDisk5, 0F, 0F, 0F);
dDisk6 = new ModelRenderer(this, 0, 0);
dDisk6.addBox(10F, -4F, -4F, 1, 8, 8);
dDisk6.setRotationPoint(-5F, 17F, 0F);
dDisk6.setTextureSize(128, 128);
dDisk6.mirror = true;
setRotation(dDisk6, 0.7853982F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
base.render(f5);
rightSide.render(f5);
leftSide.render(f5);
front.render(f5);
back.render(f5);
base.render(f5);
uDisk1.render(f5);
uDisk2.render(f5);
uDisk3.render(f5);
uDisk4.render(f5);
uDisk5.render(f5);
uDisk6.render(f5);
dDisk1.render(f5);
dDisk2.render(f5);
dDisk3.render(f5);
dDisk4.render(f5);
dDisk5.render(f5);
dDisk6.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5);
}
ModelRenderer[] topDiskSet;
ModelRenderer[] bottomDiskSet;
public ModelGrinder()
{
textureWidth = 128;
textureHeight = 128;
base = new ModelRenderer(this, 1, 109);
base.addBox(-8F, 0F, -8F, 16, 2, 16);
base.setRotationPoint(0F, 22F, 0F);
base.setTextureSize(128, 128);
base.mirror = true;
setRotation(base, 0F, 0F, 0F);
rightSide = new ModelRenderer(this, 0, 80);
rightSide.addBox(0F, 0F, 0F, 2, 13, 13);
rightSide.setRotationPoint(-8F, 9F, -6F);
rightSide.setTextureSize(128, 128);
rightSide.mirror = true;
setRotation(rightSide, 0F, 0F, 0F);
leftSide = new ModelRenderer(this, 40, 80);
leftSide.addBox(0F, 0F, 0F, 2, 13, 13);
leftSide.setRotationPoint(6F, 9F, -6F);
leftSide.setTextureSize(128, 128);
leftSide.mirror = true;
setRotation(leftSide, 0F, 0F, 0F);
front = new ModelRenderer(this, 78, 114);
front.addBox(-8F, 0F, -8F, 16, 5, 2);
front.setRotationPoint(0F, 17F, 0F);
front.setTextureSize(128, 128);
front.mirror = true;
setRotation(front, 0F, 0F, 0F);
back = new ModelRenderer(this, 78, 95);
back.addBox(-8F, 0F, -3F, 16, 13, 1);
back.setRotationPoint(0F, 9F, 10F);
back.setTextureSize(128, 128);
back.mirror = true;
setRotation(back, 0F, 0F, 0F);
top = new ModelRenderer(this, 1, 65);
top.addBox(-8F, 0F, -8F, 14, 1, 10);
top.setRotationPoint(1F, 8F, 5F);
top.setTextureSize(128, 128);
top.mirror = true;
setRotation(top, 0F, 0F, 0F);
uDisk1 = new ModelRenderer(this, 0, 0);
uDisk1.addBox(0F, -4F, -4F, 1, 8, 8);
uDisk1.setRotationPoint(-6F, 14F, 1F);
uDisk1.setTextureSize(128, 128);
uDisk1.mirror = true;
setRotation(uDisk1, 0.7853982F, 0F, 0F);
uDisk2 = new ModelRenderer(this, 0, 0);
uDisk2.addBox(0F, -4F, -4F, 1, 8, 8);
uDisk2.setRotationPoint(-4F, 14F, 1F);
uDisk2.setTextureSize(128, 128);
uDisk2.mirror = true;
setRotation(uDisk2, 0F, 0F, 0F);
uDisk3 = new ModelRenderer(this, 0, 0);
uDisk3.addBox(4F, -4F, -4F, 1, 8, 8);
uDisk3.setRotationPoint(-6F, 14F, 1F);
uDisk3.setTextureSize(128, 128);
uDisk3.mirror = true;
setRotation(uDisk3, 0.7853982F, 0F, 0F);
uDisk4 = new ModelRenderer(this, 0, 0);
uDisk4.addBox(6F, -4F, -4F, 1, 8, 8);
uDisk4.setRotationPoint(-6F, 14F, 1F);
uDisk4.setTextureSize(128, 128);
uDisk4.mirror = true;
setRotation(uDisk4, 0F, 0F, 0F);
uDisk5 = new ModelRenderer(this, 0, 0);
uDisk5.addBox(8F, -4F, -4F, 1, 8, 8);
uDisk5.setRotationPoint(-6F, 14F, 1F);
uDisk5.setTextureSize(128, 128);
uDisk5.mirror = true;
setRotation(uDisk5, 0.7853982F, 0F, 0F);
uDisk6 = new ModelRenderer(this, 0, 0);
uDisk6.addBox(10F, -4F, -4F, 1, 8, 8);
uDisk6.setRotationPoint(-6F, 14F, 1F);
uDisk6.setTextureSize(128, 128);
uDisk6.mirror = true;
setRotation(uDisk6, 0F, 0F, 0F);
dDisk1 = new ModelRenderer(this, 0, 0);
dDisk1.addBox(0F, -4F, -4F, 1, 8, 8);
dDisk1.setRotationPoint(-5F, 17F, 0F);
dDisk1.setTextureSize(128, 128);
dDisk1.mirror = true;
setRotation(dDisk1, 0F, 0F, 0F);
dDisk2 = new ModelRenderer(this, 0, 0);
dDisk2.addBox(2F, -4F, -4F, 1, 8, 8);
dDisk2.setRotationPoint(-5F, 17F, 0F);
dDisk2.setTextureSize(128, 128);
dDisk2.mirror = true;
setRotation(dDisk2, 0.7853982F, 0F, 0F);
dDisk3 = new ModelRenderer(this, 0, 0);
dDisk3.addBox(4F, -4F, -4F, 1, 8, 8);
dDisk3.setRotationPoint(-5F, 17F, 0F);
dDisk3.setTextureSize(128, 128);
dDisk3.mirror = true;
setRotation(dDisk3, 0F, 0F, 0F);
dDisk4 = new ModelRenderer(this, 0, 0);
dDisk4.addBox(6F, -4F, -4F, 1, 8, 8);
dDisk4.setRotationPoint(-5F, 17F, 0F);
dDisk4.setTextureSize(128, 128);
dDisk4.mirror = true;
setRotation(dDisk4, 0.7853982F, 0F, 0F);
dDisk5 = new ModelRenderer(this, 0, 0);
dDisk5.addBox(8F, -4F, -4F, 1, 8, 8);
dDisk5.setRotationPoint(-5F, 17F, 0F);
dDisk5.setTextureSize(128, 128);
dDisk5.mirror = true;
setRotation(dDisk5, 0F, 0F, 0F);
dDisk6 = new ModelRenderer(this, 0, 0);
dDisk6.addBox(10F, -4F, -4F, 1, 8, 8);
dDisk6.setRotationPoint(-5F, 17F, 0F);
dDisk6.setTextureSize(128, 128);
dDisk6.mirror = true;
setRotation(dDisk6, 0.7853982F, 0F, 0F);
topDiskSet = new ModelRenderer[] { uDisk1, uDisk2, uDisk3, uDisk4, uDisk5, uDisk6 };
bottomDiskSet = new ModelRenderer[] { dDisk1, dDisk2, dDisk3, dDisk4, dDisk5, dDisk6 };
}
public void renderBody(float f5)
{
base.render(f5);
rightSide.render(f5);
leftSide.render(f5);
front.render(f5);
back.render(f5);
top.render(f5);
}
public void renderRotation(float f5, int stage)
{
float rotation = 0.3926990816987241F * stage;
this.resetRotation();
//Set new rotation angle
for (int i = 0; i < 6; i++)
{
topDiskSet[i].offsetX += rotation;
bottomDiskSet[i].offsetX -= rotation;
}
//render
for (int i = 0; i < 6; i++)
{
topDiskSet[i].render(f5);
bottomDiskSet[i].render(f5);
}
this.resetRotation();
}
/** Resets default rotation of the spinning disks */
public void resetRotation()
{
for (int i = 0; i < topDiskSet.length; i++)
{
if (i == 0 || i % 2 == 0)
{
topDiskSet[i].offsetX = 0.7853982F;
}
else
{
topDiskSet[i].offsetX = 0F;
}
}
for (int i = 0; i < bottomDiskSet.length; i++)
{
if (i != 0 && i % 2 != 0)
{
bottomDiskSet[i].offsetX = 0.7853982F;
}
else
{
bottomDiskSet[i].offsetX = 0F;
}
}
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -14,6 +14,7 @@ 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.ModelGrinder;
import dark.assembly.client.model.ModelManipulator;
import dark.assembly.client.model.ModelRejectorPiston;
import dark.assembly.common.AssemblyLine;
@ -27,6 +28,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
private ModelRejectorPiston modelEjector = new ModelRejectorPiston();
private ModelManipulator modelInjector = new ModelManipulator();
private ModelCrusher modelCrushor = new ModelCrusher();
private ModelGrinder grinderModel = new ModelGrinder();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
@ -103,6 +105,17 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
this.modelCrushor.renderPiston(0.0625f, 4);
GL11.glPopMatrix();
}
else if (block.blockID == AssemblyLine.processorMachine.blockID && metadata == 4)
{
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + "GrinderBlock.png"));
GL11.glPushMatrix();
GL11.glTranslatef(0f, 1f, 0f);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glRotatef(-90f, 0f, 1f, 0f);
this.grinderModel.renderBody(0.0625f);
this.grinderModel.renderRotation(0.0625f, 0);
GL11.glPopMatrix();
}
}
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)

View file

@ -9,6 +9,7 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.assembly.client.model.ModelCrusher;
import dark.assembly.client.model.ModelGrinder;
import dark.assembly.common.AssemblyLine;
import dark.assembly.common.machine.processor.TileEntityProcessor;
import dark.core.client.renders.RenderTileMachine;
@ -16,24 +17,57 @@ import dark.core.client.renders.RenderTileMachine;
@SideOnly(Side.CLIENT)
public class RenderProcessor extends RenderTileMachine
{
private ModelCrusher model = new ModelCrusher();
private ModelCrusher crusherModel;
private ModelGrinder grinderModel;
public RenderProcessor()
{
this.crusherModel = new ModelCrusher();
this.grinderModel = new ModelGrinder();
}
private void renderAModelAt(TileEntityProcessor tileEntity, double x, double y, double z, float f)
{
func_110628_a(this.getTexture(tileEntity.blockType.blockID, tileEntity.blockMetadata));
func_110628_a(this.getTexture(tileEntity.getBlockType().blockID, tileEntity.getBlockMetadata()));
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
if (tileEntity.getDirection() == ForgeDirection.EAST)
if (tileEntity.getDirection() == ForgeDirection.NORTH)
{
GL11.glRotatef(180f, 0f, 1f, 0f);
}
else if (tileEntity.getDirection() == ForgeDirection.SOUTH)
{
GL11.glRotatef(0f, 0f, 1f, 0f);
}
else if (tileEntity.getDirection() == ForgeDirection.WEST)
{
GL11.glRotatef(90f, 0f, 1f, 0f);
}
if (tileEntity.blockMetadata == 0 || tileEntity.blockMetadata == 1)
else if (tileEntity.getDirection() == ForgeDirection.EAST)
{
model.renderBody(0.0625F);
model.renderPiston(0.0625F, tileEntity.renderStage);
GL11.glRotatef(270f, 0f, 1f, 0f);
}
if (tileEntity.blockMetadata >= 0 && tileEntity.blockMetadata <= 3)
{
crusherModel.renderBody(0.0625F);
crusherModel.renderPiston(0.0625F, tileEntity.renderStage);
}
else if (tileEntity.blockMetadata >= 4 && tileEntity.blockMetadata <= 7)
{
grinderModel.renderBody(0.0625F);
grinderModel.renderRotation(0.0625F, tileEntity.renderStage);
}
else if (tileEntity.blockMetadata >= 8 && tileEntity.blockMetadata <= 11)
{
}
else if (tileEntity.blockMetadata >= 12 && tileEntity.blockMetadata <= 15)
{
}
GL11.glPopMatrix();

View file

@ -1,21 +1,27 @@
package dark.assembly.common.machine.processor;
import java.util.List;
import java.util.Set;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.OreDictionary;
import universalelectricity.core.UniversalElectricity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.api.ProcessorRecipes.ProcessorType;
import dark.assembly.client.render.BlockRenderingHandler;
import dark.assembly.common.AssemblyLine;
import dark.assembly.common.CommonProxy;
import dark.assembly.common.TabAssemblyLine;
import dark.core.common.DarkMain;
import dark.core.common.items.EnumMeterials;
import dark.core.prefab.BlockMachine;
import dark.core.prefab.IExtraObjectInfo;
import dark.core.prefab.helpers.Pair;
@ -54,34 +60,17 @@ public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == 0)
int g = meta % 4;
if (g < 3)
{
world.setBlockMetadataWithNotify(x, y, z, 1, 3);
world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3);
return true;
}
if (meta == 1)
else
{
world.setBlockMetadataWithNotify(x, y, z, 0, 3);
world.setBlockMetadataWithNotify(x, y, z, meta - 3, 3);
return true;
}
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconReg)
{
if (this.blockIcon == null)
{
this.blockIcon = iconReg.registerIcon(DarkMain.getInstance().PREFIX + "machine");
}
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
return this.blockIcon;
}
@Override
@ -105,9 +94,13 @@ public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
@Override
public void loadExtraConfigs(Configuration config)
{
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);
for (ProcessorData data : ProcessorData.values())
{
data.enabled = config.get(data.unlocalizedName, "Enabled", true).getBoolean(true);
data.allowCrafting = config.get(data.unlocalizedName, "CanCraft", true).getBoolean(true);
data.wattPerTick = (float) (config.get(data.unlocalizedName, "WattPerTick", data.wattPerTick).getDouble(data.wattPerTick) / 1000);
data.processingTicks = config.get(data.unlocalizedName, "ProcessingTicks", data.processingTicks).getInt();
}
}
@Override
@ -120,8 +113,10 @@ public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
@Override
public void loadOreNames()
{
// TODO Auto-generated method stub
for (ProcessorData data : ProcessorData.values())
{
OreDictionary.registerOre(data.unlocalizedName + "OreProcessor", new ItemStack(this.blockID, 1, data.startMeta));
}
}
@Override
@ -144,4 +139,38 @@ public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
return BlockRenderingHandler.BLOCK_RENDER_ID;
}
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List list)
{
for (ProcessorData data : ProcessorData.values())
{
if (data.enabled)
{
list.add(new ItemStack(par1, 1, data.startMeta));
}
}
}
public static enum ProcessorData
{
CRUSHER(ProcessorType.CRUSHER, "crusher", 125, 100, 0),
GRINDER(ProcessorType.GRINDER, "grinder", 125, 120, 4),
PRESS(ProcessorType.PRESS, "press", 200, 50, 8);
public ProcessorType type;
public String unlocalizedName;
public float wattPerTick;
public int processingTicks, startMeta;
public boolean enabled = true;
public boolean allowCrafting = true;
private ProcessorData(ProcessorType type, String name, float watts, int ticks, int meta)
{
this.type = type;
this.unlocalizedName = name;
this.wattPerTick = watts;
this.processingTicks = ticks;
this.startMeta = meta;
}
}
}

View file

@ -10,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.ForgeDirection;
import dark.api.ProcessorRecipes;
import dark.api.ProcessorRecipes.ProcessorType;
import dark.assembly.common.machine.processor.BlockProcessor.ProcessorData;
import dark.core.interfaces.IInvBox;
import dark.core.network.PacketHandler;
import dark.core.prefab.TileEntityMachine;
@ -35,23 +36,13 @@ public class TileEntityProcessor extends TileEntityMachine
{
if (this.type == null)
{
if (this.getBlockMetadata() == 0 || this.getBlockMetadata() == 1)
{
this.type = ProcessorType.CRUSHER;
this.WATTS_PER_TICK = BlockProcessor.crusherWattPerTick;
}
else if (this.getBlockMetadata() == 4 || this.getBlockMetadata() == 5)
{
this.type = ProcessorType.GRINDER;
this.WATTS_PER_TICK = BlockProcessor.grinderWattPerTick;
}
else if (this.getBlockMetadata() == 8 || this.getBlockMetadata() == 9)
{
this.type = ProcessorType.PRESS;
this.WATTS_PER_TICK = BlockProcessor.pressWattPerTick;
}
int g = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) / 4;
ProcessorData data = ProcessorData.values()[g];
this.WATTS_PER_TICK = data.wattPerTick;
this.MAX_WATTS = this.WATTS_PER_TICK * 20;
this.processingTicks = data.processingTicks;
}
super.updateEntity();
if (this.running)