v5.4.0 Beta #1

Lots of things, too tired to list.
Will give full list when this build is released.
This commit is contained in:
Aidan Brady committed 2013-02-21 22:03:54 -05:00
1 parent d58222b028
commit 5cf1654733
66 files changed
+1378 -247

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

@@ -29,5 +29,5 @@ public interface IElectricMachine
/**
* Gets this machine's recipes.
*/
public HashMap getRecipes();
public Map getRecipes();
}
@@ -0,0 +1,6 @@
package mekanism.api;
public interface IPressurizedTube
{
public boolean canTransferGas();
}
@@ -54,12 +54,6 @@ public interface IStorageTank
*/
public int removeGas(ItemStack itemstack, EnumGas type, int amount);
/**
* Gets the divider that gets that returns the max damage as 100.
* @return divider
*/
public int getDivider();
/**
* Whether or not this storage tank be given a specific gas.
* @param itemstack - the itemstack to check
@@ -0,0 +1,8 @@
package mekanism.api;
import net.minecraftforge.common.ForgeDirection;
public interface ITubeConnection
{
public boolean canTubeConnect(ForgeDirection side);
}
@@ -4,6 +4,8 @@ public enum InfusionType
{
COAL("COAL"),
TIN("TIN"),
DIAMOND("DIAMOND"),
BIO("BIO"),
NONE("NONE");
public String name;
@@ -28,10 +28,10 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
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.glRotatef(180F, 0.0F, -1.0F, 0.0F);
GL11.glTranslated(0.0F, -0.8F, 0.0F);
GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/resources/mekanism/render/TheoreticalElementizer.png"));
theoreticalElementizer.render(0.0625F);
theoreticalElementizer.render(0.0560F);
}
else {
ForgeHooksClient.bindTexture(block.getTextureFile(), 0);
@@ -12,6 +12,7 @@ import mekanism.common.TileEntityElectricMachine;
import mekanism.common.TileEntityEnergyCube;
import mekanism.common.TileEntityGasTank;
import mekanism.common.TileEntityMetallurgicInfuser;
import mekanism.common.TileEntityPressurizedTube;
import mekanism.common.TileEntityPurificationChamber;
import mekanism.common.TileEntitySmeltingFactory;
import mekanism.common.TileEntityTeleporter;
@@ -50,6 +51,7 @@ import cpw.mods.fml.relauncher.Side;
public class ClientProxy extends CommonProxy
{
public static int RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
public static int TUBE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
@Override
public void loadConfiguration()
@@ -70,6 +72,7 @@ public class ClientProxy extends CommonProxy
public void registerSpecialTileEntities()
{
ClientRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer", new RenderTheoreticalElementizer());
ClientRegistry.registerTileEntity(TileEntityPressurizedTube.class, "PressurizedTube", new RenderPressurizedTube());
}
@Override
@@ -107,8 +110,9 @@ public class ClientProxy extends CommonProxy
//Register item handler
MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, new ItemRenderingHandler());
//Register block handler
//Register block handlers
RenderingRegistry.registerBlockHandler(new BlockRenderingHandler());
RenderingRegistry.registerBlockHandler(new PressurizedTubeRenderer());
System.out.println("[Mekanism] Render registrations complete.");
}
@@ -23,6 +23,8 @@ public class GuiAdvancedElectricMachine extends GuiContainer
{
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
fontRenderer.drawString("S:" + (tileEntity.speedMultiplier+1) + "x", 179, 47, 0x404040);
fontRenderer.drawString("E:" + (tileEntity.energyMultiplier+1) + "x", 179, 57, 0x404040);
}
@Override
@@ -23,6 +23,8 @@ public class GuiElectricMachine extends GuiContainer
{
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
fontRenderer.drawString("S:" + (tileEntity.speedMultiplier+1) + "x", 179, 47, 0x404040);
fontRenderer.drawString("E:" + (tileEntity.energyMultiplier+1) + "x", 179, 57, 0x404040);
}
@Override
@@ -43,6 +43,8 @@ public class GuiMetallurgicInfuser extends GuiContainer
{
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
fontRenderer.drawString("S:" + (tileEntity.speedMultiplier+1) + "x", 179, 47, 0x404040);
fontRenderer.drawString("E:" + (tileEntity.energyMultiplier+1) + "x", 179, 57, 0x404040);
}
@Override
@@ -55,10 +57,13 @@ public class GuiMetallurgicInfuser extends GuiContainer
guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
int infuseX = 176 + 26 + (tileEntity.type == InfusionType.TIN ? 0 : (tileEntity.type == InfusionType.BIO ? 8 : 4));
int infuseY = 52 + (tileEntity.type == InfusionType.COAL ? 0 : (tileEntity.type == InfusionType.BIO ? 0 : 52));
int displayInt;
displayInt = tileEntity.getScaledInfuseLevel(52);
drawTexturedModalRect(guiWidth + 7, guiHeight + 17 + 52 - displayInt, 176 + 26 + (tileEntity.type == InfusionType.COAL ? 4 : 0), 52 + (tileEntity.type == InfusionType.TIN ? 52 : 0) - displayInt, 4, displayInt);
drawTexturedModalRect(guiWidth + 7, guiHeight + 17 + 52 - displayInt, infuseX, infuseY - displayInt, 4, displayInt);
displayInt = tileEntity.getScaledProgress(32);
drawTexturedModalRect(guiWidth + 72, guiHeight + 47, 176 + 26, 52 + 52, displayInt + 1, 8);
@@ -24,6 +24,8 @@ public class GuiSmeltingFactory extends GuiContainer
{
fontRenderer.drawString(tileEntity.fullName, 34, 4, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 93) + 2, 0x404040);
fontRenderer.drawString("S:" + (tileEntity.speedMultiplier+1) + "x", 179, 47, 0x404040);
fontRenderer.drawString("E:" + (tileEntity.energyMultiplier+1) + "x", 179, 57, 0x404040);
}
@Override
@@ -0,0 +1,119 @@
package mekanism.client;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.ForgeDirection;
public class ModelPressurizedTube extends ModelBase {
ModelRenderer Center;
ModelRenderer Up;
ModelRenderer Down;
ModelRenderer Front;
ModelRenderer Back;
ModelRenderer Left;
ModelRenderer Right;
public ModelPressurizedTube()
{
textureWidth = 64;
textureHeight = 64;
Center = new ModelRenderer(this, 0, 0);
Center.addBox(0F, 0F, 0F, 6, 6, 6);
Center.setRotationPoint(-3F, 13F, -3F);
Center.setTextureSize(64, 64);
Center.mirror = true;
setRotation(Center, 0F, 0F, 0F);
Up = new ModelRenderer(this, 0, 13);
Up.addBox(0F, 0F, 0F, 6, 5, 6);
Up.setRotationPoint(-3F, 8F, -3F);
Up.setTextureSize(64, 64);
Up.mirror = true;
setRotation(Up, 0F, 0F, 0F);
Down = new ModelRenderer(this, 26, 13);
Down.addBox(0F, 0F, 0F, 6, 5, 6);
Down.setRotationPoint(-3F, 19F, -3F);
Down.setTextureSize(64, 64);
Down.mirror = true;
setRotation(Down, 0F, 0F, 0F);
Front = new ModelRenderer(this, 0, 26);
Front.addBox(0F, 0F, 0F, 5, 6, 6);
Front.setRotationPoint(-3F, 13F, -3F);
Front.setTextureSize(64, 64);
Front.mirror = true;
setRotation(Front, 0F, 1.570796F, 0F);
Back = new ModelRenderer(this, 0, 41);
Back.addBox(0F, 0F, 0F, 5, 6, 6);
Back.setRotationPoint(-3F, 13F, 8F);
Back.setTextureSize(64, 64);
Back.mirror = true;
setRotation(Back, 0F, 1.570796F, 0F);
Left = new ModelRenderer(this, 26, 0);
Left.addBox(0F, 0F, 0F, 6, 5, 6);
Left.setRotationPoint(3F, 19F, 3F);
Left.setTextureSize(64, 64);
Left.mirror = true;
setRotation(Left, 1.570796F, 1.570796F, 0F);
Right = new ModelRenderer(this, 26, 26);
Right.addBox(0F, 0F, 0F, 6, 5, 6);
Right.setRotationPoint(-8F, 19F, 3F);
Right.setTextureSize(64, 64);
Right.mirror = true;
setRotation(Right, 1.570796F, 1.570796F, 0F);
}
@Override
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);
Center.render(0.0625F);
for (ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
{
renderSide(orientation);
}
}
public void renderSide(ForgeDirection orientation)
{
switch (orientation)
{
case DOWN:
Down.render(0.0625F);
break;
case UP:
Up.render(0.0625F);
break;
case NORTH:
Back.render(0.0625F);
break;
case SOUTH:
Front.render(0.0625F);
break;
case WEST:
Right.render(0.0625F);
break;
case EAST:
Left.render(0.0625F);
break;
default:
return;
}
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float x, float y, float z, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(x, y, z, f3, f4, f5, entity);
}
}
@@ -162,6 +162,7 @@ public class ModelTheoreticalElementizer extends ModelBase
R.render(size);
}
@Override
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);
@@ -193,6 +194,7 @@ public class ModelTheoreticalElementizer extends ModelBase
model.rotateAngleZ = z;
}
@Override
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,44 @@
package mekanism.client;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class PressurizedTubeRenderer implements ISimpleBlockRenderingHandler
{
public ModelPressurizedTube pressurizedTube = new ModelPressurizedTube();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(180F, 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/PressurizedTube.png"));
pressurizedTube.Center.render(0.0625F);
pressurizedTube.Up.render(0.0625F);
pressurizedTube.Down.render(0.0625F);
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
return false;
}
@Override
public boolean shouldRender3DInInventory()
{
return true;
}
@Override
public int getRenderId()
{
return ClientProxy.TUBE_RENDER_ID;
}
}
@@ -0,0 +1,56 @@
package mekanism.client;
import java.util.Arrays;
import org.lwjgl.opengl.GL11;
import net.minecraftforge.common.ForgeDirection;
import mekanism.api.IGasAcceptor;
import mekanism.api.ITubeConnection;
import mekanism.common.MekanismUtils;
import mekanism.common.TileEntityPressurizedTube;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderPressurizedTube extends TileEntitySpecialRenderer
{
private ModelPressurizedTube model;
public RenderPressurizedTube()
{
model = new ModelPressurizedTube();
}
public void renderAModelAt(TileEntityPressurizedTube tileEntity, double d, double d1, double d2, float f)
{
bindTextureByName("/resources/mekanism/render/PressurizedTube.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
ITubeConnection[] connections = MekanismUtils.getConnections(tileEntity);
for(ITubeConnection connection : connections)
{
if(connection != null)
{
int side = Arrays.asList(connections).indexOf(connection);
if(connection.canTubeConnect(ForgeDirection.getOrientation(side).getOpposite()))
{
model.renderSide(ForgeDirection.getOrientation(side));
}
}
}
model.Center.render(0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8)
{
renderAModelAt((TileEntityPressurizedTube)tileEntity, var2, var4, var6, var8);
}
}
@@ -10,6 +10,7 @@ public class RenderTheoreticalElementizer extends TileEntitySpecialRenderer
{
private ModelTheoreticalElementizer model = new ModelTheoreticalElementizer();
@Override
public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8)
{
renderAModelAt((TileEntityTheoreticalElementizer) var1, var2, var4, var6, 1F);
@@ -31,7 +32,7 @@ public class RenderTheoreticalElementizer extends TileEntitySpecialRenderer
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);
GL11.glRotatef(270F, 0.0F, 1.0F, 0.0F);
model.render(0.0625F);
GL11.glPopMatrix();
}
@@ -5,7 +5,9 @@ import java.util.Collections;
import java.util.List;
import java.util.Random;
import mekanism.api.IActiveState;
import mekanism.common.TileEntityBasicMachine;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import paulscode.sound.SoundSystem;
import cpw.mods.fml.client.FMLClientHandler;
@@ -39,11 +41,28 @@ public class SoundHandler
{
synchronized(sounds)
{
ArrayList<Sound> soundsToRemove = new ArrayList<Sound>();
for(Sound sound : sounds)
{
if(FMLClientHandler.instance().getClient().thePlayer != null && FMLClientHandler.instance().getClient().theWorld != null)
{
sound.distanceUpdate(FMLClientHandler.instance().getClient().thePlayer);
TileEntity tileEntity = FMLClientHandler.instance().getClient().theWorld.getBlockTileEntity(sound.xCoord, sound.yCoord, sound.zCoord);
if(tileEntity != null && tileEntity instanceof IActiveState)
{
if(((IActiveState)tileEntity).getActive() != sound.isPlaying)
{
if(((IActiveState)tileEntity).getActive())
{
sound.play();
}
else {
sound.stopLoop();
}
}
}
}
}
@@ -4,9 +4,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thermalexpansion.api.core.IDismantleable;
import universalelectricity.core.implement.IItemElectric;
import universalelectricity.prefab.implement.IToolConfigurator;
@@ -40,7 +43,7 @@ import net.minecraftforge.common.ForgeDirection;
* @author AidanBrady
*
*/
public class BlockEnergyCube extends BlockContainer
public class BlockEnergyCube extends BlockContainer implements IDismantleable
{
private Random powerRand = new Random();
@@ -251,37 +254,78 @@ public class BlockEnergyCube extends BlockContainer
TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getBlockTileEntity(x, y, z);
int metadata = world.getBlockMetadata(x, y, z);
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
if(entityplayer.getCurrentEquippedItem() != null)
{
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 4;
break;
case 4:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 1;
break;
case 1:
change = 0;
break;
case 0:
change = 3;
break;
}
tileEntity.setFacing((short)change);
return true;
if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
{
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 1;
break;
case 1:
change = 0;
break;
case 0:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
else if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolWrench)
{
if(entityplayer.isSneaking())
{
dismantleBlock(world, x, y, z, false);
return true;
}
((IToolWrench)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 1;
break;
case 1:
change = 0;
break;
case 0:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
}
if (tileEntity != null)
@@ -348,4 +392,39 @@ public class BlockEnergyCube extends BlockContainer
return itemStack;
}
@Override
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
{
TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(Mekanism.EnergyCube);
IEnergyCube energyCube = (IEnergyCube)itemStack.getItem();
energyCube.setTier(itemStack, tileEntity.tier);
IItemElectric electricItem = (IItemElectric)itemStack.getItem();
electricItem.setJoules(tileEntity.electricityStored, itemStack);
world.setBlockWithNotify(x, y, z, 0);
if(!returnBlock)
{
float motion = 0.7F;
double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);
world.spawnEntityInWorld(entityItem);
}
return itemStack;
}
@Override
public boolean canDismantle(World world, int x, int y, int z)
{
return true;
}
}
+106 -8
View File
@@ -2,6 +2,12 @@ package mekanism.common;
import java.util.Random;
import thermalexpansion.api.core.IDismantleable;
import universalelectricity.prefab.implement.IToolConfigurator;
import buildcraft.api.tools.IToolWrench;
import mekanism.api.IUpgradeManagement;
import mekanism.common.BlockMachine.MachineType;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
@@ -16,7 +22,7 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockGasTank extends BlockContainer
public class BlockGasTank extends BlockContainer implements IDismantleable
{
public Random machineRand = new Random();
@@ -135,12 +141,75 @@ public class BlockGasTank extends BlockContainer
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
{
if(world.isRemote)
{
return true;
}
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z);
if(world.isRemote)
{
return true;
}
TileEntityGasTank tileEntity = (TileEntityGasTank)world.getBlockTileEntity(x, y, z);
int metadata = world.getBlockMetadata(x, y, z);
if(entityplayer.getCurrentEquippedItem() != null)
{
if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
{
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
else if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolWrench)
{
if(entityplayer.isSneaking())
{
dismantleBlock(world, x, y, z, false);
return true;
}
((IToolWrench)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
}
if (tileEntity != null)
{
@@ -150,8 +219,37 @@ public class BlockGasTank extends BlockContainer
return true;
}
}
return false;
return false;
}
@Override
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
{
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(Mekanism.GasTank);
world.setBlockWithNotify(x, y, z, 0);
if(!returnBlock)
{
float motion = 0.7F;
double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);
world.spawnEntityInWorld(entityItem);
}
return itemStack;
}
@Override
public boolean canDismantle(World world, int x, int y, int z)
{
return true;
}
@Override
public String getTextureFile()
+108 -28
View File
@@ -3,6 +3,9 @@ package mekanism.common;
import java.util.List;
import java.util.Random;
import buildcraft.api.tools.IToolWrench;
import thermalexpansion.api.core.IDismantleable;
import universalelectricity.core.implement.IItemElectric;
import universalelectricity.prefab.implement.IToolConfigurator;
@@ -43,7 +46,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* @author AidanBrady
*
*/
public class BlockMachine extends BlockContainer
public class BlockMachine extends BlockContainer implements IDismantleable
{
public Random machineRand = new Random();
@@ -483,31 +486,66 @@ public class BlockMachine extends BlockContainer
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
int metadata = world.getBlockMetadata(x, y, z);
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
if(entityplayer.getCurrentEquippedItem() != null)
{
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 4;
break;
case 4:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 3;
break;
}
tileEntity.setFacing((short)change);
return true;
if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
{
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
else if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolWrench)
{
if(entityplayer.isSneaking())
{
dismantleBlock(world, x, y, z, false);
return true;
}
((IToolWrench)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
}
if (tileEntity != null)
@@ -572,18 +610,24 @@ public class BlockMachine extends BlockContainer
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, new ItemStack(Mekanism.MachineBlock, 1, world.getBlockMetadata(x, y, z)));
IItemElectric electricItem = (IItemElectric)entityItem.getEntityItem().getItem();
electricItem.setJoules(tileEntity.electricityStored, entityItem.getEntityItem());
IUpgradeManagement upgrade = (IUpgradeManagement)entityItem.getEntityItem().getItem();
upgrade.setEnergyMultiplier(((IUpgradeManagement)tileEntity).getEnergyMultiplier(), entityItem.getEntityItem());
upgrade.setSpeedMultiplier(((IUpgradeManagement)tileEntity).getSpeedMultiplier(), entityItem.getEntityItem());
IItemElectric electricItem = (IItemElectric)entityItem.getEntityItem().getItem();
electricItem.setJoules(tileEntity.electricityStored, entityItem.getEntityItem());
world.spawnEntityInWorld(entityItem);
}
return world.setBlockWithNotify(x, y, z, 0);
}
@Override
public int idDropped(int i, Random random, int j)
{
return 0;
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
@@ -591,15 +635,51 @@ public class BlockMachine extends BlockContainer
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(Mekanism.MachineBlock, 1, world.getBlockMetadata(x, y, z));
IUpgradeManagement upgrade = (IUpgradeManagement)itemStack.getItem();
upgrade.setEnergyMultiplier(((IUpgradeManagement)tileEntity).getEnergyMultiplier(), itemStack);
upgrade.setSpeedMultiplier(((IUpgradeManagement)tileEntity).getSpeedMultiplier(), itemStack);
IItemElectric electricItem = (IItemElectric)itemStack.getItem();
electricItem.setJoules(tileEntity.electricityStored, itemStack);
return itemStack;
}
@Override
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
{
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(Mekanism.MachineBlock, 1, world.getBlockMetadata(x, y, z));
IUpgradeManagement upgrade = (IUpgradeManagement)itemStack.getItem();
upgrade.setEnergyMultiplier(((IUpgradeManagement)tileEntity).getEnergyMultiplier(), itemStack);
upgrade.setSpeedMultiplier(((IUpgradeManagement)tileEntity).getSpeedMultiplier(), itemStack);
IItemElectric electricItem = (IItemElectric)itemStack.getItem();
electricItem.setJoules(tileEntity.electricityStored, itemStack);
world.setBlockWithNotify(x, y, z, 0);
if(!returnBlock)
{
float motion = 0.7F;
double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);
world.spawnEntityInWorld(entityItem);
}
return itemStack;
}
@Override
public boolean canDismantle(World world, int x, int y, int z)
{
return true;
}
public static enum MachineType
{
@@ -0,0 +1,129 @@
package mekanism.common;
import java.util.Arrays;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mekanism.api.IGasAcceptor;
import mekanism.api.ITubeConnection;
import mekanism.client.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
public class BlockPressurizedTube extends Block
{
public BlockPressurizedTube(int id)
{
super(id, Material.iron);
setHardness(2.0F);
setResistance(5.0F);
setBlockBounds(0.3F, 0.3F, 0.3F, 0.7F, 0.7F, 0.7F);
setCreativeTab(Mekanism.tabMekanism);
blockIndexInTexture = 204;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
float minX = 0.3F;
float minY = 0.3F;
float minZ = 0.3F;
float maxX = 0.7F;
float maxY = 0.7F;
float maxZ = 0.7F;
if(tileEntity != null)
{
boolean[] connectable = new boolean[] {false, false, false, false, false, false};
ITubeConnection[] connections = MekanismUtils.getConnections(tileEntity);
for(ITubeConnection connection : connections)
{
if(connection != null)
{
int side = Arrays.asList(connections).indexOf(connection);
if(connection.canTubeConnect(ForgeDirection.getOrientation(side).getOpposite()))
{
connectable[side] = true;
}
}
}
if(connectable[0])
{
minY = 0.0F;
}
if(connectable[1])
{
maxY = 1.0F;
}
if(connectable[2])
{
minZ = 0.0F;
}
if(connectable[3])
{
maxZ = 1.0F;
}
if(connectable[4])
{
minX = 0.0F;
}
if(connectable[5])
{
maxX = 1.0F;
}
setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
}
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return ClientProxy.TUBE_RENDER_ID;
}
@Override
public boolean hasTileEntity(int metadata)
{
return true;
}
@Override
public TileEntity createTileEntity(World world, int metadata)
{
return new TileEntityPressurizedTube();
}
@Override
public String getTextureFile()
{
return "/resources/mekanism/textures/items.png";
}
}
@@ -25,6 +25,7 @@ public class CommonProxy
public void registerSpecialTileEntities()
{
GameRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer");
GameRegistry.registerTileEntity(TileEntityPressurizedTube.class, "PressurizedTube");
}
/**
@@ -64,6 +65,7 @@ public class CommonProxy
Mekanism.energyCubeID = Mekanism.configuration.getBlock("EnergyCube", 3004).getInt();
Mekanism.nullRenderID = Mekanism.configuration.getBlock("NullRender", 3005).getInt();
Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", 3006).getInt();
Mekanism.pressurizedTubeID = Mekanism.configuration.getBlock("PressurizedTube", 3007).getInt();
Mekanism.extrasEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ExtrasEnabled", true).getBoolean(true);
Mekanism.platinumGenerationEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PlatinumGenerationEnabled", true).getBoolean(true);
Mekanism.disableBCSteelCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCSteelCrafting", false).getBoolean(true);
@@ -23,9 +23,9 @@ public class EntityObsidianTNT extends Entity
{
this(par1World);
setPosition(par2, par4, par6);
float var8 = (float)(Math.random() * Math.PI * 2.0D);
float var8 = (float)(Math.random() * Math.PI * 2);
motionX = (double)(-((float)Math.sin((double)var8)) * 0.02F);
motionY = 0.20000000298023224D;
motionY = 0.2;
motionZ = (double)(-((float)Math.cos((double)var8)) * 0.02F);
fuse = Mekanism.ObsidianTNTDelay;
prevPosX = par2;
@@ -54,17 +54,17 @@ public class EntityObsidianTNT extends Entity
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
motionY -= 0.03999999910593033D;
motionY -= 0.04;
moveEntity(motionX, motionY, motionZ);
motionX *= 0.9800000190734863D;
motionY *= 0.9800000190734863D;
motionZ *= 0.9800000190734863D;
motionX *= 0.98;
motionY *= 0.98;
motionZ *= 0.98;
if (onGround)
{
motionX *= 0.699999988079071D;
motionZ *= 0.699999988079071D;
motionY *= -0.5D;
motionX *= 0.7;
motionZ *= 0.7;
motionY *= -0.5;
}
if (fuse-- <= 0)
@@ -27,6 +27,7 @@ public enum EnumColor
/** The color code that will be displayed */
public final String code;
/** A friendly name of the color. */
public String friendlyName;
private EnumColor(String s, String n)
@@ -0,0 +1,109 @@
package mekanism.common;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import mekanism.api.EnumGas;
import mekanism.api.IGasAcceptor;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
public class GasTransferProtocol
{
/** List of iterated tubes, to prevent infinite loops. */
public ArrayList<TileEntity> iteratedTubes = new ArrayList<TileEntity>();
/** List of IGasAcceptors that can take in the type of gas requested. */
public ArrayList<IGasAcceptor> availableAcceptors = new ArrayList<IGasAcceptor>();
/** Pointer of this calculation */
public TileEntity pointer;
/** Type of gas to distribute */
public EnumGas transferType;
/** Amount of gas to distribute */
public int gasToSend;
/**
* GasTransferProtocol -- a calculation used to distribute gasses through a tube network.
* @param head - pointer tile entity
* @param type - type of gas to distribute
* @param amount - amount of gas to distribute
*/
public GasTransferProtocol(TileEntity head, EnumGas type, int amount)
{
pointer = head;
transferType = type;
gasToSend = amount;
}
/**
* Recursive loop that iterates through connected tubes and adds connected acceptors to an ArrayList.
* @param tile - pointer tile entity
*/
public void loopThrough(TileEntity tile)
{
IGasAcceptor[] acceptors = MekanismUtils.getConnectedAcceptors(tile);
for(IGasAcceptor acceptor : acceptors)
{
if(acceptor != null)
{
if(acceptor.canReceiveGas(ForgeDirection.getOrientation(Arrays.asList(acceptors).indexOf(acceptor)).getOpposite(), transferType))
{
availableAcceptors.add(acceptor);
}
}
}
iteratedTubes.add(tile);
TileEntity[] tubes = MekanismUtils.getConnectedTubes(tile);
for(TileEntity tube : tubes)
{
if(tube != null)
{
if(!iteratedTubes.contains(tube))
{
loopThrough(tube);
}
}
}
}
/**
* Runs the protocol and distributes the gas.
* @return rejected gas
*/
public int calculate()
{
loopThrough(pointer);
if(!availableAcceptors.isEmpty())
{
boolean sentRemaining = false;
int divider = availableAcceptors.size();
int remaining = gasToSend % divider;
int sending = (gasToSend-remaining)/divider;
for(IGasAcceptor acceptor : availableAcceptors)
{
int currentSending = sending;
if(remaining > 0)
{
currentSending++;
remaining--;
}
acceptor.transferGasToAcceptor(currentSending, transferType);
gasToSend -= currentSending;
}
}
return gasToSend;
}
}
@@ -80,7 +80,7 @@ public class ItemAtomicDisassembler extends ItemEnergized
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if(!world.isRemote)
if(!world.isRemote && entityplayer.isSneaking())
{
incrementEfficiency(itemstack);
entityplayer.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Efficiency bumped to " + getEfficiency(itemstack));
@@ -8,7 +8,8 @@ import net.minecraft.item.ItemStack;
public class ItemDirtyDust extends ItemMekanism
{
public static String[] en_USNames = {"Iron", "Gold", "Platinum",
"Copper", "Tin", "Silver"};
"Copper", "Tin", "Silver",
"Obsidian"};
public ItemDirtyDust(int id)
{
@@ -28,6 +29,7 @@ public class ItemDirtyDust extends ItemMekanism
case 3: return 195;
case 4: return 196;
case 5: return 198;
case 6: return 193;
default: return 0;
}
}
@@ -35,7 +37,7 @@ public class ItemDirtyDust extends ItemMekanism
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
{
for (int counter = 0; counter <= 5; ++counter)
for (int counter = 0; counter <= 6; ++counter)
{
itemList.add(new ItemStack(this, 1, counter));
}
@@ -19,13 +19,9 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
/** How fast this tank can transfer gas. */
public int TRANSFER_RATE;
/** The number that, when the max amount of gas is divided by, will make it equal 100. */
public int DIVIDER;
public ItemStorageTank(int id, int maxGas, int transferRate, int divide)
public ItemStorageTank(int id, int maxGas, int transferRate)
{
super(id);
DIVIDER = divide;
MAX_GAS = maxGas;
TRANSFER_RATE = transferRate;
setMaxStackSize(1);
@@ -82,12 +78,12 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
stored = itemstack.stackTagCompound.getInteger("gas");
}
itemstack.setItemDamage((MAX_GAS - stored)/DIVIDER);
itemstack.setItemDamage((int)(Math.abs((((float)stored/MAX_GAS)*100)-100)));
return stored;
}
@Override
public void setGas(ItemStack itemstack, EnumGas type, int hydrogen)
public void setGas(ItemStack itemstack, EnumGas type, int amount)
{
if(itemstack.stackTagCompound == null)
{
@@ -101,9 +97,9 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
if(getGasType(itemstack) == type)
{
int stored = Math.max(Math.min(hydrogen, MAX_GAS), 0);
int stored = Math.max(Math.min(amount, MAX_GAS), 0);
itemstack.stackTagCompound.setInteger("gas", stored);
itemstack.setItemDamage((MAX_GAS - stored)/DIVIDER);
itemstack.setItemDamage((int)(Math.abs((((float)stored/MAX_GAS)*100)-100)));
}
if(getGas(itemstack) == 0)
@@ -169,20 +165,14 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
{
if(getGasType(itemstack) == type)
{
int hydrogenToUse = Math.min(getGas(itemstack), amount);
setGas(itemstack, type, getGas(itemstack) - hydrogenToUse);
return hydrogenToUse;
int gasToUse = Math.min(getGas(itemstack), amount);
setGas(itemstack, type, getGas(itemstack) - gasToUse);
return gasToUse;
}
return 0;
}
@Override
public int getDivider()
{
return DIVIDER;
}
@Override
public boolean canReceiveGas(ItemStack itemstack, EnumGas type)
{
+47 -19
View File
@@ -52,7 +52,7 @@ import cpw.mods.fml.server.FMLServerHandler;
* @author AidanBrady
*
*/
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.3.0")
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.4.0")
@NetworkMod(channels = {"Mekanism"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
public class Mekanism
{
@@ -74,7 +74,7 @@ public class Mekanism
public static Configuration configuration;
/** Mekanism version number */
public static Version versionNumber = new Version(5, 3, 0);
public static Version versionNumber = new Version(5, 4, 0);
/** Map of Teleporter info. */
public static Map<Teleporter.Code, ArrayList<Teleporter.Coords>> teleporters = new HashMap<Teleporter.Code, ArrayList<Teleporter.Coords>>();
@@ -112,6 +112,7 @@ public class Mekanism
public static int energyCubeID = 3004;
public static int nullRenderID = 3005;
public static int gasTankID = 3006;
public static int pressurizedTubeID = 3007;
//Extra Items
public static ItemElectricBow ElectricBow;
@@ -121,7 +122,6 @@ public class Mekanism
public static ItemEnergized EnergyTablet;
public static Item SpeedUpgrade;
public static Item EnergyUpgrade;
public static Item UltimateUpgrade;
public static ItemAtomicDisassembler AtomicDisassembler;
public static Item AtomicCore;
public static ItemStorageTank StorageTank;
@@ -140,6 +140,7 @@ public class Mekanism
public static Block EnergyCube;
public static BlockMulti NullRender;
public static Block GasTank;
public static Block PressurizedTube;
//MultiID Items
public static Item Dust;
@@ -236,13 +237,10 @@ public class Mekanism
"RLR", "CIC", "RLR", Character.valueOf('R'), Item.redstone, Character.valueOf('L'), Item.bucketLava, Character.valueOf('C'), "basicCircuit", Character.valueOf('I'), "blockSteel"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(SpeedUpgrade), new Object[] {
"PAP", "AEA", "PAP", Character.valueOf('P'), "dustPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), Item.emerald
" G ", "APA", " G ", Character.valueOf('P'), "dustPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('G'), Block.glass
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(EnergyUpgrade), new Object[] {
"RAR", "AEA", "RAR", Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyTablet.getUnchargedItem()
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(UltimateUpgrade), new Object[] {
"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
" G ", "ADA", " G ", Character.valueOf('G'), Block.glass, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('D'), "dustGold"
}));
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'), "dustPlatinum", Character.valueOf('D'), Item.diamond
@@ -260,7 +258,7 @@ public class Mekanism
"PPP", "PDP", "PPP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('D'), "dustIron"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(MekanismUtils.getEnergyCubeWithTier(EnergyCubeTier.BASIC), new Object[] {
"ELE", "TIT", "ELE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('L'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 5)
"ELE", "TIT", "ELE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('L'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('I'), "blockSteel"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(MekanismUtils.getEnergyCubeWithTier(EnergyCubeTier.ADVANCED), new Object[] {
"EGE", "TBT", "EGE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('G'), Item.ingotGold, Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('B'), MekanismUtils.getEnergyCubeWithTier(EnergyCubeTier.BASIC)
@@ -313,6 +311,9 @@ public class Mekanism
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BasicBlock, 4, 8), new Object[] {
"OOO", "OGO", "OOO", Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('G'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(PressurizedTube, 8), new Object[] {
"IAI", "PPP", "IAI", Character.valueOf('I'), Item.ingotIron, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('P'), "dustPlatinum"
}));
if(extrasEnabled)
{
@@ -329,16 +330,20 @@ public class Mekanism
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 5, new ItemStack(Ingot, 1, 4), 1.0F);
//Enrichment Chamber Recipes
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Dust, 1, 4), new ItemStack(Item.diamond));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreRedstone), new ItemStack(Item.redstone, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.obsidian), new ItemStack(Dust, 1, 3));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.obsidian), new ItemStack(DirtyDust, 1, 6));
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(Item.coal, 2), new ItemStack(CompressedCarbon));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Item.coal, 2), new ItemStack(CompressedCarbon, 4));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreLapis), new ItemStack(Item.dyePowder, 12, 4));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreRedstone), new ItemStack(Item.redstone, 12));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreCoal), new ItemStack(Block.oreCoal));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.oreDiamond), new ItemStack(Item.diamond, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.cobblestoneMossy), new ItemStack(Block.cobblestone));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.stone), new ItemStack(Block.stoneBrick, 1, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.stoneBrick, 1, 2), new ItemStack(Block.stoneBrick, 1, 0));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.stoneBrick, 1, 0), new ItemStack(Block.stoneBrick, 1, 3));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Block.stoneBrick, 1, 1), new ItemStack(Block.stoneBrick, 1, 0));
//Platinum Compressor Recipes
RecipeHandler.addPlatinumCompressorRecipe(new ItemStack(Item.lightStoneDust), new ItemStack(Ingot, 1, 3));
@@ -350,6 +355,9 @@ public class Mekanism
RecipeHandler.addCrusherRecipe(new ItemStack(Block.gravel), new ItemStack(Item.flint));
RecipeHandler.addCrusherRecipe(new ItemStack(Block.stone), new ItemStack(Block.cobblestone));
RecipeHandler.addCrusherRecipe(new ItemStack(Block.cobblestone), new ItemStack(Block.sand));
RecipeHandler.addCrusherRecipe(new ItemStack(Block.stoneBrick, 1, 2), new ItemStack(Block.stone));
RecipeHandler.addCrusherRecipe(new ItemStack(Block.stoneBrick, 1, 0), new ItemStack(Block.stoneBrick, 1, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Block.stoneBrick, 1, 3), new ItemStack(Block.stoneBrick, 1, 0));
//Purification Chamber Recipes
RecipeHandler.addPurificationChamberRecipe(new ItemStack(Block.oreIron), new ItemStack(Clump, 3, 0));
@@ -357,6 +365,8 @@ public class Mekanism
//Metallurgic Infuser Recipes
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfusionType.COAL, 10, new ItemStack(EnrichedIron)), new ItemStack(Dust, 1, 5));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfusionType.BIO, 10, new ItemStack(Block.cobblestone)), new ItemStack(Block.cobblestoneMossy));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfusionType.BIO, 10, new ItemStack(Block.stoneBrick, 1, 0)), new ItemStack(Block.stoneBrick, 1, 1));
infusions.put(new ItemStack(Item.coal, 1, 0), new InfuseObject(InfusionType.COAL, 10));
infusions.put(new ItemStack(Item.coal, 1, 1), new InfuseObject(InfusionType.COAL, 20));
@@ -382,7 +392,6 @@ public class Mekanism
LanguageRegistry.addName(EnergyTablet, "Energy Tablet");
LanguageRegistry.addName(SpeedUpgrade, "Speed Upgrade");
LanguageRegistry.addName(EnergyUpgrade, "Energy Upgrade");
LanguageRegistry.addName(UltimateUpgrade, "Ultimate Upgrade");
LanguageRegistry.addName(AtomicDisassembler, "Atomic Disassembler");
LanguageRegistry.addName(AtomicCore, "Atomic Core");
LanguageRegistry.addName(ElectricBow, "Electric Bow");
@@ -396,6 +405,7 @@ public class Mekanism
LanguageRegistry.addName(PortableTeleporter, "Portable Teleporter");
LanguageRegistry.addName(TeleportationCore, "Teleportation Core");
LanguageRegistry.addName(Configurator, "Configurator");
LanguageRegistry.addName(PressurizedTube, "Pressurized Tube");
//Localization for MultiBlock
LanguageRegistry.instance().addStringLocalization("tile.BasicBlock.PlatinumBlock.name", "Platinum Block");
@@ -432,7 +442,7 @@ public class Mekanism
LanguageRegistry.instance().addStringLocalization("item.ironDust.name", "Iron Dust");
LanguageRegistry.instance().addStringLocalization("item.goldDust.name", "Gold Dust");
LanguageRegistry.instance().addStringLocalization("item.platinumDust.name", "Platinum Dust");
LanguageRegistry.instance().addStringLocalization("item.obsidianDust.name", "Obsidian Dust");
LanguageRegistry.instance().addStringLocalization("item.obsidianDust.name", "Refined Obsidian Dust");
LanguageRegistry.instance().addStringLocalization("item.diamondDust.name", "Diamond Dust");
LanguageRegistry.instance().addStringLocalization("item.steelDust.name", "Steel Dust");
LanguageRegistry.instance().addStringLocalization("item.copperDust.name", "Copper Dust");
@@ -454,6 +464,7 @@ public class Mekanism
LanguageRegistry.instance().addStringLocalization("item.dirtyCopperDust.name", "Dirty Copper Dust");
LanguageRegistry.instance().addStringLocalization("item.dirtyTinDust.name", "Dirty Tin Dust");
LanguageRegistry.instance().addStringLocalization("item.dirtySilverDust.name", "Dirty Silver Dust");
LanguageRegistry.instance().addStringLocalization("item.dirtyObsidianDust.name", "Dirty Obsidian Dust");
//Localization for Ingot
LanguageRegistry.instance().addStringLocalization("item.obsidianIngot.name", "Obsidian Ingot");
@@ -481,7 +492,6 @@ public class Mekanism
EnergyTablet.setIconIndex(228);
SpeedUpgrade.setIconIndex(232);
EnergyUpgrade.setIconIndex(231);
UltimateUpgrade.setIconIndex(233);
AtomicDisassembler.setIconIndex(253);
AtomicCore.setIconIndex(254);
ElectricBow.setIconIndex(252);
@@ -511,11 +521,11 @@ public class Mekanism
EnergyTablet = (ItemEnergized) new ItemEnergized(configuration.getItem("EnergyTablet", 11206).getInt(), 600000, 800).setItemName("EnergyTablet");
SpeedUpgrade = new ItemMachineUpgrade(configuration.getItem("SpeedUpgrade", 11207).getInt(), 0, 150).setItemName("SpeedUpgrade");
EnergyUpgrade = new ItemMachineUpgrade(configuration.getItem("EnergyUpgrade", 11208).getInt(), 1000, 0).setItemName("EnergyUpgrade");
UltimateUpgrade = new ItemMachineUpgrade(configuration.getItem("UltimateUpgrade", 11209).getInt(), 2500, 180).setItemName("UltimateUpgrade");
//FREE ID 11209
AtomicDisassembler = (ItemAtomicDisassembler) new ItemAtomicDisassembler(configuration.getItem("AtomicDisassembler", 11210).getInt()).setItemName("AtomicDisassembler");
AtomicCore = new ItemMekanism(configuration.getItem("AtomicCore", 11211).getInt()).setItemName("AtomicCore");
EnrichedAlloy = new ItemMekanism(configuration.getItem("EnrichedAlloy", 11212).getInt()).setItemName("EnrichedAlloy");
StorageTank = (ItemStorageTank) new ItemStorageTank(configuration.getItem("StorageTank", 11213).getInt(), 1600, 16, 16).setItemName("StorageTank");
StorageTank = (ItemStorageTank) new ItemStorageTank(configuration.getItem("StorageTank", 11213).getInt(), 1600, 16).setItemName("StorageTank");
ControlCircuit = new ItemMekanism(configuration.getItem("ControlCircuit", 11214).getInt()).setItemName("ControlCircuit");
EnrichedIron = new ItemMekanism(configuration.getItem("EnrichedIron", 11215).getInt()).setItemName("EnrichedIron");
CompressedCarbon = new ItemMekanism(configuration.getItem("CompressedCarbon", 11216).getInt()).setItemName("CompressedCarbon");
@@ -540,11 +550,13 @@ public class Mekanism
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setBlockName("ObsidianTNT").setCreativeTab(tabMekanism);
NullRender = (BlockMulti) new BlockMulti(nullRenderID).setBlockName("NullRender");
GasTank = new BlockGasTank(gasTankID).setBlockName("GasTank");
PressurizedTube = new BlockPressurizedTube(pressurizedTubeID).setBlockName("PressurizedTube");
//Registrations
GameRegistry.registerBlock(ObsidianTNT, "ObsidianTNT");
GameRegistry.registerBlock(NullRender, "NullRender");
GameRegistry.registerBlock(GasTank, "GasTank");
GameRegistry.registerBlock(PressurizedTube, "PressurizedTube");
//Add block items into itemsList for blocks with common IDs.
Item.itemsList[basicBlockID] = new ItemBlockBasic(basicBlockID - 256, BasicBlock).setItemName("BasicBlock");
@@ -562,7 +574,7 @@ public class Mekanism
OreDictionary.registerOre("dustIron", new ItemStack(Dust, 1, 0));
OreDictionary.registerOre("dustGold", new ItemStack(Dust, 1, 1));
OreDictionary.registerOre("dustPlatinum", new ItemStack(Dust, 1, 2));
OreDictionary.registerOre("dustObsidian", new ItemStack(Dust, 1, 3));
OreDictionary.registerOre("dustRefinedObsidian", new ItemStack(Dust, 1, 3));
OreDictionary.registerOre("dustDiamond", new ItemStack(Dust, 1, 4));
OreDictionary.registerOre("dustSteel", new ItemStack(Dust, 1, 5));
OreDictionary.registerOre("dustCopper", new ItemStack(Dust, 1, 6));
@@ -588,6 +600,10 @@ public class Mekanism
OreDictionary.registerOre("dirtyDustCopper", new ItemStack(DirtyDust, 1, 3));
OreDictionary.registerOre("dirtyDustTin", new ItemStack(DirtyDust, 1, 4));
OreDictionary.registerOre("dirtyDustSilver", new ItemStack(DirtyDust, 1, 5));
OreDictionary.registerOre("dirtyDustObsidian", new ItemStack(DirtyDust, 1, 6));
//for railcraft
OreDictionary.registerOre("dustObsidian", new ItemStack(DirtyDust, 1, 6));
OreDictionary.registerOre("clumpIron", new ItemStack(Clump, 1, 0));
OreDictionary.registerOre("clumpGold", new ItemStack(Clump, 1, 1));
@@ -616,6 +632,12 @@ public class Mekanism
RecipeHandler.addCrusherRecipe(new ItemStack(Item.coal), hooks.IC2CoalDust);
}
for(ItemStack ore : OreDictionary.getOres("dustRefinedObsidian"))
{
RecipeHandler.addPlatinumCompressorRecipe(ore, new ItemStack(Ingot, 1, 0));
RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("clumpIron"))
{
RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 0));
@@ -785,7 +807,7 @@ public class Mekanism
for(ItemStack ore : OreDictionary.getOres("dustObsidian"))
{
RecipeHandler.addCombinerRecipe(ore, new ItemStack(Block.obsidian));
RecipeHandler.addPlatinumCompressorRecipe(ore, new ItemStack(Ingot, 1, 0));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfusionType.DIAMOND, 10, MekanismUtils.getStackWithSize(ore, 1)), new ItemStack(Dust, 1, 3));
}
for(ItemStack ore : OreDictionary.getOres("dustPlatinum"))
@@ -793,6 +815,12 @@ public class Mekanism
RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), new ItemStack(OreBlock, 1, 0));
}
for(ItemStack ore : OreDictionary.getOres("dustDiamond"))
{
infusions.put(ore, new InfuseObject(InfusionType.DIAMOND, 80));
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.getStackWithSize(ore, 1), new ItemStack(Item.diamond));
}
try {
for(ItemStack ore : OreDictionary.getOres("dustCopper"))
{
@@ -5,10 +5,18 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import universalelectricity.core.vector.Vector3;
import mekanism.api.EnumGas;
import mekanism.api.IActiveState;
import mekanism.api.IConfigurable;
import mekanism.api.IGasAcceptor;
import mekanism.api.IPressurizedTube;
import mekanism.api.ITubeConnection;
import mekanism.api.InfuseObject;
import mekanism.api.Tier.EnergyCubeTier;
import net.minecraft.entity.player.EntityPlayer;
@@ -303,6 +311,12 @@ public final class MekanismUtils
return hasResource;
}
/**
* Returns an integer facing that converts a world-based orientation to a machine-based oriention.
* @param side - world based
* @param blockFacing - what orientation the block is facing
* @return machine orientation
*/
public static int getBaseOrientation(int side, int blockFacing)
{
if(blockFacing == 3 || side == 1 || side == 0)
@@ -335,6 +349,11 @@ public final class MekanismUtils
return side;
}
/**
* Increments the output type of a machine's side.
* @param config - configurable machine
* @param side - side to increment output of
*/
public static void incrementOutput(IConfigurable config, int side)
{
int max = config.getSideData().size()-1;
@@ -350,6 +369,11 @@ public final class MekanismUtils
}
}
/**
* Gets the infuse object from an ItemStack.
* @param itemStack - itemstack to check
* @return infuse object
*/
public static InfuseObject getInfuseObject(ItemStack itemStack)
{
if(itemStack != null)
@@ -366,13 +390,120 @@ public final class MekanismUtils
return null;
}
/**
* Gets the operating ticks required for a machine via it's upgrades.
* @param multiplier - speed multiplier
* @return max operating ticks
*/
public static int getTicks(int multiplier)
{
return 200/(multiplier+1);
}
/**
* Gets the maximum energy for a machine via it's upgrades.
* @param multiplier - energy multiplier
* @param def - original, definitive max energy
* @return max energy
*/
public static double getEnergy(int multiplier, double def)
{
return def*(multiplier+1);
}
/**
* Gets all the tubes around a tile entity.
* @param tileEntity - center tile entity
* @return array of TileEntities
*/
public static TileEntity[] getConnectedTubes(TileEntity tileEntity)
{
TileEntity[] tubes = new TileEntity[] {null, null, null, null, null, null};
for(ForgeDirection orientation : ForgeDirection.values())
{
if(orientation != ForgeDirection.UNKNOWN)
{
TileEntity tube = Vector3.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation);
if(tube instanceof IPressurizedTube && ((IPressurizedTube)tube).canTransferGas())
{
tubes[orientation.ordinal()] = tube;
}
}
}
return tubes;
}
/**
* Gets all the acceptors around a tile entity.
* @param tileEntity - center tile entity
* @return array of IGasAcceptors
*/
public static IGasAcceptor[] getConnectedAcceptors(TileEntity tileEntity)
{
IGasAcceptor[] acceptors = new IGasAcceptor[] {null, null, null, null, null, null};
for(ForgeDirection orientation : ForgeDirection.values())
{
if(orientation != ForgeDirection.UNKNOWN)
{
TileEntity acceptor = Vector3.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation);
if(acceptor instanceof IGasAcceptor)
{
acceptors[orientation.ordinal()] = (IGasAcceptor)acceptor;
}
}
}
return acceptors;
}
/**
* Gets all the tube connections around a tile entity.
* @param tileEntity - center tile entity
* @return array of ITubeConnections
*/
public static ITubeConnection[] getConnections(TileEntity tileEntity)
{
ITubeConnection[] connections = new ITubeConnection[] {null, null, null, null, null, null};
for(ForgeDirection orientation : ForgeDirection.values())
{
if(orientation != ForgeDirection.UNKNOWN)
{
TileEntity connection = Vector3.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation);
if(connection instanceof ITubeConnection)
{
connections[orientation.ordinal()] = (ITubeConnection)connection;
}
}
}
return connections;
}
/**
* Emits a defined gas to the network.
* @param type - gas type to send
* @param amount - amount of gas to send
* @param sender - the sender of the gas
* @param facing - side the sender is outputting from
* @return rejected gas
*/
public static int emitGasToNetwork(EnumGas type, int amount, TileEntity sender, ForgeDirection facing)
{
TileEntity pointer = Vector3.getTileEntityFromSide(sender.worldObj, new Vector3(sender.xCoord, sender.yCoord, sender.zCoord), facing);
if(pointer != null)
{
GasTransferProtocol calculation = new GasTransferProtocol(pointer, type, amount);
return calculation.calculate();
}
return amount;
}
}
+7 -28
View File
@@ -5,6 +5,8 @@ import java.util.Random;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderEnd;
import net.minecraft.world.gen.ChunkProviderHell;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
@@ -13,37 +15,14 @@ public class OreHandler implements IWorldGenerator
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
if(!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd))
{
case 0:
generateSurface(world, random, chunkX*16, chunkZ*16);
}
}
/**
* Generate an ore in the overworld.
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
if(Mekanism.platinumGenerationEnabled == true)
{
for(int i=0;i<6;i++)
for(int i=0;i<12;i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosX = (chunkX*16) + random.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 0).itemID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i=0;i<2;i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 1).itemID, 6)).generate(world, random, randPosX, randPosY, randPosZ);
int randPosZ = (chunkZ*16) + random.nextInt(16);
(new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 0).itemID, 12)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
@@ -202,7 +202,7 @@ public class PacketHandler implements IPacketHandler
entityPlayerMP.playerNetServerHandler.setPlayerLocation(coords.xCoord+0.5, coords.yCoord, coords.zCoord+0.5, entityPlayerMP.rotationYaw, entityPlayerMP.rotationPitch);
entityplayer.worldObj.playSound(coords.xCoord, coords.yCoord, coords.zCoord, "mob.endermen.portal", 1.0F, 1.0F, true);
entityplayer.worldObj.playSoundAtEntity(entityplayer, "mob.endermen.portal", 1.0F, 1.0F);
PacketHandler.sendPortalFX(coords.xCoord, coords.yCoord, coords.zCoord, coords.dimensionId);
}
}
@@ -395,6 +395,13 @@ public class PacketHandler implements IPacketHandler
System.out.println("[Mekanism] Sent control panel packet to server.");
}
/**
* Sends a portal effect packet to all clients in a radius around a teleporter.
* @param x - x coordinate of teleporter
* @param y - y coordinate of teleporter
* @param z - z coordinate of teleporter
* @param id - dimension ID of teleporter
*/
public static void sendPortalFX(int x, int y, int z, int id)
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
@@ -418,6 +425,11 @@ public class PacketHandler implements IPacketHandler
System.out.println("[Mekanism] Sent portal FX packet to server.");
}
/**
* Sends a digit update for a portable teleporter to the server as an integer.
* @param index - digit index
* @param digit - digit to send
*/
public static void sendDigitUpdate(int index, int digit)
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
@@ -439,6 +451,11 @@ public class PacketHandler implements IPacketHandler
PacketDispatcher.sendPacketToServer(packet);
}
/**
* Sends a status update for a portable teleporter to the client as a string.
* @param entityplayer - player who is using the teleporter
* @param status - status to send
*/
public static void sendStatusUpdate(EntityPlayer entityplayer, int status)
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
@@ -147,7 +147,7 @@ public final class RecipeHandler
PURIFICATION_CHAMBER(new HashMap<ItemStack, ItemStack>()),
METALLURGIC_INFUSER(new HashMap<InfusionInput, InfusionOutput>());
private HashMap recipes;
private Map recipes;
private Recipe(HashMap map)
{
@@ -159,7 +159,7 @@ public final class RecipeHandler
recipes.put(input, output);
}
public HashMap get()
public Map get()
{
return recipes;
}
+19 -3
View File
@@ -22,6 +22,17 @@ public class Teleporter
return new Coords(tileEntity.xCoord, tileEntity.yCoord+1, tileEntity.zCoord, tileEntity.worldObj.provider.dimensionId);
}
@Override
public int hashCode()
{
int code = 1;
code = 31 * code + xCoord;
code = 31 * code + yCoord;
code = 31 * code + zCoord;
code = 31 * code + dimensionId;
return code;
}
@Override
public boolean equals(Object coords)
{
@@ -43,11 +54,16 @@ public class Teleporter
digitThree = three;
digitFour = four;
}
@Override
public int hashCode()
public int hashCode()
{
return Integer.parseInt(1 + "" + digitOne + "" + digitTwo + "" + digitThree + "" + digitFour);
int code = 1;
code = 31 * code + digitOne;
code = 31 * code + digitTwo;
code = 31 * code + digitThree;
code = 31 * code + digitFour;
return code;
}
@Override
@@ -16,7 +16,7 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
}
@Override
public HashMap getRecipes()
public Map getRecipes()
{
return Recipe.COMBINER.get();
}
@@ -14,7 +14,7 @@ public class TileEntityCrusher extends TileEntityElectricMachine
}
@Override
public HashMap getRecipes()
public Map getRecipes()
{
return Recipe.CRUSHER.get();
}
@@ -14,7 +14,7 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
}
@Override
public HashMap getRecipes()
public Map getRecipes()
{
return Recipe.ENRICHMENT_CHAMBER.get();
}
@@ -4,6 +4,7 @@ import mekanism.api.EnumGas;
import mekanism.api.IGasAcceptor;
import mekanism.api.IGasStorage;
import mekanism.api.IStorageTank;
import mekanism.api.ITubeConnection;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -15,7 +16,7 @@ import universalelectricity.core.vector.Vector3;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityGasTank extends TileEntityContainerBlock implements IGasStorage, IGasAcceptor
public class TileEntityGasTank extends TileEntityContainerBlock implements IGasStorage, IGasAcceptor, ITubeConnection
{
/** The type of gas stored in this tank. */
public EnumGas gasType;
@@ -107,6 +108,8 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
if(gasStored > 0 && !worldObj.isRemote)
{
setGas(gasType, gasStored - (Math.min(gasStored, output) - MekanismUtils.emitGasToNetwork(gasType, Math.min(gasStored, output), this, ForgeDirection.getOrientation(facing))));
TileEntity tileEntity = Vector3.getTileEntityFromSide(worldObj, new Vector3(this), ForgeDirection.getOrientation(facing));
if(tileEntity instanceof IGasAcceptor)
@@ -196,7 +199,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
@Override
public boolean canReceiveGas(ForgeDirection side, EnumGas type)
{
return (type == gasType || gasType == EnumGas.NONE) && (side != ForgeDirection.getOrientation(facing) && side != ForgeDirection.getOrientation(0) && side != ForgeDirection.getOrientation(1));
return (type == gasType || gasType == EnumGas.NONE) && side != ForgeDirection.getOrientation(facing);
}
@Override
@@ -243,4 +246,10 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
{
PacketHandler.sendTileEntityPacketToClients(this, 50, facing, gasStored, gasType.name);
}
@Override
public boolean canTubeConnect(ForgeDirection side)
{
return true;
}
}
@@ -15,7 +15,7 @@ public class TileEntityPlatinumCompressor extends TileEntityAdvancedElectricMach
}
@Override
public HashMap getRecipes()
public Map getRecipes()
{
return Recipe.PLATINUM_COMPRESSOR.get();
}
@@ -0,0 +1,31 @@
package mekanism.common;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mekanism.api.IPressurizedTube;
import mekanism.api.ITubeConnection;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
public class TileEntityPressurizedTube extends TileEntity implements IPressurizedTube, ITubeConnection
{
@Override
public boolean canTransferGas()
{
return true;
}
@Override
public boolean canTubeConnect(ForgeDirection side)
{
return true;
}
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox()
{
return INFINITE_EXTENT_AABB;
}
}
@@ -1,6 +1,7 @@
package mekanism.common;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -12,19 +13,18 @@ import mekanism.api.EnumGas;
import mekanism.api.IGasAcceptor;
import mekanism.api.IGasStorage;
import mekanism.api.IStorageTank;
import mekanism.api.ITubeConnection;
import mekanism.common.RecipeHandler.Recipe;
public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine implements IGasAcceptor, IGasStorage
public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine implements IGasAcceptor, IGasStorage, ITubeConnection
{
public int oxygenStored;
public TileEntityPurificationChamber()
{
super("PurificationChamber.ogg", "Purification Chamber", "/resources/mekanism/gui/GuiPurificationChamber.png", 30, 1, 200, 12000, 1200);
}
@Override
public HashMap getRecipes()
public Map getRecipes()
{
return Recipe.PURIFICATION_CHAMBER.get();
}
@@ -117,4 +117,10 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
super.handleSecondaryFuel();
}
@Override
public boolean canTubeConnect(ForgeDirection side)
{
return true;
}
}
@@ -44,8 +44,10 @@ public class TileEntitySmeltingFactory extends TileEntityElectricBlock implement
/** This Smelting Factory's tier. */
public SmeltingFactoryTier tier;
/** This machine's side configuration. */
public byte[] sideConfig;
/** An arraylist of SideData for this machine. */
public ArrayList<SideData> sideOutputs = new ArrayList<SideData>();
/** The Sound instance for this machine. */
@@ -61,12 +63,16 @@ public class TileEntitySmeltingFactory extends TileEntityElectricBlock implement
/** How much energy each operation consumes per tick. */
public int ENERGY_PER_TICK = 16;
/** This machine's speed multiplier. */
public int speedMultiplier;
/** This machine's energy multiplier. */
public int energyMultiplier;
/** How long it takes this machine to install an upgrade. */
public int UPGRADE_TICKS_REQUIRED = 40;
/** How many upgrade ticks have progressed. */
public int upgradeTicks;
/** This machine's previous active state, used for calculating packets. */
@@ -41,7 +41,10 @@ import net.minecraftforge.common.ForgeDirection;
public class TileEntityTeleporter extends TileEntityElectricBlock implements IEnergySink, IJouleStorage, IVoltage, IPeripheral
{
/** This teleporter's frequency. */
public Teleporter.Code code;
/** This teleporter's current status. */
public String status = (EnumColor.DARK_RED + "Not ready.");
public TileEntityTeleporter()
@@ -5,8 +5,12 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectricMachine
{
@@ -82,4 +86,11 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
if(random == 1) return Mekanism.WeatherOrb;
return Mekanism.EnrichedAlloy;
}
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox()
{
return INFINITE_EXTENT_AABB;
}
}
@@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import buildcraft.api.tools.IToolWrench;
import mekanism.api.IActiveState;
import mekanism.api.IEnergyCube;
import mekanism.common.Mekanism;
@@ -26,6 +28,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import thermalexpansion.api.core.IDismantleable;
import universalelectricity.core.implement.IItemElectric;
import universalelectricity.core.vector.Vector3;
import universalelectricity.prefab.implement.IToolConfigurator;
@@ -44,7 +47,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* @author AidanBrady
*
*/
public class BlockGenerator extends BlockContainer
public class BlockGenerator extends BlockContainer implements IDismantleable
{
public Random machineRand = new Random();
@@ -434,6 +437,9 @@ public class BlockGenerator extends BlockContainer
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, new ItemStack(MekanismGenerators.Generator, 1, 5));
IItemElectric electricItem = (IItemElectric)entityItem.getEntityItem().getItem();
electricItem.setJoules(tileEntity.electricityStored, entityItem.getEntityItem());
world.spawnEntityInWorld(entityItem);
}
@@ -458,31 +464,66 @@ public class BlockGenerator extends BlockContainer
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
int metadata = world.getBlockMetadata(x, y, z);
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
if(entityplayer.getCurrentEquippedItem() != null)
{
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 4;
break;
case 4:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 3;
break;
}
tileEntity.setFacing((short)change);
return true;
if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolConfigurator)
{
((IToolConfigurator)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
else if(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolWrench)
{
if(entityplayer.isSneaking())
{
dismantleBlock(world, x, y, z, false);
return true;
}
((IToolWrench)entityplayer.getCurrentEquippedItem().getItem()).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
return true;
}
}
if(metadata == 3 && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().isItemEqual(new ItemStack(MekanismGenerators.Generator, 1, 2)))
@@ -523,16 +564,9 @@ public class BlockGenerator extends BlockContainer
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
public int idDropped(int i, Random random, int j)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if(metadata != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta)
{
ret.add(new ItemStack(blockID, 1, metadata));
}
return ret;
return 0;
}
@Override
@@ -578,7 +612,7 @@ public class BlockGenerator extends BlockContainer
@Override
public boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z)
{
if(!player.capabilities.isCreativeMode && !world.isRemote && canHarvestBlock(player, world.getBlockMetadata(x, y, z)))
if(!player.capabilities.isCreativeMode && !world.isRemote && canHarvestBlock(player, world.getBlockMetadata(x, y, z)) && world.getBlockMetadata(x, y, z) != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta)
{
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
@@ -610,6 +644,38 @@ public class BlockGenerator extends BlockContainer
return itemStack;
}
@Override
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
{
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z));
IItemElectric electricItem = (IItemElectric)itemStack.getItem();
electricItem.setJoules(tileEntity.electricityStored, itemStack);
world.setBlockWithNotify(x, y, z, 0);
if(!returnBlock)
{
float motion = 0.7F;
double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);
world.spawnEntityInWorld(entityItem);
}
return itemStack;
}
@Override
public boolean canDismantle(World world, int x, int y, int z)
{
return true;
}
public static enum GeneratorType
{
HEAT_GENERATOR(0, 0, 160000, TileEntityHeatGenerator.class, true),
@@ -95,13 +95,6 @@ public class ContainerBioGenerator extends Container
}
}
}
else if(slotStack.itemID == Item.bucketEmpty.itemID)
{
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
{
return null;
}
}
else {
if(slotID >= 2 && slotID <= 28)
{
@@ -96,13 +96,6 @@ public class ContainerHeatGenerator extends Container
}
}
}
else if(slotStack.itemID == Item.bucketEmpty.itemID)
{
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
{
return null;
}
}
else {
if(slotID >= 2 && slotID <= 28)
{
@@ -1,5 +1,7 @@
package mekanism.generators.common;
import mekanism.api.InfuseObject;
import mekanism.api.InfusionType;
import mekanism.common.ItemMekanism;
import mekanism.common.Mekanism;
import mekanism.common.RecipeHandler;
@@ -20,7 +22,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.3.0", dependencies = "required-after:Mekanism")
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.4.0", dependencies = "required-after:Mekanism")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MekanismGenerators
{
@@ -108,6 +110,8 @@ public class MekanismGenerators
{
RecipeHandler.addCrusherRecipe(new ItemStack(Block.sapling, 1, i), new ItemStack(BioFuel, 2));
}
Mekanism.infusions.put(new ItemStack(BioFuel), new InfuseObject(InfusionType.BIO, 5));
}
public void addNames()
@@ -11,6 +11,7 @@ import mekanism.api.EnumGas;
import mekanism.api.IGasAcceptor;
import mekanism.api.IGasStorage;
import mekanism.api.IStorageTank;
import mekanism.api.ITubeConnection;
import mekanism.common.LiquidSlot;
import mekanism.common.Mekanism;
import mekanism.common.MekanismUtils;
@@ -44,7 +45,7 @@ import com.google.common.io.ByteArrayDataInput;
import dan200.computer.api.IComputerAccess;
import dan200.computer.api.IPeripheral;
public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IGasStorage, IEnergySink, IJouleStorage, IVoltage, ITankContainer, IPeripheral
public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IGasStorage, IEnergySink, IJouleStorage, IVoltage, ITankContainer, IPeripheral, ITubeConnection
{
public LiquidSlot waterSlot = new LiquidSlot(24000, 9);
@@ -242,6 +243,8 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(outputType != EnumGas.NONE && getGas(outputType) > 0 && !worldObj.isRemote)
{
setGas(outputType, getGas(outputType) - (Math.min(getGas(outputType), output) - MekanismUtils.emitGasToNetwork(outputType, Math.min(getGas(outputType), output), this, ForgeDirection.getOrientation(facing))));
TileEntity tileEntity = Vector3.getTileEntityFromSide(worldObj, new Vector3(this), ForgeDirection.getOrientation(facing));
if(tileEntity instanceof IGasAcceptor)
@@ -627,4 +630,10 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
{
return 120;
}
@Override
public boolean canTubeConnect(ForgeDirection side)
{
return side == ForgeDirection.getOrientation(facing);
}
}
@@ -18,6 +18,7 @@ import mekanism.common.Mekanism;
import mekanism.common.TileEntityElectricBlock;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.MinecraftForge;
import universalelectricity.core.electricity.ElectricInfo;
@@ -371,4 +372,11 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
{
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox()
{
return INFINITE_EXTENT_AABB;
}
}
@@ -44,6 +44,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan
/** The amount of electricity this machine can produce with a unit of fuel. */
public final int GENERATION = 80;
/** All the liquid fuels this generator runs on. */
public static Map<Integer, Integer> fuels = new HashMap<Integer, Integer>();
public TileEntityHeatGenerator()
@@ -11,8 +11,11 @@ import mekanism.api.InfusionOutput;
import mekanism.api.InfusionType;
import mekanism.client.GuiMetallurgicInfuser;
import mekanism.common.Mekanism;
import mekanism.common.MekanismUtils;
import mekanism.common.TileEntityMetallurgicInfuser;
import mekanism.common.RecipeHandler.Recipe;
import mekanism.generators.common.MekanismGenerators;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
@@ -55,9 +58,67 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
return "mekanism.infuser";
}
public int getInfuseX(InfusionType type)
{
switch(type)
{
case COAL:
return 4;
case TIN:
return 0;
case DIAMOND:
return 4;
case BIO:
return 8;
default:
return 0;
}
}
public int getInfuseY(InfusionType type)
{
switch(type)
{
case COAL:
return 0;
case TIN:
return 52;
case DIAMOND:
return 52;
case BIO:
return 0;
default:
return 0;
}
}
public InfusionType getFromFuel(ItemStack itemStack)
{
if(MekanismUtils.getInfuseObject(itemStack) != null)
{
return MekanismUtils.getInfuseObject(itemStack).type;
}
return null;
}
public ItemStack getInfuseStack(InfusionType type)
{
return type == InfusionType.COAL ? new ItemStack(Mekanism.CompressedCarbon) : new ItemStack(Mekanism.Dust, 1, 7);
switch(type)
{
case COAL:
return new ItemStack(Mekanism.CompressedCarbon);
case TIN:
return new ItemStack(Mekanism.Dust, 1, 7);
case DIAMOND:
return new ItemStack(Mekanism.Dust, 1, 4);
case BIO:
try {
return new ItemStack(MekanismGenerators.BioFuel);
} catch(Throwable t) {}
default:
return null;
}
}
public Set<Entry<InfusionInput, InfusionOutput>> getRecipes()
@@ -70,24 +131,24 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
guimanager.bindTextureByName(getGuiTexture());
guimanager.drawTexturedModalRect(0, 0, 5, 5, 166, 78);
guimanager.drawTexturedModalRect(0, 0, 5, 15, 166, 56);
}
@Override
public void drawExtras(GuiContainerManager guimanager, int i)
{
float f = ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F;
drawProgressBar(guimanager, 67, 42, 176 + 26, 104, 32, 8, f, 0);
drawProgressBar(guimanager, 67, 32, 176 + 26, 104, 32, 8, f, 0);
f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F;
if(ticksPassed < 20) f = 0.0F;
int infuseX = 176 + 26 + (getOtherStacks(i).get(0).item.isItemEqual(new ItemStack(Mekanism.CompressedCarbon)) ? 4 : 0);
int infuseY = getOtherStacks(i).get(0).item.isItemEqual(new ItemStack(Mekanism.CompressedCarbon)) ? 0 : 52;
int infuseX = 176 + 26 + getInfuseX(getFromFuel(getOtherStacks(i).get(0).item));
int infuseY = getInfuseY(getFromFuel(getOtherStacks(i).get(0).item));
drawProgressBar(guimanager, 2, 12, infuseX, infuseY, 4, 52, f, 3);
drawProgressBar(guimanager, 2, 2, infuseX, infuseY, 4, 52, f, 3);
f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F;
drawProgressBar(guimanager, 160, 12, 176 + 26, 0, 4, 52, f, 3);
drawProgressBar(guimanager, 160, 2, 176 + 26, 0, 4, 52, f, 3);
}
@Override
@@ -100,7 +161,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
@Override
public void loadTransferRects()
{
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(67, 42, 32, 8), getRecipeId(), new Object[0]));
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(67, 32, 32, 8), getRecipeId(), new Object[0]));
}
@Override
@@ -121,7 +182,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
@Override
public int recipiesPerPage()
{
return 1;
return 2;
}
@Override
@@ -175,9 +236,9 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
public CachedIORecipe(ItemStack input, ItemStack output, ItemStack infuse)
{
super();
inputStack = new PositionedStack(input, 46, 38);
outputStack = new PositionedStack(output, 104, 38);
infuseStack = new PositionedStack(infuse, 12, 30);
inputStack = new PositionedStack(input, 46, 28);
outputStack = new PositionedStack(output, 104, 28);
infuseStack = new PositionedStack(infuse, 12, 20);
}
public CachedIORecipe(Map.Entry recipe, ItemStack infuse)
@@ -1,5 +1,6 @@
package mekanism.nei;
import mekanism.common.Mekanism;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
@@ -20,6 +21,8 @@ public class NEIMekanismConfig implements IConfigureNEI
API.registerUsageHandler(new MetallurgicInfuserRecipeHandler());
API.registerRecipeHandler(new PurificationChamberRecipeHandler());
API.registerUsageHandler(new PurificationChamberRecipeHandler());
API.hideItem(Mekanism.nullRenderID);
}
@Override
@@ -31,6 +34,6 @@ public class NEIMekanismConfig implements IConfigureNEI
@Override
public String getVersion()
{
return "1.0.1";
return "1.0.2";
}
}
@@ -26,7 +26,7 @@ import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.3.0", dependencies = "required-after:Mekanism")
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.4.0", dependencies = "required-after:Mekanism")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MekanismTools
{
@@ -207,31 +207,31 @@ public class MekanismTools
"XYZ", " T ", " T ", Character.valueOf('X'), GlowstoneAxe, Character.valueOf('Y'), GlowstonePickaxe, Character.valueOf('Z'), GlowstoneSpade, Character.valueOf('T'), Item.stick
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstonePickaxe, 1), new Object[] {
"XXX", " T ", " T ", Character.valueOf('X'), "ingotGlowstone", Character.valueOf('T'), Item.stick
"XXX", " T ", " T ", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Item.stick
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneAxe, 1), new Object[] {
"XX", "XT", " T", Character.valueOf('X'), "ingotGlowstone", Character.valueOf('T'), Item.stick
"XX", "XT", " T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Item.stick
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneSpade, 1), new Object[] {
"X", "T", "T", Character.valueOf('X'), "ingotGlowstone", Character.valueOf('T'), Item.stick
"X", "T", "T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Item.stick
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneHoe, 1), new Object[] {
"XX", " T", " T", Character.valueOf('X'), "ingotGlowstone", Character.valueOf('T'), Item.stick
"XX", " T", " T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Item.stick
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneSword, 1), new Object[] {
"X", "X", "T", Character.valueOf('X'), "ingotGlowstone", Character.valueOf('T'), Item.stick
"X", "X", "T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Item.stick
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneHelmet, 1), new Object[] {
"***", "* *", Character.valueOf('*'), "ingotGlowstone"
"***", "* *", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneBody, 1), new Object[] {
"* *", "***", "***", Character.valueOf('*'), "ingotGlowstone"
"* *", "***", "***", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneLegs, 1), new Object[] {
"***", "* *", "* *", Character.valueOf('*'), "ingotGlowstone"
"***", "* *", "* *", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(GlowstoneBoots, 1), new Object[] {
"* *", "* *", Character.valueOf('*'), "ingotGlowstone"
"* *", "* *", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
//Lazuli