v5.0.1 Release
*Fixed incorrect repo location. *Formatting. *Fixed minor bugs in Metallurgic Infuser. *Fixed unobtainable machines.
This commit is contained in:
parent
ebf8bf5367
commit
ca3018b5b7
150 changed files with 487 additions and 57 deletions
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
125
src/minecraft/mekanism/client/BlockRenderingHandler.java
Normal file
125
src/minecraft/mekanism/client/BlockRenderingHandler.java
Normal file
|
@ -0,0 +1,125 @@
|
|||
package mekanism.client;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.Mekanism;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public ModelTheoreticalElementizer theoreticalElementizer = new ModelTheoreticalElementizer();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
if(block.blockID == Mekanism.machineBlockID)
|
||||
{
|
||||
if(metadata == MachineType.THEORETICAL_ELEMENTIZER.meta)
|
||||
{
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glTranslated(0.0F, -1.0F, 0.0F);
|
||||
GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/resources/mekanism/render/TheoreticalElementizer.png"));
|
||||
theoreticalElementizer.render(0.0625F);
|
||||
}
|
||||
else {
|
||||
ForgeHooksClient.bindTexture(block.getTextureFile(), 0);
|
||||
renderItem(renderer, metadata, block);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
if(block.blockID == Mekanism.machineBlockID)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!MachineType.getFromMetadata(metadata).hasModel)
|
||||
{
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.updateCustomBlockBounds(block);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId()
|
||||
{
|
||||
return ClientProxy.RENDER_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleaned-up snip of RenderBlocks.renderBlockAsItem() -- used for rendering an item as an entity,
|
||||
* in a player's inventory, and in a player's hand.
|
||||
* @param renderer - RenderBlocks renderer to render the item with
|
||||
* @param metadata - block/item metadata
|
||||
* @param block - block to render
|
||||
*/
|
||||
public void renderItem(RenderBlocks renderer, int metadata, Block block)
|
||||
{
|
||||
block.setBlockBoundsForItemRender();
|
||||
|
||||
renderer.updateCustomBlockBounds(block);
|
||||
|
||||
if (renderer.useInventoryTint)
|
||||
{
|
||||
int renderColor = block.getRenderColor(metadata);
|
||||
float red = (float)(renderColor >> 16 & 255) / 255.0F;
|
||||
float green = (float)(renderColor >> 8 & 255) / 255.0F;
|
||||
float blue = (float)(renderColor & 255) / 255.0F;
|
||||
GL11.glColor4f(red, green, blue, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
renderer.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, metadata));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
}
|
|
@ -13,6 +13,17 @@ import mekanism.common.TileEntityGasTank;
|
|||
import mekanism.common.TileEntityMetallurgicInfuser;
|
||||
import mekanism.common.TileEntitySmeltingFactory;
|
||||
import mekanism.common.TileEntityTheoreticalElementizer;
|
||||
import mekanism.generators.client.ModelAdvancedSolarGenerator;
|
||||
import mekanism.generators.client.RenderAdvancedSolarGenerator;
|
||||
import mekanism.generators.client.RenderBioGenerator;
|
||||
import mekanism.generators.client.RenderElectrolyticSeparator;
|
||||
import mekanism.generators.client.RenderHeatGenerator;
|
||||
import mekanism.generators.client.RenderHydrogenGenerator;
|
||||
import mekanism.generators.common.TileEntityAdvancedSolarGenerator;
|
||||
import mekanism.generators.common.TileEntityBioGenerator;
|
||||
import mekanism.generators.common.TileEntityElectrolyticSeparator;
|
||||
import mekanism.generators.common.TileEntityHeatGenerator;
|
||||
import mekanism.generators.common.TileEntityHydrogenGenerator;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -20,6 +31,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.TextureFXManager;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
@ -39,6 +51,12 @@ public class ClientProxy extends CommonProxy
|
|||
return RenderingRegistry.addNewArmourRendererPrefix(string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSpecialTileEntities()
|
||||
{
|
||||
ClientRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer", new RenderTheoreticalElementizer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRenderInformation()
|
||||
{
|
||||
|
@ -76,6 +94,9 @@ public class ClientProxy extends CommonProxy
|
|||
//Register item handler
|
||||
MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, new ItemRenderingHandler());
|
||||
|
||||
//Register block handler
|
||||
RenderingRegistry.registerBlockHandler(new BlockRenderingHandler());
|
||||
|
||||
System.out.println("[Mekanism] Render registrations complete.");
|
||||
}
|
||||
|
200
src/minecraft/mekanism/client/ModelTheoreticalElementizer.java
Normal file
200
src/minecraft/mekanism/client/ModelTheoreticalElementizer.java
Normal file
|
@ -0,0 +1,200 @@
|
|||
package mekanism.client;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelTheoreticalElementizer extends ModelBase
|
||||
{
|
||||
ModelRenderer A;
|
||||
ModelRenderer B;
|
||||
ModelRenderer C;
|
||||
ModelRenderer DROT;
|
||||
ModelRenderer E;
|
||||
ModelRenderer F;
|
||||
ModelRenderer G;
|
||||
ModelRenderer H;
|
||||
ModelRenderer I;
|
||||
ModelRenderer J;
|
||||
ModelRenderer K;
|
||||
ModelRenderer L;
|
||||
ModelRenderer M;
|
||||
ModelRenderer N;
|
||||
ModelRenderer O;
|
||||
ModelRenderer P;
|
||||
ModelRenderer Q;
|
||||
ModelRenderer R;
|
||||
|
||||
public ModelTheoreticalElementizer()
|
||||
{
|
||||
textureWidth = 128;
|
||||
textureHeight = 128;
|
||||
|
||||
A = new ModelRenderer(this, 0, 0);
|
||||
A.addBox(-8F, 0F, -8F, 16, 1, 16);
|
||||
A.setRotationPoint(0F, 23F, 0F);
|
||||
A.setTextureSize(64, 32);
|
||||
A.mirror = true;
|
||||
setRotation(A, 0F, 0F, 0F);
|
||||
B = new ModelRenderer(this, 0, 40);
|
||||
B.addBox(-5F, 0F, -4F, 10, 10, 8);
|
||||
B.setRotationPoint(0F, 13F, 0F);
|
||||
B.setTextureSize(64, 32);
|
||||
B.mirror = true;
|
||||
setRotation(B, 0F, 0F, 0F);
|
||||
C = new ModelRenderer(this, 0, 19);
|
||||
C.addBox(-3F, 0F, -3F, 6, 14, 6);
|
||||
C.setRotationPoint(0F, 8F, 0F);
|
||||
C.setTextureSize(64, 32);
|
||||
C.mirror = true;
|
||||
setRotation(C, 0F, 0F, 0F);
|
||||
DROT = new ModelRenderer(this, 5, 0);
|
||||
DROT.addBox(-1F, -1F, -1F, 2, 2, 2);
|
||||
DROT.setRotationPoint(0F, 5F, 0F);
|
||||
DROT.setTextureSize(64, 32);
|
||||
DROT.mirror = true;
|
||||
setRotation(DROT, 0.7853982F, 0.7853982F, 0.7853982F);
|
||||
E = new ModelRenderer(this, 65, 0);
|
||||
E.addBox(-2F, 0F, 2F, 4, 8, 7);
|
||||
E.setRotationPoint(0F, 15F, 0F);
|
||||
E.setTextureSize(64, 32);
|
||||
E.mirror = true;
|
||||
setRotation(E, 0F, 0.7853982F, 0F);
|
||||
F = new ModelRenderer(this, 65, 0);
|
||||
F.addBox(-2F, 0F, 2F, 4, 8, 7);
|
||||
F.setRotationPoint(0F, 15F, 0F);
|
||||
F.setTextureSize(64, 32);
|
||||
F.mirror = true;
|
||||
setRotation(F, 0F, -0.7853982F, 0F);
|
||||
G = new ModelRenderer(this, 0, 0);
|
||||
G.addBox(6F, 0F, 0F, 1, 4, 1);
|
||||
G.setRotationPoint(0F, 19F, -2F);
|
||||
G.setTextureSize(64, 32);
|
||||
G.mirror = true;
|
||||
setRotation(G, 0F, 0F, 0F);
|
||||
H = new ModelRenderer(this, 0, 6);
|
||||
H.addBox(5F, 0F, 0F, 1, 1, 1);
|
||||
H.setRotationPoint(0F, 19F, -2F);
|
||||
H.setTextureSize(64, 32);
|
||||
H.mirror = true;
|
||||
setRotation(H, 0F, 0F, 0F);
|
||||
I = new ModelRenderer(this, 0, 6);
|
||||
I.addBox(5F, 0F, 0F, 1, 1, 1);
|
||||
I.setRotationPoint(0F, 19F, 0F);
|
||||
I.setTextureSize(64, 32);
|
||||
I.mirror = true;
|
||||
setRotation(I, 0F, 0F, 0F);
|
||||
J = new ModelRenderer(this, 0, 0);
|
||||
J.addBox(6F, 0F, 0F, 1, 4, 1);
|
||||
J.setRotationPoint(0F, 19F, 0F);
|
||||
J.setTextureSize(64, 32);
|
||||
J.mirror = true;
|
||||
setRotation(J, 0F, 0F, 0F);
|
||||
K = new ModelRenderer(this, 21, 61);
|
||||
K.addBox(0F, -1F, -4F, 2, 9, 5);
|
||||
K.setRotationPoint(-7F, 15F, 1F);
|
||||
K.setTextureSize(64, 32);
|
||||
K.mirror = true;
|
||||
setRotation(K, 0F, 0F, 0F);
|
||||
L = new ModelRenderer(this, 21, 77);
|
||||
L.addBox(0F, -1F, -1F, 1, 2, 2);
|
||||
L.setRotationPoint(-8F, 16F, 0F);
|
||||
L.setTextureSize(64, 32);
|
||||
L.mirror = true;
|
||||
setRotation(L, 0F, 0F, 0F);
|
||||
M = new ModelRenderer(this, 0, 61);
|
||||
M.addBox(-4F, 0F, 0F, 8, 10, 0);
|
||||
M.setRotationPoint(0F, 3F, 0F);
|
||||
M.setTextureSize(64, 32);
|
||||
M.mirror = true;
|
||||
setRotation(M, 0F, 0.7853982F, 0F);
|
||||
N = new ModelRenderer(this, 0, 73);
|
||||
N.addBox(-4F, 0F, 0F, 8, 10, 0);
|
||||
N.setRotationPoint(0F, 3F, 0F);
|
||||
N.setTextureSize(64, 32);
|
||||
N.mirror = true;
|
||||
setRotation(N, 0F, -0.7853982F, 0F);
|
||||
O = new ModelRenderer(this, 0, 93);
|
||||
O.addBox(-5F, -5F, 0F, 6, 6, 0);
|
||||
O.setRotationPoint(0F, 6F, 0F);
|
||||
O.setTextureSize(64, 32);
|
||||
O.mirror = true;
|
||||
setRotation(O, 0F, -0.7853982F, 0.7853982F);
|
||||
P = new ModelRenderer(this, 0, 85);
|
||||
P.addBox(-5F, -5F, 0F, 6, 6, 0);
|
||||
P.setRotationPoint(0F, 6F, 0F);
|
||||
P.setTextureSize(64, 32);
|
||||
P.mirror = true;
|
||||
setRotation(P, 0F, 0.7853982F, 0.7853982F);
|
||||
Q = new ModelRenderer(this, 65, 17);
|
||||
Q.addBox(-4F, 0F, 0F, 8, 6, 4);
|
||||
Q.setRotationPoint(0F, 17F, -8F);
|
||||
Q.setTextureSize(64, 32);
|
||||
Q.mirror = true;
|
||||
setRotation(Q, 0F, 0F, 0F);
|
||||
R = new ModelRenderer(this, 65, 28);
|
||||
R.addBox(-4F, 0F, 0F, 8, 3, 5);
|
||||
R.setRotationPoint(0F, 17F, -8F);
|
||||
R.setTextureSize(64, 32);
|
||||
R.mirror = true;
|
||||
setRotation(R, 0.5934119F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(float size)
|
||||
{
|
||||
A.render(size);
|
||||
B.render(size);
|
||||
C.render(size);
|
||||
DROT.render(size);
|
||||
E.render(size);
|
||||
F.render(size);
|
||||
G.render(size);
|
||||
H.render(size);
|
||||
I.render(size);
|
||||
J.render(size);
|
||||
K.render(size);
|
||||
L.render(size);
|
||||
M.render(size);
|
||||
N.render(size);
|
||||
O.render(size);
|
||||
P.render(size);
|
||||
Q.render(size);
|
||||
R.render(size);
|
||||
}
|
||||
|
||||
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, entity);
|
||||
A.render(f5);
|
||||
B.render(f5);
|
||||
C.render(f5);
|
||||
DROT.render(f5);
|
||||
E.render(f5);
|
||||
F.render(f5);
|
||||
G.render(f5);
|
||||
H.render(f5);
|
||||
I.render(f5);
|
||||
J.render(f5);
|
||||
K.render(f5);
|
||||
L.render(f5);
|
||||
M.render(f5);
|
||||
N.render(f5);
|
||||
O.render(f5);
|
||||
P.render(f5);
|
||||
Q.render(f5);
|
||||
R.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, Entity entity)
|
||||
{
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package mekanism.client;
|
||||
|
||||
import mekanism.common.TileEntityTheoreticalElementizer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderTheoreticalElementizer extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelTheoreticalElementizer model = new ModelTheoreticalElementizer();
|
||||
|
||||
public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8)
|
||||
{
|
||||
renderAModelAt((TileEntityTheoreticalElementizer) var1, var2, var4, var6, 1F);
|
||||
}
|
||||
|
||||
private void renderAModelAt(TileEntityTheoreticalElementizer tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f);
|
||||
bindTextureByName("/resources/mekanism/render/TheoreticalElementizer.png");
|
||||
|
||||
switch(tileEntity.facing)
|
||||
{
|
||||
case 2: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
|
||||
case 4: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
||||
case 5: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
|
||||
}
|
||||
|
||||
GL11.glRotatef(180F, 0.0F, 1.0F, 1.0F);
|
||||
GL11.glRotatef(90F, -1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package mekanism.common;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mekanism.client.ClientProxy;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -422,28 +423,49 @@ public class BlockMachine extends BlockContainer
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.RENDER_ID;
|
||||
}
|
||||
|
||||
public static enum MachineType
|
||||
{
|
||||
ENRICHMENT_CHAMBER(0, 3, TileEntityEnrichmentChamber.class),
|
||||
PLATINUM_COMPRESSOR(1, 4, TileEntityPlatinumCompressor.class),
|
||||
COMBINER(2, 5, TileEntityCombiner.class),
|
||||
CRUSHER(3, 6, TileEntityCrusher.class),
|
||||
THEORETICAL_ELEMENTIZER(4, 7, TileEntityTheoreticalElementizer.class),
|
||||
BASIC_SMELTING_FACTORY(5, 11, TileEntitySmeltingFactory.class),
|
||||
ADVANCED_SMELTING_FACTORY(6, 11, TileEntityAdvancedSmeltingFactory.class),
|
||||
ULTIMATE_SMELTING_FACTORY(7, 11, TileEntityUltimateSmeltingFactory.class),
|
||||
METALLURGIC_INFUSER(8, 12, TileEntityMetallurgicInfuser.class);
|
||||
ENRICHMENT_CHAMBER(0, 3, TileEntityEnrichmentChamber.class, false),
|
||||
PLATINUM_COMPRESSOR(1, 4, TileEntityPlatinumCompressor.class, false),
|
||||
COMBINER(2, 5, TileEntityCombiner.class, false),
|
||||
CRUSHER(3, 6, TileEntityCrusher.class, false),
|
||||
THEORETICAL_ELEMENTIZER(4, 7, TileEntityTheoreticalElementizer.class, true),
|
||||
BASIC_SMELTING_FACTORY(5, 11, TileEntitySmeltingFactory.class, false),
|
||||
ADVANCED_SMELTING_FACTORY(6, 11, TileEntityAdvancedSmeltingFactory.class, false),
|
||||
ULTIMATE_SMELTING_FACTORY(7, 11, TileEntityUltimateSmeltingFactory.class, false),
|
||||
METALLURGIC_INFUSER(8, 12, TileEntityMetallurgicInfuser.class, false);
|
||||
|
||||
public int meta;
|
||||
public int guiId;
|
||||
public Class<? extends TileEntity> tileEntityClass;
|
||||
public boolean hasModel;
|
||||
|
||||
private MachineType(int i, int j, Class<? extends TileEntity> tileClass)
|
||||
private MachineType(int i, int j, Class<? extends TileEntity> tileClass, boolean model)
|
||||
{
|
||||
meta = i;
|
||||
guiId = j;
|
||||
tileEntityClass = tileClass;
|
||||
hasModel = model;
|
||||
}
|
||||
|
||||
public static MachineType getFromMetadata(int meta)
|
|
@ -218,7 +218,7 @@ public class Mekanism
|
|||
"ERA", "RDR", "ARS", Character.valueOf('E'), EnergyUpgrade, Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('D'), Item.diamond, Character.valueOf('S'), SpeedUpgrade
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(AtomicCore), new Object[] {
|
||||
"AOA", "PDP", "AOA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('O'), "dustObsidian", Character.valueOf('P'), new ItemStack(Dust, 1, 2), Character.valueOf('D'), Item.diamond
|
||||
"AOA", "PDP", "AOA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('O'), "dustObsidian", Character.valueOf('P'), "dustPlatinum", Character.valueOf('D'), Item.diamond
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(AtomicDisassembler.getUnchargedItem(), new Object[] {
|
||||
"AEA", "ACA", " O ", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('C'), AtomicCore, Character.valueOf('O'), "ingotObsidian"
|
||||
|
@ -242,7 +242,7 @@ public class Mekanism
|
|||
"EDE", "TAT", "EDE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('D'), Item.diamond, Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('A'), MekanismUtils.getEnergyCubeWithTier(EnergyCubeTier.ADVANCED)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ControlCircuit), new Object[] {
|
||||
" P ", "PEP", " P ", Character.valueOf('P'), new ItemStack(Ingot, 1, 1), Character.valueOf('E'), EnrichedAlloy
|
||||
" P ", "PEP", " P ", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('E'), EnrichedAlloy
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(EnrichedIron, 2), new Object[] {
|
||||
"A", "I", "A", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('I'), "dustIron"
|
||||
|
@ -275,11 +275,12 @@ public class Mekanism
|
|||
|
||||
//Furnace Recipes
|
||||
FurnaceRecipes.smelting().addSmelting(oreBlockID, 0, new ItemStack(Ingot, 1, 1), 1.0F);
|
||||
FurnaceRecipes.smelting().addSmelting(EnrichedIron.shiftedIndex, 0, new ItemStack(EnrichedAlloy), 1.0F);
|
||||
FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 2, new ItemStack(Ingot, 1, 1), 1.0F);
|
||||
FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 0, new ItemStack(Item.ingotIron), 1.0F);
|
||||
FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 1, new ItemStack(Item.ingotGold), 1.0F);
|
||||
FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 5, new ItemStack(Ingot, 1, 4), 1.0F);
|
||||
GameRegistry.addSmelting(Item.coal.shiftedIndex, new ItemStack(CompressedCarbon), 1.0F);
|
||||
GameRegistry.addSmelting(EnrichedIron.shiftedIndex, new ItemStack(EnrichedAlloy), 1.0F);
|
||||
|
||||
//Enrichment Chamber Recipes
|
||||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Dust, 1, 4), new ItemStack(Item.diamond));
|
||||
|
@ -288,7 +289,7 @@ public class Mekanism
|
|||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreIron), new ItemStack(Dust, 2, 0));
|
||||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreGold), new ItemStack(Dust, 2, 1));
|
||||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(EnrichedIron, 2), new ItemStack(Dust, 1, 2));
|
||||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Item.coal, 4), new ItemStack(CompressedCarbon));
|
||||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Item.coal, 4), new ItemStack(CompressedCarbon, 8));
|
||||
|
||||
//Platinum Compressor Recipes
|
||||
RecipeHandler.addPlatinumCompressorRecipe(new ItemStack(Item.redstone), new ItemStack(Ingot, 1, 2));
|
||||
|
@ -610,7 +611,7 @@ public class Mekanism
|
|||
try {
|
||||
for(ItemStack ore : OreDictionary.getOres("ingotCopper"))
|
||||
{
|
||||
RecipeHandler.addMetallurgicInfuserRecipe(Infusion.getInfusion(InfusionType.TIN, ore), OreDictionary.getOres("ingotBronze").get(0));
|
||||
RecipeHandler.addMetallurgicInfuserRecipe(Infusion.getInfusion(InfusionType.TIN, ore), MekanismUtils.getStackWithSize(OreDictionary.getOres("ingotBronze").get(0), 1));
|
||||
}
|
||||
} catch(Exception e) {}
|
||||
|
||||
|
@ -652,7 +653,6 @@ public class Mekanism
|
|||
GameRegistry.registerTileEntity(TileEntityPlatinumCompressor.class, "PlatinumCompressor");
|
||||
GameRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner");
|
||||
GameRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher");
|
||||
GameRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer");
|
||||
GameRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube");
|
||||
GameRegistry.registerTileEntity(TileEntityMulti.class, "Multi");
|
||||
GameRegistry.registerTileEntity(TileEntityControlPanel.class, "ControlPanel");
|
|
@ -2,6 +2,7 @@ package mekanism.common;
|
|||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import ic2.api.Ic2Recipes;
|
||||
import ic2.api.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.src.*;
|
||||
|
@ -48,7 +49,7 @@ public final class MekanismHooks
|
|||
if(Loader.isModLoaded("IC2")) IC2Loaded = true;
|
||||
if(Loader.isModLoaded("Railcraft")) RailcraftLoaded = true;
|
||||
if(Loader.isModLoaded("BasicComponents")) BasicComponentsLoaded = true;
|
||||
if(Loader.isModLoaded("BuildCraft")) BuildCraftLoaded = true;
|
||||
if(Loader.isModLoaded("BuildCraft|Energy")) BuildCraftLoaded = true;
|
||||
if(Loader.isModLoaded("Forestry")) ForestryLoaded = true;
|
||||
|
||||
if(IC2Loaded)
|
||||
|
@ -94,14 +95,13 @@ public final class MekanismHooks
|
|||
/**
|
||||
* Gets an object out of the class Ic2Items.
|
||||
* @param name - name of the item
|
||||
* @param test - whether or not this is a test
|
||||
* @return the object
|
||||
*/
|
||||
public ItemStack getIC2Item(String name)
|
||||
{
|
||||
try {
|
||||
if(Ic2Items == null) Ic2Items = Class.forName("ic2.common.Ic2Items");
|
||||
if(Ic2Items == null) Ic2Items = Class.forName("net.minecraft.src.ic2.common.Ic2Items");
|
||||
if(Ic2Items == null) Ic2Items = Class.forName("ic2.core.Ic2Items");
|
||||
if(Ic2Items == null) Ic2Items = Class.forName("net.minecraft.src.ic2.core.Ic2Items");
|
||||
Object ret = Ic2Items.getField(name).get(null);
|
||||
|
||||
if(ret instanceof ItemStack)
|
||||
|
@ -109,7 +109,7 @@ public final class MekanismHooks
|
|||
return (ItemStack)ret;
|
||||
}
|
||||
else {
|
||||
throw new Exception();
|
||||
throw new Exception("not instanceof ItemStack");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("[Mekanism] Unable to retrieve IC2 item " + name + ".");
|
||||
|
@ -129,10 +129,10 @@ public final class MekanismHooks
|
|||
return new ItemStack((Item)ret);
|
||||
}
|
||||
else {
|
||||
throw new Exception();
|
||||
throw new Exception("not instanceof ItemStack");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("[Mekanism] Unable to retrieve IC2 item " + name + ".");
|
||||
System.out.println("[Mekanism] Unable to retrieve BuildCraft item " + name + ".");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public final class MekanismHooks
|
|||
return new ItemStack((Item)ret);
|
||||
}
|
||||
else {
|
||||
throw new Exception();
|
||||
throw new Exception("not instanceof ItemStack");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("[Mekanism] Unable to retrieve Forestry item " + name + ".");
|
|
@ -1,7 +1,6 @@
|
|||
package mekanism.common;
|
||||
|
||||
import ic2.api.Direction;
|
||||
import ic2.api.energy.event.EnergyTileSinkEvent;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
@ -92,11 +91,6 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
registered = true;
|
||||
}
|
||||
|
||||
if(demandsEnergy())
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileSinkEvent(this, (int)((MAX_ELECTRICITY-electricityStored)*Mekanism.TO_IC2)));
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
for(ForgeDirection direction : ForgeDirection.values())
|
||||
|
@ -193,9 +187,15 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean demandsEnergy()
|
||||
public int getMaxSafeInput()
|
||||
{
|
||||
return electricityStored < currentMaxElectricity;
|
||||
return 2048;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int demandsEnergy()
|
||||
{
|
||||
return (int)((currentMaxElectricity - electricityStored)*Mekanism.TO_IC2);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -96,6 +96,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
|||
nbtTags.setDouble("electricityStored", electricityStored);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddedToEnergyNet()
|
||||
{
|
||||
return initialized;
|
|
@ -260,9 +260,9 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEn
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean demandsEnergy()
|
||||
public int demandsEnergy()
|
||||
{
|
||||
return electricityStored < tier.MAX_ELECTRICITY;
|
||||
return (int)((tier.MAX_ELECTRICITY - electricityStored)*Mekanism.TO_IC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -460,6 +460,12 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEn
|
|||
{
|
||||
PacketHandler.sendTileEntityPacketToClients(this, 50, facing, electricityStored, tier.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSafeInput()
|
||||
{
|
||||
return 2048;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStored(int energy)
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue