Added back Theoretical Elementizer

This commit is contained in:
Timo Ley 2022-10-09 13:17:14 +02:00
parent 9c403319c9
commit 2019c3e20a
19 changed files with 441 additions and 3 deletions

0
gradlew vendored Normal file → Executable file
View file

Binary file not shown.

Binary file not shown.

View file

@ -163,4 +163,11 @@ public class MekanismConfig
{
public static double armorSpawnRate;
}
public static class theoreticalelementizer //TODO better config for elementizer (maybe MineTweaker support?)
{
public static String[] items;
public static int failChanceMultiplier;
public static String fuel;
}
}

View file

@ -60,6 +60,7 @@ import mekanism.client.gui.GuiSeismicVibrator;
import mekanism.client.gui.GuiSideConfiguration;
import mekanism.client.gui.GuiSolarNeutronActivator;
import mekanism.client.gui.GuiTeleporter;
import mekanism.client.gui.GuiTheoreticalElementizer;
import mekanism.client.gui.GuiThermalEvaporationController;
import mekanism.client.gui.GuiThermoelectricBoiler;
import mekanism.client.gui.GuiTransporterConfig;
@ -108,6 +109,7 @@ import mekanism.client.render.tileentity.RenderSecurityDesk;
import mekanism.client.render.tileentity.RenderSeismicVibrator;
import mekanism.client.render.tileentity.RenderSolarNeutronActivator;
import mekanism.client.render.tileentity.RenderTeleporter;
import mekanism.client.render.tileentity.RenderTheoreticalElementizer;
import mekanism.client.render.tileentity.RenderThermalEvaporationController;
import mekanism.client.render.tileentity.RenderThermoelectricBoiler;
import mekanism.common.CommonProxy;
@ -183,6 +185,7 @@ import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.tile.TileEntitySolarNeutronActivator;
import mekanism.common.tile.TileEntityStructuralGlass;
import mekanism.common.tile.TileEntityTeleporter;
import mekanism.common.tile.TileEntityTheoreticalElementizer;
import mekanism.common.tile.TileEntityThermalEvaporationController;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@ -327,6 +330,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.registerTileEntity(TileEntityBoilerValve.class, "BoilerValve", new RenderThermoelectricBoiler());
ClientRegistry.registerTileEntity(TileEntitySecurityDesk.class, "SecurityDesk", new RenderSecurityDesk());
ClientRegistry.registerTileEntity(TileEntityQuantumEntangloporter.class, "QuantumEntangloporter", new RenderQuantumEntangloporter());
ClientRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer", new RenderTheoreticalElementizer());
GameRegistry.registerTileEntity(TileEntityFuelwoodHeater.class, "FuelwoodHeater");
}
@ -380,7 +384,6 @@ public class ClientProxy extends CommonProxy
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
switch(ID)
{
case 0:
@ -527,6 +530,8 @@ public class ClientProxy extends CommonProxy
return new GuiSecurityDesk(player.inventory, (TileEntitySecurityDesk)tileEntity);
case 58:
return new GuiFuelwoodHeater(player.inventory, (TileEntityFuelwoodHeater)tileEntity);
case 60:
return new GuiTheoreticalElementizer(player.inventory, (TileEntityTheoreticalElementizer) tileEntity);
}
return null;

View file

@ -0,0 +1,45 @@
package mekanism.client.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mekanism.api.EnumColor;
import mekanism.api.gas.GasStack;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.tile.TileEntityTheoreticalElementizer;
import net.minecraft.entity.player.InventoryPlayer;
@SideOnly(Side.CLIENT)
public class GuiTheoreticalElementizer extends GuiAdvancedElectricMachine //TODO implement specific GUI
{
public GuiTheoreticalElementizer(final InventoryPlayer inventory, final TileEntityTheoreticalElementizer tentity) {
super(inventory, tentity);
}
@Override
protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String displayText = "";
if (super.tileEntity.isActive) {
displayText = "Status: " + (int)(super.tileEntity.operatingTicks / (float)super.tileEntity.ticksRequired * 100.0f) + "%";
}
else {
displayText = "Status: " + EnumColor.DARK_RED + "Off";
}
this.fontRendererObj.drawString(displayText, 80, 60, 4210752);
}
@Override
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, GasStack gas)
{
if(gas == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, gas.getGas().getIcon(), sizeX, sizeY);
}
}

View file

@ -0,0 +1,175 @@
package mekanism.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
@SideOnly(Side.CLIENT)
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() {
super.textureWidth = 128;
super.textureHeight = 128;
(this.A = new ModelRenderer((ModelBase)this, 0, 0)).addBox(-8.0f, 0.0f, -8.0f, 16, 1, 16);
this.A.setRotationPoint(0.0f, 23.0f, 0.0f);
this.A.setTextureSize(64, 32);
this.A.mirror = true;
this.setRotation(this.A, 0.0f, 0.0f, 0.0f);
(this.B = new ModelRenderer((ModelBase)this, 0, 40)).addBox(-5.0f, 0.0f, -4.0f, 10, 10, 8);
this.B.setRotationPoint(0.0f, 13.0f, 0.0f);
this.B.setTextureSize(64, 32);
this.B.mirror = true;
this.setRotation(this.B, 0.0f, 0.0f, 0.0f);
(this.C = new ModelRenderer((ModelBase)this, 0, 19)).addBox(-3.0f, 0.0f, -3.0f, 6, 14, 6);
this.C.setRotationPoint(0.0f, 8.0f, 0.0f);
this.C.setTextureSize(64, 32);
this.C.mirror = true;
this.setRotation(this.C, 0.0f, 0.0f, 0.0f);
(this.DROT = new ModelRenderer((ModelBase)this, 5, 0)).addBox(-1.0f, -1.0f, -1.0f, 2, 2, 2);
this.DROT.setRotationPoint(0.0f, 5.0f, 0.0f);
this.DROT.setTextureSize(64, 32);
this.DROT.mirror = true;
this.setRotation(this.DROT, 0.7853982f, 0.7853982f, 0.7853982f);
(this.E = new ModelRenderer((ModelBase)this, 65, 0)).addBox(-2.0f, 0.0f, 2.0f, 4, 8, 7);
this.E.setRotationPoint(0.0f, 15.0f, 0.0f);
this.E.setTextureSize(64, 32);
this.E.mirror = true;
this.setRotation(this.E, 0.0f, 0.7853982f, 0.0f);
(this.F = new ModelRenderer((ModelBase)this, 65, 0)).addBox(-2.0f, 0.0f, 2.0f, 4, 8, 7);
this.F.setRotationPoint(0.0f, 15.0f, 0.0f);
this.F.setTextureSize(64, 32);
this.F.mirror = true;
this.setRotation(this.F, 0.0f, -0.7853982f, 0.0f);
(this.G = new ModelRenderer((ModelBase)this, 0, 0)).addBox(6.0f, 0.0f, 0.0f, 1, 4, 1);
this.G.setRotationPoint(0.0f, 19.0f, -2.0f);
this.G.setTextureSize(64, 32);
this.G.mirror = true;
this.setRotation(this.G, 0.0f, 0.0f, 0.0f);
(this.H = new ModelRenderer((ModelBase)this, 0, 6)).addBox(5.0f, 0.0f, 0.0f, 1, 1, 1);
this.H.setRotationPoint(0.0f, 19.0f, -2.0f);
this.H.setTextureSize(64, 32);
this.H.mirror = true;
this.setRotation(this.H, 0.0f, 0.0f, 0.0f);
(this.I = new ModelRenderer((ModelBase)this, 0, 6)).addBox(5.0f, 0.0f, 0.0f, 1, 1, 1);
this.I.setRotationPoint(0.0f, 19.0f, 0.0f);
this.I.setTextureSize(64, 32);
this.I.mirror = true;
this.setRotation(this.I, 0.0f, 0.0f, 0.0f);
(this.J = new ModelRenderer((ModelBase)this, 0, 0)).addBox(6.0f, 0.0f, 0.0f, 1, 4, 1);
this.J.setRotationPoint(0.0f, 19.0f, 0.0f);
this.J.setTextureSize(64, 32);
this.J.mirror = true;
this.setRotation(this.J, 0.0f, 0.0f, 0.0f);
(this.K = new ModelRenderer((ModelBase)this, 21, 61)).addBox(0.0f, -1.0f, -4.0f, 2, 9, 5);
this.K.setRotationPoint(-7.0f, 15.0f, 1.0f);
this.K.setTextureSize(64, 32);
this.K.mirror = true;
this.setRotation(this.K, 0.0f, 0.0f, 0.0f);
(this.L = new ModelRenderer((ModelBase)this, 21, 77)).addBox(0.0f, -1.0f, -1.0f, 1, 2, 2);
this.L.setRotationPoint(-8.0f, 16.0f, 0.0f);
this.L.setTextureSize(64, 32);
this.L.mirror = true;
this.setRotation(this.L, 0.0f, 0.0f, 0.0f);
(this.M = new ModelRenderer((ModelBase)this, 0, 61)).addBox(-4.0f, 0.0f, 0.0f, 8, 10, 0);
this.M.setRotationPoint(0.0f, 3.0f, 0.0f);
this.M.setTextureSize(64, 32);
this.M.mirror = true;
this.setRotation(this.M, 0.0f, 0.7853982f, 0.0f);
(this.N = new ModelRenderer((ModelBase)this, 0, 73)).addBox(-4.0f, 0.0f, 0.0f, 8, 10, 0);
this.N.setRotationPoint(0.0f, 3.0f, 0.0f);
this.N.setTextureSize(64, 32);
this.N.mirror = true;
this.setRotation(this.N, 0.0f, -0.7853982f, 0.0f);
(this.O = new ModelRenderer((ModelBase)this, 0, 93)).addBox(-5.0f, -5.0f, 0.0f, 6, 6, 0);
this.O.setRotationPoint(0.0f, 6.0f, 0.0f);
this.O.setTextureSize(64, 32);
this.O.mirror = true;
this.setRotation(this.O, 0.0f, -0.7853982f, 0.7853982f);
(this.P = new ModelRenderer((ModelBase)this, 0, 85)).addBox(-5.0f, -5.0f, 0.0f, 6, 6, 0);
this.P.setRotationPoint(0.0f, 6.0f, 0.0f);
this.P.setTextureSize(64, 32);
this.P.mirror = true;
this.setRotation(this.P, 0.0f, 0.7853982f, 0.7853982f);
(this.Q = new ModelRenderer((ModelBase)this, 65, 17)).addBox(-4.0f, 0.0f, 0.0f, 8, 6, 4);
this.Q.setRotationPoint(0.0f, 17.0f, -8.0f);
this.Q.setTextureSize(64, 32);
this.Q.mirror = true;
this.setRotation(this.Q, 0.0f, 0.0f, 0.0f);
(this.R = new ModelRenderer((ModelBase)this, 65, 28)).addBox(-4.0f, 0.0f, 0.0f, 8, 3, 5);
this.R.setRotationPoint(0.0f, 17.0f, -8.0f);
this.R.setTextureSize(64, 32);
this.R.mirror = true;
this.setRotation(this.R, 0.5934119f, 0.0f, 0.0f);
}
public void render(final float size) {
this.A.render(size);
this.B.render(size);
this.C.render(size);
this.DROT.render(size);
this.E.render(size);
this.F.render(size);
this.G.render(size);
this.H.render(size);
this.I.render(size);
this.J.render(size);
this.K.render(size);
this.L.render(size);
this.M.render(size);
this.N.render(size);
this.O.render(size);
this.P.render(size);
this.Q.render(size);
this.R.render(size);
}
public void render(final Entity entity, final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
super.render(entity, f, f1, f2, f3, f4, f5);
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.A.render(f5);
this.B.render(f5);
this.C.render(f5);
this.DROT.render(f5);
this.E.render(f5);
this.F.render(f5);
this.G.render(f5);
this.H.render(f5);
this.I.render(f5);
this.J.render(f5);
this.K.render(f5);
this.L.render(f5);
this.M.render(f5);
this.N.render(f5);
this.O.render(f5);
this.P.render(f5);
this.Q.render(f5);
this.R.render(f5);
}
private void setRotation(final ModelRenderer model, final float x, final float y, final float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -106,6 +106,7 @@ public class MekanismRenderer
GasRegistry.getGas("sulfuricAcid").setIcon(event.map.registerIcon("mekanism:liquid/LiquidSulfuricAcid"));
GasRegistry.getGas("hydrogenChloride").setIcon(event.map.registerIcon("mekanism:liquid/LiquidHydrogenChloride"));
GasRegistry.getGas("liquidOsmium").setIcon(event.map.registerIcon("mekanism:liquid/LiquidOsmium"));
GasRegistry.getGas("elementizerFuel").setIcon(event.map.registerIcon("mekanism:liquid/LiquidOsmium")); //TODO specific Icon
GasRegistry.getGas("liquidStone").setIcon(event.map.registerIcon("mekanism:liquid/LiquidStone"));
GasRegistry.getGas("ethene").setIcon(event.map.registerIcon("mekanism:liquid/LiquidEthene"));
GasRegistry.getGas("brine").setIcon(event.map.registerIcon("mekanism:liquid/LiquidBrine"));

View file

@ -21,6 +21,7 @@ import mekanism.client.model.ModelResistiveHeater;
import mekanism.client.model.ModelRotaryCondensentrator;
import mekanism.client.model.ModelSeismicVibrator;
import mekanism.client.model.ModelSolarNeutronActivator;
import mekanism.client.model.ModelTheoreticalElementizer;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.util.MekanismUtils;
@ -61,6 +62,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
public ModelSolarNeutronActivator solarNeutronActivator = new ModelSolarNeutronActivator();
public ModelResistiveHeater resistiveHeater = new ModelResistiveHeater();
public ModelQuantumEntangloporter quantumEntangloporter = new ModelQuantumEntangloporter();
public ModelTheoreticalElementizer theoreticalElementizer = new ModelTheoreticalElementizer();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
@ -243,6 +245,13 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "QuantumEntangloporter.png"));
quantumEntangloporter.render(0.0625F, mc.renderEngine);
}
else if (type == MachineType.THEORETICAL_ELEMENTIZER) {
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(180.0F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "TheoreticalElementizer.png"));
theoreticalElementizer.render(0.0625F);
}
else {
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
MekanismRenderer.renderItem(renderer, metadata, block);

View file

@ -0,0 +1,57 @@
package mekanism.client.render.tileentity;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mekanism.client.model.ModelTheoreticalElementizer;
import mekanism.common.tile.TileEntityTheoreticalElementizer;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
@SideOnly(Side.CLIENT)
public class RenderTheoreticalElementizer extends TileEntitySpecialRenderer
{
private ModelTheoreticalElementizer model;
public RenderTheoreticalElementizer() {
this.model = new ModelTheoreticalElementizer();
}
@Override
public void renderTileEntityAt(final TileEntity tileEntity, final double x, final double y, final double z, final float partialTick) {
this.renderAModelAt((TileEntityTheoreticalElementizer)tileEntity, x, y, z, partialTick);
}
private void renderAModelAt(final TileEntityTheoreticalElementizer tileEntity, final double x, final double y, final double z, final float partialTick) {
GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5f, (float)y + 1.5f, (float)z + 0.5f);
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "TheoreticalElementizer.png"));
switch (tileEntity.facing) {
case 2: {
GL11.glRotatef(270.0f, 0.0f, 1.0f, 0.0f);
break;
}
case 3: {
GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
break;
}
case 4: {
GL11.glRotatef(0.0f, 0.0f, 1.0f, 0.0f);
break;
}
case 5: {
GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
break;
}
}
GL11.glRotatef(180.0f, 0.0f, 1.0f, 1.0f);
GL11.glRotatef(90.0f, -1.0f, 0.0f, 0.0f);
GL11.glRotatef(270.0f, 0.0f, 1.0f, 0.0f);
this.model.render(0.0625f);
GL11.glPopMatrix();
}
}

View file

@ -7,6 +7,7 @@ import mekanism.api.Coord4D;
import mekanism.api.MekanismAPI;
import mekanism.api.MekanismConfig.general;
import mekanism.api.MekanismConfig.machines;
import mekanism.api.MekanismConfig.theoreticalelementizer;
import mekanism.api.MekanismConfig.usage;
import mekanism.api.Pos3D;
import mekanism.api.util.UnitDisplayUtils.EnergyType;
@ -118,6 +119,7 @@ import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.tile.TileEntitySolarNeutronActivator;
import mekanism.common.tile.TileEntityStructuralGlass;
import mekanism.common.tile.TileEntityTeleporter;
import mekanism.common.tile.TileEntityTheoreticalElementizer;
import mekanism.common.tile.TileEntityThermalEvaporationController;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
@ -212,6 +214,7 @@ public class CommonProxy implements IGuiProvider
GameRegistry.registerTileEntity(TileEntitySecurityDesk.class, "SecurityDesk");
GameRegistry.registerTileEntity(TileEntityQuantumEntangloporter.class, "QuantumEntangloporter");
GameRegistry.registerTileEntity(TileEntityFuelwoodHeater.class, "FuelwoodHeater");
GameRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer");
}
public void handleTeleporterUpdate(PortableTeleporterMessage message) {}
@ -394,6 +397,10 @@ public class CommonProxy implements IGuiProvider
usage.heavyWaterElectrolysisUsage = Mekanism.configuration.get("usage", "HeavyWaterElectrolysisUsage", 800D).getDouble();
usage.formulaicAssemblicatorUsage = Mekanism.configuration.get("usage", "FormulaicAssemblicatorUsage", 100D).getDouble();
theoreticalelementizer.items = Mekanism.configuration.get("theoreticalelementizer", "Items", new String[]{}).getStringList();
theoreticalelementizer.failChanceMultiplier = Mekanism.configuration.get("theoreticalelementizer", "FailChanceMultiplier", 1).getInt();
theoreticalelementizer.fuel = Mekanism.configuration.get("theoreticalelementizer", "FuelItem", "minecraft:diamond").getString();
Tier.loadConfig();
if(Mekanism.configuration.hasChanged())
@ -586,6 +593,8 @@ public class CommonProxy implements IGuiProvider
return new ContainerSecurityDesk(player.inventory, (TileEntitySecurityDesk)tileEntity);
case 58:
return new ContainerFuelwoodHeater(player.inventory, (TileEntityFuelwoodHeater)tileEntity);
case 60:
return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityTheoreticalElementizer)tileEntity);
}
return null;

View file

@ -506,6 +506,10 @@ public class Mekanism
MachineType.FUELWOOD_HEATER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 6), new Object[] {
"SCS", "FHF", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('F'), Blocks.furnace, Character.valueOf('H'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
}));
MachineType.THEORETICAL_ELEMENTIZER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 7), new Object[] {
"AGA", "GDG", "AGA", Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('G'), "blockGlass", Character.valueOf('D'), "blockDiamond"
}));
//Energy Cube recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), new Object[] {
@ -1161,6 +1165,7 @@ public class Mekanism
GasRegistry.register(new Gas("hydrogenChloride")).registerFluid();
GasRegistry.register(new Gas("liquidOsmium").setVisible(false));
GasRegistry.register(new Gas("liquidStone").setVisible(false));
GasRegistry.register(new Gas("elementizerFuel").setVisible(false));
GasRegistry.register(new Gas("ethene").registerFluid());
GasRegistry.register(new Gas("sodium").registerFluid());
GasRegistry.register(new Gas("brine").registerFluid());

View file

@ -82,6 +82,7 @@ import mekanism.common.tile.TileEntityRotaryCondensentrator;
import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.tile.TileEntitySolarNeutronActivator;
import mekanism.common.tile.TileEntityTeleporter;
import mekanism.common.tile.TileEntityTheoreticalElementizer;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.PipeUtils;
@ -622,7 +623,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
if(tileEntity != null)
{
MachineType type = MachineType.get(blockType, metadata);
switch(type)
{
case PERSONAL_CHEST:
@ -1225,7 +1225,8 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
OREDICTIONIFICATOR(MachineBlock.MACHINE_BLOCK_3, 3, "Oredictionificator", 52, TileEntityOredictionificator.class, false, false, false),
RESISTIVE_HEATER(MachineBlock.MACHINE_BLOCK_3, 4, "ResistiveHeater", 53, TileEntityResistiveHeater.class, true, true, false),
FORMULAIC_ASSEMBLICATOR(MachineBlock.MACHINE_BLOCK_3, 5, "FormulaicAssemblicator", 56, TileEntityFormulaicAssemblicator.class, true, false, true),
FUELWOOD_HEATER(MachineBlock.MACHINE_BLOCK_3, 6, "FuelwoodHeater", 58, TileEntityFuelwoodHeater.class, false, false, false);
FUELWOOD_HEATER(MachineBlock.MACHINE_BLOCK_3, 6, "FuelwoodHeater", 58, TileEntityFuelwoodHeater.class, false, false, false),
THEORETICAL_ELEMENTIZER(MachineBlock.MACHINE_BLOCK_3, 7, "TheoreticalElementizer", 60, TileEntityTheoreticalElementizer.class, true, true, false);
public MachineBlock typeBlock;
public int meta;
@ -1396,6 +1397,8 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
return 100;
case FORMULAIC_ASSEMBLICATOR:
return usage.formulaicAssemblicatorUsage;
case THEORETICAL_ELEMENTIZER:
return 20000.0;
default:
return 0;
}

View file

@ -0,0 +1,15 @@
package mekanism.common.recipe.machines;
public class TheoreticalElementizerRecipe extends AdvancedMachineRecipe<TheoreticalElementizerRecipe> {
public TheoreticalElementizerRecipe() {
super(null, null);
}
@Override
public TheoreticalElementizerRecipe copy() {
return new TheoreticalElementizerRecipe();
}
}

View file

@ -0,0 +1,104 @@
package mekanism.common.tile;
import java.util.HashMap;
import java.util.Random;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mekanism.api.MekanismConfig;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasRegistry;
import mekanism.api.gas.GasStack;
import mekanism.common.MekanismItems;
import mekanism.common.block.BlockMachine;
import mekanism.common.recipe.machines.TheoreticalElementizerRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectricMachine<TheoreticalElementizerRecipe> {
private static Item[] items = null;
private static Item fuelItem = null;
public TileEntityTheoreticalElementizer() {
super("elementizer", "TheoreticalElementizer", 24, 1, 1000, BlockMachine.MachineType.THEORETICAL_ELEMENTIZER.baseEnergy);
MAX_GAS = 1000;
if (items == null) {
items = new Item[MekanismConfig.theoreticalelementizer.items.length];
for (int i = 0; i < items.length; i++) {
String[] parts = MekanismConfig.theoreticalelementizer.items[i].split(":");
items[i] = GameRegistry.findItem(parts[0], parts[1]);
}
}
if (fuelItem == null) {
String[] parts = MekanismConfig.theoreticalelementizer.fuel.split(":");
fuelItem = GameRegistry.findItem(parts[0], parts[1]);
}
}
@Override
public HashMap getRecipes() {
return new HashMap();
}
@Override
public boolean canOperate(TheoreticalElementizerRecipe recipe) {
return super.inventory[0] != null && super.inventory[2] == null;
}
@Override
public void operate(TheoreticalElementizerRecipe recipe) {
if (!this.canOperate(recipe)) {
return;
}
final ItemStack itemstack = new ItemStack(getRandomMagicItem());
final ItemStack itemStack = super.inventory[0];
--itemStack.stackSize;
if (super.inventory[0].stackSize <= 0) {
super.inventory[0] = null;
}
super.inventory[2] = itemstack;
}
@Override
public GasStack getItemGas(ItemStack itemstack) {
if (itemstack.getItem() == fuelItem) {
return new GasStack(GasRegistry.getGas("elementizerFuel"), 1000);
}
return null;
}
@Override
public boolean isValidGas(Gas gas) {
return false;
}
@Override
public TheoreticalElementizerRecipe getRecipe()
{
return null;
}
public static Item getRandomMagicItem() {
int range = items.length + MekanismConfig.theoreticalelementizer.failChanceMultiplier;
int index = 0;
if (range > 0) {
final Random rand = new Random();
index = rand.nextInt(range);
}
if (index < items.length) {
return items[index];
}
return MekanismItems.EnrichedAlloy;
}
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
}

View file

@ -158,6 +158,7 @@ tile.MachineBlock3.Oredictionificator.name=Oredictionificator
tile.MachineBlock3.ResistiveHeater.name=Resistive Heater
tile.MachineBlock3.FormulaicAssemblicator.name=Formulaic Assemblicator
tile.MachineBlock3.FuelwoodHeater.name=Fuelwood Heater
tile.MachineBlock3.TheoreticalElementizer.name=Theoretical Elementizer
//Plastic
tile.PlasticBlock.name=Plastic Block
@ -293,6 +294,7 @@ gas.sulfuricAcid=Sulfuric Acid
gas.hydrogenChloride=Hydrogen Chloride
gas.liquidOsmium=Liquid Osmium
gas.liquidStone=Liquid Stone
gas.elementizerFuel=Elementizer Fuel
gas.ethene=Ethylene
gas.sodium=Sodium
gas.brine=Gaseous Brine

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -38,6 +38,7 @@
"tile.machine.laser": {"category": "block", "sounds": [{"name": "Laser", "stream": false}]},
"tile.machine.fusionreactor": {"category": "block", "sounds": [{"name": "FusionReactor", "stream": false}]},
"tile.machine.resistiveheater": {"category": "block", "sounds": [{"name": "ResistiveHeater", "stream": false}]},
"tile.machine.elementizer": {"category": "block", "sounds": [{"name": "Elementizer", "stream": false}]},
"tile.christmas.1": {"category": "block", "sounds": [{"name": "holiday/Nutcracker1", "stream": false}]},
"tile.christmas.2": {"category": "block", "sounds": [{"name": "holiday/Nutcracker2", "stream": false}]},