v5.5.4 Beta #1
*Refactored API, removing core interfaces and adding more descriptive javadocs. MDK users, be prepared to update. *Fixed differing progress not being recognized. *Fixed Theoretical Elementizer displaying incorrect progress. *Made IGasStorage work in both items and blocks -- IStorageTank extends this now. *Better storage tank code. *Loads of reformatting and added missing javadocs.
This commit is contained in:
parent
83b16c594b
commit
dcb5fac394
|
@ -1,7 +1,7 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* The gasses currently available in Mekanism.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,11 @@ import java.util.Collections;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* The actual protocol gas goes through when it is transferred via Pressurized Tubes.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class GasTransferProtocol
|
||||
{
|
||||
/** List of iterated tubes, to prevent infinite loops. */
|
||||
|
|
|
@ -5,6 +5,11 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
|
||||
/**
|
||||
* A handy class containing several utilities for efficient gas transfer.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class GasTransmission
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,17 @@ package mekanism.api;
|
|||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this if your TileEntity is capable of outputting energy to cables, overriding Mekanism's default implementation.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface ICableOutputter
|
||||
{
|
||||
/**
|
||||
* Whether or not this block can output to a cable on a specific side.
|
||||
* @param side - side to check
|
||||
* @return if the block can output
|
||||
*/
|
||||
public boolean canOutputTo(ForgeDirection side);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,11 @@ package mekanism.api;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Implement this if your TileEntity is capable of being modified by a Configurator in it's 'modify' mode.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IConfigurable
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
* Implement this if your tile entity can store some form of gas.
|
||||
* Implement this if your tile entity can store some form of gas. If you want your item to store gas, implement IStorageTank
|
||||
* instead.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -10,21 +11,24 @@ public interface IGasStorage
|
|||
/**
|
||||
* Get the gas of a declared type.
|
||||
* @param type - type of gas
|
||||
* @param data - ItemStack parameter if necessary
|
||||
* @return gas stored
|
||||
*/
|
||||
public int getGas(EnumGas type);
|
||||
public int getGas(EnumGas type, Object... data);
|
||||
|
||||
/**
|
||||
* Set the gas of a declared type to a new amount;
|
||||
* @param type - type of gas
|
||||
* @param data - ItemStack parameter if necessary
|
||||
* @param amount - amount to store
|
||||
*/
|
||||
public void setGas(EnumGas type, int amount);
|
||||
public void setGas(EnumGas type, int amount, Object... data);
|
||||
|
||||
/**
|
||||
* Gets the maximum amount of gas this tile entity can store.
|
||||
* @param type - type of gas
|
||||
* @param data - ItemStack parameter if necessary
|
||||
* @return maximum gas
|
||||
*/
|
||||
public int getMaxGas(EnumGas type);
|
||||
public int getMaxGas(EnumGas type, Object... data);
|
||||
}
|
||||
|
|
|
@ -7,29 +7,8 @@ import net.minecraft.item.ItemStack;
|
|||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IStorageTank
|
||||
public interface IStorageTank extends IGasStorage
|
||||
{
|
||||
/**
|
||||
* Gets the amount of gas the item has from NBT storage.
|
||||
* @param itemstack
|
||||
* @return amount of gas
|
||||
*/
|
||||
public int getGas(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* Sets the gas the item has stored in it's NBTTagCompound.
|
||||
* @param itemstack - itemstack of a Storage Tank to set the gas of
|
||||
* @param type - the type of gas to set
|
||||
* @param amount - the amount of gas to set
|
||||
*/
|
||||
public void setGas(ItemStack itemstack, EnumGas type, int amount);
|
||||
|
||||
/**
|
||||
* Gets the maximum amount of hydrogen this item can hold.
|
||||
* @return maximum hydrogen
|
||||
*/
|
||||
public int getMaxGas();
|
||||
|
||||
/**
|
||||
* Gets the rate of transfer this item can handle.
|
||||
* @return
|
||||
|
|
|
@ -2,6 +2,11 @@ package mekanism.api;
|
|||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this if your TileEntity can accept energy at a floating-point double value from Universal Cables.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IStrictEnergyAcceptor
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,11 @@ package mekanism.api;
|
|||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this if your block can connect to Pressurized Tubes.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface ITubeConnection
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
* Implement this in your TileEntity class if the block can transfer energy as a Universal Cable.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IUniversalCable
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
* Implement this if your block or item can store Mekanism-based upgrades.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IUpgradeManagement
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
* InfuseObject - an object associated with an ItemStack that can modify a Metallurgic Infuser's internal infuse.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class InfuseObject
|
||||
{
|
||||
/** The type of infuse this item stores */
|
||||
|
|
|
@ -5,6 +5,11 @@ import java.util.HashMap;
|
|||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Use this class to add a new object that registers as an infuse object.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class InfuseRegistry
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,11 @@ package mekanism.api;
|
|||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* An infusion input, containing the type of and amount of infuse the operation requires, as well as the input ItemStack.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class InfusionInput
|
||||
{
|
||||
/** The type of this infusion */
|
||||
|
|
|
@ -2,6 +2,11 @@ package mekanism.api;
|
|||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* An infusion output, containing a reference to it's input as well as the output resource.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class InfusionOutput
|
||||
{
|
||||
/** The input infusion */
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
* The types of infuse currently available in Mekanism.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public enum InfusionType
|
||||
{
|
||||
COAL("COAL"),
|
||||
|
|
|
@ -4,7 +4,12 @@ import java.lang.reflect.Method;
|
|||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RecipeHelper
|
||||
/**
|
||||
* Use this handy class to add recipes to Mekanism machinery.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public final class RecipeHelper
|
||||
{
|
||||
/**
|
||||
* Add an Enrichment Chamber recipe.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package mekanism.client;
|
||||
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.common.ContainerFactory;
|
||||
import mekanism.common.TileEntityFactory;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
|
|
|
@ -17,15 +17,10 @@ public class GuiTheoreticalElementizer extends GuiAdvancedElectricMachine
|
|||
{
|
||||
super.drawGuiContainerForegroundLayer(par1, par2);
|
||||
String displayText = "";
|
||||
|
||||
if(tileEntity.isActive)
|
||||
{
|
||||
if(MekanismUtils.getTicks(tileEntity.speedMultiplier) == 1000)
|
||||
{
|
||||
displayText = "Status: " + Double.toString(Math.round(tileEntity.operatingTicks/10)).replace(".0", "") + "%";
|
||||
}
|
||||
else {
|
||||
displayText = "Status: " + Integer.toString((int)(tileEntity.operatingTicks/8.5)).replace(".0", "") + "%";
|
||||
}
|
||||
displayText = "Status: " + (int)(((float)tileEntity.operatingTicks/MekanismUtils.getTicks(tileEntity.speedMultiplier, tileEntity.TICKS_REQUIRED))*100) + "%";
|
||||
}
|
||||
else {
|
||||
displayText = "Status: " + EnumColor.DARK_RED + "Off";
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
package mekanism.client;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Implement this if your TileEntity has a specific sound.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IHasSound
|
||||
{
|
||||
/**
|
||||
|
@ -12,4 +21,9 @@ public interface IHasSound
|
|||
* Removes the sound;
|
||||
*/
|
||||
public void removeSound();
|
||||
|
||||
/**
|
||||
* Ticks and updates the block's sound.
|
||||
*/
|
||||
public void updateSound();
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package mekanism.client;
|
||||
|
||||
import mekanism.api.IEnergyCube;
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.common.IEnergyCube;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.common.IActiveState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import paulscode.sound.SoundSystem;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ThreadClientUpdate extends Thread
|
|||
downloadType = type;
|
||||
try {
|
||||
url = new URL(location);
|
||||
setDaemon(true);
|
||||
setDaemon(false);
|
||||
start();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -54,7 +54,7 @@ public class ThreadClientUpdate extends Thread
|
|||
outputStream.close();
|
||||
stream.close();
|
||||
|
||||
if(downloadType == 2)
|
||||
if(downloadType == 0)
|
||||
{
|
||||
GuiCredits.onFinishedDownloading();
|
||||
System.out.println("[Mekanism] Successfully updated to latest version (" + Mekanism.latestVersionNumber + ").");
|
||||
|
|
|
@ -12,8 +12,7 @@ import thermalexpansion.api.core.IDismantleable;
|
|||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.prefab.implement.IToolConfigurator;
|
||||
|
||||
import mekanism.api.IEnergyCube;
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
|
|
@ -9,8 +9,6 @@ import thermalexpansion.api.core.IDismantleable;
|
|||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.prefab.implement.IToolConfigurator;
|
||||
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.api.Tier;
|
||||
import mekanism.api.IUpgradeManagement;
|
||||
import mekanism.client.ClientProxy;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
|
|
|
@ -2,9 +2,8 @@ package mekanism.common;
|
|||
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import ic2.api.IElectricItem;
|
||||
import mekanism.api.Tier;
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package mekanism.api;
|
||||
package mekanism.common;
|
||||
|
||||
/**
|
||||
* Implement this if your machine/generator has some form of active state.
|
|
@ -1,5 +1,11 @@
|
|||
package mekanism.common;
|
||||
|
||||
/**
|
||||
* Internal interface. A bounding block is not actually a 'bounding' block, it is really just a fake block that is
|
||||
* used to mimic actual block bounds.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IBoundingBlock
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,12 @@ import ic2.api.energy.event.EnergyTileSourceEvent;
|
|||
import ic2.api.energy.tile.IEnergyConductor;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
|
||||
/**
|
||||
* This here is the core implementation of IC2 into Universal Cable. Thanks to Player's hard work at making the EnergyNet
|
||||
* an event-based system, this is possible.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class IC2EnergyHandler
|
||||
{
|
||||
@ForgeSubscribe
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package mekanism.api;
|
||||
package mekanism.common;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A group of common methods used by all Mekanism machines.
|
||||
* Internal interface containing methods that are shared by many core Mekanism machines. TODO: remove next minor MC
|
||||
* version.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
|
@ -1,8 +1,13 @@
|
|||
package mekanism.api;
|
||||
package mekanism.common;
|
||||
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Internal interface used when dealing with Energy Cubes and their tiers.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IEnergyCube
|
||||
{
|
||||
/**
|
|
@ -4,6 +4,11 @@ import mekanism.common.RecipeHandler.Recipe;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
||||
/**
|
||||
* Internal interface for managing various Factory types.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IFactory
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,6 +3,11 @@ package mekanism.common;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
/**
|
||||
* Internal interface used in blocks and items that are capable of storing sustained inventories.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface ISustainedInventory
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package mekanism.api;
|
||||
package mekanism.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
/**
|
||||
* Implement this in your TileEntity class if you plan to have your machine send and receive packets. Send packets sparingly!
|
||||
* Internal interface used for blocks that send data between clients and the server
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface ITileNetwork
|
||||
{
|
||||
/**
|
||||
* Called when a networked machine receives a packet.
|
||||
* Receive and manage a data input.
|
||||
* @param network
|
||||
* @param packet
|
||||
* @param player
|
||||
|
@ -21,7 +21,7 @@ public interface ITileNetwork
|
|||
public void handlePacketData(ByteArrayDataInput dataStream) throws Exception;
|
||||
|
||||
/**
|
||||
* Gets an ArrayList of data this machine keeps synchronized with the client.
|
||||
* Gets an ArrayList of data this tile entity keeps synchronized with the client.
|
||||
* @param data - list of data
|
||||
* @return ArrayList
|
||||
*/
|
|
@ -16,8 +16,7 @@ import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit;
|
|||
import universalelectricity.core.item.IItemElectric;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.IEnergyCube;
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
|
|||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
int gas = getGas(itemstack);
|
||||
int gas = getGas(getGasType(itemstack), itemstack);
|
||||
|
||||
if(getGasType(itemstack) == EnumGas.NONE)
|
||||
{
|
||||
|
@ -55,54 +55,69 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
|
|||
{
|
||||
ItemStorageTank item = ((ItemStorageTank)itemstack.getItem());
|
||||
|
||||
if(item.getGas(itemstack) == 0 && item.getGasType(itemstack) != EnumGas.NONE)
|
||||
if(getGasType(itemstack) != EnumGas.NONE && getGas(getGasType(itemstack), itemstack) == 0)
|
||||
{
|
||||
item.setGasType(itemstack, EnumGas.NONE);
|
||||
setGasType(itemstack, EnumGas.NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGas(ItemStack itemstack)
|
||||
public int getGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
if(data[0] instanceof ItemStack)
|
||||
{
|
||||
return 0;
|
||||
ItemStack itemstack = (ItemStack)data[0];
|
||||
|
||||
if(getGasType(itemstack) == type)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stored = 0;
|
||||
|
||||
if(itemstack.stackTagCompound.getTag("gas") != null)
|
||||
{
|
||||
stored = itemstack.stackTagCompound.getInteger("gas");
|
||||
}
|
||||
|
||||
itemstack.setItemDamage((int)(Math.abs((((float)stored/MAX_GAS)*100)-100)));
|
||||
return stored;
|
||||
}
|
||||
}
|
||||
|
||||
int stored = 0;
|
||||
|
||||
if(itemstack.stackTagCompound.getTag("gas") != null)
|
||||
{
|
||||
stored = itemstack.stackTagCompound.getInteger("gas");
|
||||
}
|
||||
|
||||
itemstack.setItemDamage((int)(Math.abs((((float)stored/MAX_GAS)*100)-100)));
|
||||
return stored;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGas(ItemStack itemstack, EnumGas type, int amount)
|
||||
public void setGas(EnumGas type, int amount, Object... data)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
if(data[0] instanceof ItemStack)
|
||||
{
|
||||
itemstack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(getGasType(itemstack) == EnumGas.NONE)
|
||||
{
|
||||
setGasType(itemstack, type);
|
||||
}
|
||||
|
||||
if(getGasType(itemstack) == type)
|
||||
{
|
||||
int stored = Math.max(Math.min(amount, MAX_GAS), 0);
|
||||
itemstack.stackTagCompound.setInteger("gas", stored);
|
||||
itemstack.setItemDamage((int)(Math.abs((((float)stored/MAX_GAS)*100)-100)));
|
||||
}
|
||||
|
||||
if(getGas(itemstack) == 0)
|
||||
{
|
||||
setGasType(itemstack, EnumGas.NONE);
|
||||
ItemStack itemstack = (ItemStack)data[0];
|
||||
|
||||
if(itemstack.stackTagCompound == null)
|
||||
{
|
||||
itemstack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(getGasType(itemstack) == EnumGas.NONE)
|
||||
{
|
||||
setGasType(itemstack, type);
|
||||
}
|
||||
|
||||
if(getGasType(itemstack) == type)
|
||||
{
|
||||
int stored = Math.max(Math.min(amount, MAX_GAS), 0);
|
||||
itemstack.stackTagCompound.setInteger("gas", stored);
|
||||
itemstack.setItemDamage((int)(Math.abs((((float)stored/MAX_GAS)*100)-100)));
|
||||
}
|
||||
|
||||
if(getGas(getGasType(itemstack), itemstack) == 0)
|
||||
{
|
||||
setGasType(itemstack, EnumGas.NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,18 +141,29 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
|
|||
{
|
||||
if(type != EnumGas.NONE)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this);
|
||||
setGasType(charged, type);
|
||||
setGas(charged, type, ((IStorageTank)charged.getItem()).getMaxGas());
|
||||
list.add(charged);
|
||||
ItemStack filled = new ItemStack(this);
|
||||
setGasType(filled, type);
|
||||
setGas(type, ((IStorageTank)filled.getItem()).getMaxGas(type, filled), filled);
|
||||
list.add(filled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxGas()
|
||||
public int getMaxGas(EnumGas type, Object... data)
|
||||
{
|
||||
return MAX_GAS;
|
||||
if(data[0] instanceof ItemStack)
|
||||
{
|
||||
ItemStack itemStack = (ItemStack)data[0];
|
||||
IStorageTank tank = (IStorageTank)itemStack.getItem();
|
||||
|
||||
if(getGasType(itemStack) == EnumGas.NONE || getGasType(itemStack) == type)
|
||||
{
|
||||
return MAX_GAS;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -151,10 +177,11 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
|
|||
{
|
||||
if(getGasType(itemstack) == type || getGasType(itemstack) == EnumGas.NONE)
|
||||
{
|
||||
int rejects = Math.max((getGas(itemstack) + amount) - MAX_GAS, 0);
|
||||
setGas(itemstack, type, getGas(itemstack) + amount - rejects);
|
||||
int rejects = Math.max((getGas(getGasType(itemstack), itemstack) + amount) - MAX_GAS, 0);
|
||||
setGas(type, getGas(type, itemstack) + amount - rejects, itemstack);
|
||||
return rejects;
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
@ -163,8 +190,8 @@ public class ItemStorageTank extends ItemMekanism implements IStorageTank
|
|||
{
|
||||
if(getGasType(itemstack) == type)
|
||||
{
|
||||
int gasToUse = Math.min(getGas(itemstack), amount);
|
||||
setGas(itemstack, type, getGas(itemstack) - gasToUse);
|
||||
int gasToUse = Math.min(getGas(type, itemstack), amount);
|
||||
setGas(type, getGas(type, itemstack) - gasToUse, itemstack);
|
||||
return gasToUse;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@ import java.util.logging.Logger;
|
|||
import mekanism.api.InfuseObject;
|
||||
import mekanism.api.InfusionInput;
|
||||
import mekanism.api.InfusionType;
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.client.SoundHandler;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -52,7 +52,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.5.2")
|
||||
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.5.4")
|
||||
@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, 5, 2);
|
||||
public static Version versionNumber = new Version(5, 5, 4);
|
||||
|
||||
/** Map of Teleporters */
|
||||
public static Map<Teleporter.Code, ArrayList<Teleporter.Coords>> teleporters = new HashMap<Teleporter.Code, ArrayList<Teleporter.Coords>>();
|
||||
|
@ -226,16 +226,16 @@ public class Mekanism
|
|||
"RCR", "ECE", "RCR", Character.valueOf('C'), Item.ingotGold, Character.valueOf('R'), Item.redstone, Character.valueOf('E'), EnrichedAlloy
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 0), new Object[] {
|
||||
"ARA", "CIC", "ARA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('R'), Item.redstone, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 9), Character.valueOf('C'), ControlCircuit
|
||||
"ARA", "CIC", "ARA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('R'), Item.redstone, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('C'), ControlCircuit
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 1), new Object[] {
|
||||
"RCR", "GIG", "RCR", Character.valueOf('R'), Item.redstone, Character.valueOf('C'), "basicCircuit", Character.valueOf('G'), Block.glass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 9)
|
||||
"RCR", "GIG", "RCR", Character.valueOf('R'), Item.redstone, Character.valueOf('C'), "basicCircuit", Character.valueOf('G'), Block.glass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 2), new Object[] {
|
||||
"SCS", "RIR", "SCS", Character.valueOf('S'), Block.cobblestone, Character.valueOf('C'), "basicCircuit", Character.valueOf('R'), Item.redstone, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 9)
|
||||
"SCS", "RIR", "SCS", Character.valueOf('S'), Block.cobblestone, Character.valueOf('C'), "basicCircuit", Character.valueOf('R'), Item.redstone, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 3), new Object[] {
|
||||
"RLR", "CIC", "RLR", Character.valueOf('R'), Item.redstone, Character.valueOf('L'), Item.bucketLava, Character.valueOf('C'), "basicCircuit", Character.valueOf('I'), new ItemStack(BasicBlock, 1, 9)
|
||||
"RLR", "CIC", "RLR", Character.valueOf('R'), Item.redstone, Character.valueOf('L'), Item.bucketLava, Character.valueOf('C'), "basicCircuit", Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(SpeedUpgrade), new Object[] {
|
||||
" G ", "APA", " G ", Character.valueOf('P'), "dustOsmium", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('G'), Block.glass
|
||||
|
@ -256,7 +256,7 @@ public class Mekanism
|
|||
"PPP", "PDP", "PPP", Character.valueOf('P'), "ingotOsmium", Character.valueOf('D'), "dustIron"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), new Object[] {
|
||||
"RLR", "TIT", "RLR", Character.valueOf('R'), Item.redstone, Character.valueOf('L'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 9)
|
||||
"RLR", "TIT", "RLR", Character.valueOf('R'), Item.redstone, Character.valueOf('L'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(MekanismUtils.getEnergyCube(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.getEnergyCube(EnergyCubeTier.BASIC)
|
||||
|
@ -292,7 +292,7 @@ public class Mekanism
|
|||
"COC", "OTO", "COC", Character.valueOf('C'), "basicCircuit", Character.valueOf('O'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('T'), TeleportationCore
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 9), new Object[] {
|
||||
"CAC", "ERE", "CAC", Character.valueOf('C'), "basicCircuit", Character.valueOf('A'), AtomicCore, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('R'), new ItemStack(BasicBlock, 1, 9)
|
||||
"CAC", "ERE", "CAC", Character.valueOf('C'), "basicCircuit", Character.valueOf('A'), AtomicCore, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('R'), new ItemStack(BasicBlock, 1, 8)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Configurator), new Object[] {
|
||||
" L ", "AEA", " S ", Character.valueOf('L'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('S'), Item.stick
|
||||
|
@ -307,7 +307,7 @@ public class Mekanism
|
|||
" S ", "SPS", " S ", Character.valueOf('S'), "ingotSteel", Character.valueOf('P'), "ingotOsmium"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 10), new Object[] {
|
||||
"SCS", "GIG", "SCS", Character.valueOf('S'), Block.cobblestone, Character.valueOf('C'), ControlCircuit, Character.valueOf('G'), Block.glass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 9)
|
||||
"SCS", "GIG", "SCS", Character.valueOf('S'), Block.cobblestone, Character.valueOf('C'), ControlCircuit, Character.valueOf('G'), Block.glass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Transmitter, 8, 1), new Object[] {
|
||||
"OOO", "RRR", "OOO", Character.valueOf('O'), "ingotOsmium", Character.valueOf('R'), Item.redstone
|
||||
|
@ -604,7 +604,7 @@ public class Mekanism
|
|||
OreDictionary.registerOre("dustDirtySilver", new ItemStack(DirtyDust, 1, 5));
|
||||
OreDictionary.registerOre("dustDirtyObsidian", new ItemStack(DirtyDust, 1, 6));
|
||||
|
||||
//for railcraft
|
||||
//for RailCraft. cj + obsidian dust = rawr
|
||||
OreDictionary.registerOre("dustObsidian", new ItemStack(DirtyDust, 1, 6));
|
||||
|
||||
OreDictionary.registerOre("clumpIron", new ItemStack(Clump, 1, 0));
|
||||
|
|
|
@ -20,15 +20,14 @@ import universalelectricity.core.vector.Vector3;
|
|||
import universalelectricity.core.vector.VectorHelper;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.api.ICableOutputter;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.IStrictEnergyAcceptor;
|
||||
import mekanism.api.IUniversalCable;
|
||||
import mekanism.api.InfuseObject;
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -418,17 +417,18 @@ public final class MekanismUtils
|
|||
/**
|
||||
* Gets the operating ticks required for a machine via it's upgrades.
|
||||
* @param multiplier - speed multiplier
|
||||
* @param def - the original, default ticks required
|
||||
* @return max operating ticks
|
||||
*/
|
||||
public static int getTicks(int multiplier)
|
||||
public static int getTicks(int multiplier, int def)
|
||||
{
|
||||
return 200/(multiplier+1);
|
||||
return def/(multiplier+1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the maximum energy for a machine via it's upgrades.
|
||||
* @param multiplier - energy multiplier
|
||||
* @param def - original, definitive max energy
|
||||
* @param def - original, default max energy
|
||||
* @return max energy
|
||||
*/
|
||||
public static double getEnergy(int multiplier, double def)
|
||||
|
|
|
@ -17,12 +17,12 @@ public class OreHandler implements IWorldGenerator
|
|||
{
|
||||
if(!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd))
|
||||
{
|
||||
for(int i=0;i<8;i++)
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
int randPosX = (chunkX*16) + random.nextInt(16);
|
||||
int randPosY = random.nextInt(60);
|
||||
int randPosZ = (chunkZ*16) + random.nextInt(16);
|
||||
(new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 0).itemID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
|
||||
new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 0).itemID, 8).generate(world, random, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import java.util.Random;
|
|||
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package mekanism.api;
|
||||
package mekanism.common;
|
||||
|
||||
/**
|
||||
* Tier information for Mekanism. This currently includes tiers for Energy Cubes and Smelting Factories.
|
|
@ -92,9 +92,9 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
if(inventory[3].itemID == Item.redstone.itemID && electricityStored+1000 <= MekanismUtils.getEnergy(energyMultiplier, MAX_ELECTRICITY))
|
||||
{
|
||||
setJoules(electricityStored + 1000);
|
||||
--inventory[3].stackSize;
|
||||
inventory[3].stackSize--;
|
||||
|
||||
if (inventory[3].stackSize <= 0)
|
||||
if(inventory[3].stackSize <= 0)
|
||||
{
|
||||
inventory[3] = null;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
energyMultiplier+=1;
|
||||
energyMultiplier++;
|
||||
|
||||
inventory[4].stackSize--;
|
||||
|
||||
|
@ -131,7 +131,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
speedMultiplier+=1;
|
||||
speedMultiplier++;
|
||||
|
||||
inventory[4].stackSize--;
|
||||
|
||||
|
@ -153,18 +153,19 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
|
||||
if(electricityStored >= ENERGY_PER_TICK && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK)
|
||||
{
|
||||
if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier) && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK)
|
||||
if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED) && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK)
|
||||
{
|
||||
++operatingTicks;
|
||||
operatingTicks++;
|
||||
secondaryEnergyStored -= SECONDARY_ENERGY_PER_TICK;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
else if((operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier))
|
||||
else if((operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
operate();
|
||||
}
|
||||
|
||||
operatingTicks = 0;
|
||||
secondaryEnergyStored -= SECONDARY_ENERGY_PER_TICK;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
|
@ -219,17 +220,16 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
{
|
||||
ItemStack itemstack = RecipeHandler.getOutput(inventory[0], true, getRecipes());
|
||||
|
||||
if (inventory[0].stackSize <= 0)
|
||||
if(inventory[0].stackSize <= 0)
|
||||
{
|
||||
inventory[0] = null;
|
||||
}
|
||||
|
||||
if (inventory[2] == null)
|
||||
if(inventory[2] == null)
|
||||
{
|
||||
inventory[2] = itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
inventory[2].stackSize += itemstack.stackSize;
|
||||
}
|
||||
}
|
||||
|
@ -237,29 +237,28 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
@Override
|
||||
public boolean canOperate()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
if(inventory[0] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemstack = RecipeHandler.getOutput(inventory[0], false, getRecipes());
|
||||
|
||||
if (itemstack == null)
|
||||
if(itemstack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inventory[2] == null)
|
||||
if(inventory[2] == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!inventory[2].isItemEqual(itemstack))
|
||||
if(!inventory[2].isItemEqual(itemstack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return inventory[2].stackSize + itemstack.stackSize <= inventory[2].getMaxStackSize();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package mekanism.common;
|
|||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
|
||||
public class TileEntityAdvancedFactory extends TileEntityFactory
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.ArrayList;
|
|||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import ic2.api.IWrenchable;
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -7,9 +7,7 @@ import java.util.ArrayList;
|
|||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.IElectricMachine;
|
||||
import mekanism.api.IStrictEnergyAcceptor;
|
||||
import mekanism.api.IUpgradeManagement;
|
||||
import mekanism.api.SideData;
|
||||
|
@ -109,15 +107,16 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
{
|
||||
synchronized(Mekanism.audioHandler.sounds)
|
||||
{
|
||||
handleSound();
|
||||
updateSound();
|
||||
}
|
||||
}
|
||||
} catch(NoSuchMethodError e) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleSound()
|
||||
@Override
|
||||
public void updateSound()
|
||||
{
|
||||
if(Mekanism.audioHandler != null)
|
||||
{
|
||||
|
@ -292,7 +291,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
*/
|
||||
public int getScaledProgress(int i)
|
||||
{
|
||||
return operatingTicks*i / MekanismUtils.getTicks(speedMultiplier);
|
||||
return operatingTicks*i / MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED);
|
||||
}
|
||||
|
||||
public int getScaledUpgradeProgress(int i)
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package mekanism.common;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import ic2.api.IWrenchable;
|
|||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
|
|
@ -62,9 +62,9 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
if(inventory[1].itemID == Item.redstone.itemID && electricityStored+1000 <= MekanismUtils.getEnergy(energyMultiplier, MAX_ELECTRICITY))
|
||||
{
|
||||
setJoules(electricityStored + 1000);
|
||||
--inventory[1].stackSize;
|
||||
inventory[1].stackSize--;
|
||||
|
||||
if (inventory[1].stackSize <= 0)
|
||||
if(inventory[1].stackSize <= 0)
|
||||
{
|
||||
inventory[1] = null;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
energyMultiplier+=1;
|
||||
energyMultiplier++;
|
||||
|
||||
inventory[3].stackSize--;
|
||||
|
||||
|
@ -101,7 +101,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
speedMultiplier+=1;
|
||||
speedMultiplier++;
|
||||
|
||||
inventory[3].stackSize--;
|
||||
|
||||
|
@ -121,17 +121,18 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
|
||||
if(electricityStored >= ENERGY_PER_TICK)
|
||||
{
|
||||
if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier))
|
||||
if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
operatingTicks++;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
else if(canOperate() && (operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier))
|
||||
else if(canOperate() && (operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
operate();
|
||||
}
|
||||
|
||||
operatingTicks = 0;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
|
@ -159,12 +160,12 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
{
|
||||
ItemStack itemstack = RecipeHandler.getOutput(inventory[0], true, getRecipes());
|
||||
|
||||
if (inventory[0].stackSize <= 0)
|
||||
if(inventory[0].stackSize <= 0)
|
||||
{
|
||||
inventory[0] = null;
|
||||
}
|
||||
|
||||
if (inventory[2] == null)
|
||||
if(inventory[2] == null)
|
||||
{
|
||||
inventory[2] = itemstack;
|
||||
}
|
||||
|
@ -176,24 +177,24 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
@Override
|
||||
public boolean canOperate()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
if(inventory[0] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemstack = RecipeHandler.getOutput(inventory[0], false, getRecipes());
|
||||
|
||||
if (itemstack == null)
|
||||
if(itemstack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inventory[2] == null)
|
||||
if(inventory[2] == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!inventory[2].isItemEqual(itemstack))
|
||||
if(!inventory[2].isItemEqual(itemstack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package mekanism.common;
|
|||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
|
||||
public class TileEntityEliteFactory extends TileEntityFactory
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.util.HashSet;
|
|||
import mekanism.api.ICableOutputter;
|
||||
import mekanism.api.IUniversalCable;
|
||||
import mekanism.api.IStrictEnergyAcceptor;
|
||||
import mekanism.api.Tier.EnergyCubeTier;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
|
|
@ -7,15 +7,14 @@ import ic2.api.ElectricItem;
|
|||
import ic2.api.IElectricItem;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.IStrictEnergyAcceptor;
|
||||
import mekanism.api.IUpgradeManagement;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.api.Tier.FactoryTier;
|
||||
import mekanism.client.IHasSound;
|
||||
import mekanism.client.Sound;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -111,7 +110,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
{
|
||||
synchronized(Mekanism.audioHandler.sounds)
|
||||
{
|
||||
handleSound();
|
||||
updateSound();
|
||||
}
|
||||
}
|
||||
} catch(NoSuchMethodError e) {}
|
||||
|
@ -146,9 +145,9 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
if(inventory[1].itemID == Item.redstone.itemID && electricityStored+1000 <= MekanismUtils.getEnergy(energyMultiplier, MAX_ELECTRICITY))
|
||||
{
|
||||
setJoules(electricityStored + 1000);
|
||||
--inventory[1].stackSize;
|
||||
inventory[1].stackSize--;
|
||||
|
||||
if (inventory[1].stackSize <= 0)
|
||||
if(inventory[1].stackSize <= 0)
|
||||
{
|
||||
inventory[1] = null;
|
||||
}
|
||||
|
@ -166,7 +165,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
energyMultiplier+=1;
|
||||
energyMultiplier++;
|
||||
|
||||
inventory[0].stackSize--;
|
||||
|
||||
|
@ -185,7 +184,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
speedMultiplier+=1;
|
||||
speedMultiplier++;
|
||||
|
||||
inventory[0].stackSize--;
|
||||
|
||||
|
@ -207,17 +206,18 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
{
|
||||
if(electricityStored >= ENERGY_PER_TICK)
|
||||
{
|
||||
if(canOperate(getInputSlot(process), getOutputSlot(process)) && (progress[process]+1) < MekanismUtils.getTicks(speedMultiplier))
|
||||
if(canOperate(getInputSlot(process), getOutputSlot(process)) && (progress[process]+1) < MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
++progress[process];
|
||||
progress[process]++;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
else if(canOperate(getInputSlot(process), getOutputSlot(process)) && (progress[process]+1) >= MekanismUtils.getTicks(speedMultiplier))
|
||||
else if(canOperate(getInputSlot(process), getOutputSlot(process)) && (progress[process]+1) >= MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
operate(getInputSlot(process), getOutputSlot(process));
|
||||
}
|
||||
|
||||
progress[process] = 0;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
|
@ -253,7 +253,8 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleSound()
|
||||
@Override
|
||||
public void updateSound()
|
||||
{
|
||||
if(Mekanism.audioHandler != null)
|
||||
{
|
||||
|
@ -295,7 +296,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
|
||||
public int getScaledProgress(int i, int process)
|
||||
{
|
||||
return progress[process]*i / MekanismUtils.getTicks(speedMultiplier);
|
||||
return progress[process]*i / MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -315,24 +316,24 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
|
||||
public boolean canOperate(int inputSlot, int outputSlot)
|
||||
{
|
||||
if (inventory[inputSlot] == null)
|
||||
if(inventory[inputSlot] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemstack = RecipeType.values()[recipeType].getCopiedOutput(inventory[inputSlot], false);
|
||||
|
||||
if (itemstack == null)
|
||||
if(itemstack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inventory[outputSlot] == null)
|
||||
if(inventory[outputSlot] == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!inventory[outputSlot].isItemEqual(itemstack))
|
||||
if(!inventory[outputSlot].isItemEqual(itemstack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -343,19 +344,19 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
|
||||
public void operate(int inputSlot, int outputSlot)
|
||||
{
|
||||
if (!canOperate(inputSlot, outputSlot))
|
||||
if(!canOperate(inputSlot, outputSlot))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack itemstack = RecipeType.values()[recipeType].getCopiedOutput(inventory[inputSlot], true);
|
||||
|
||||
if (inventory[inputSlot].stackSize <= 0)
|
||||
if(inventory[inputSlot].stackSize <= 0)
|
||||
{
|
||||
inventory[inputSlot] = null;
|
||||
}
|
||||
|
||||
if (inventory[outputSlot] == null)
|
||||
if(inventory[outputSlot] == null)
|
||||
{
|
||||
inventory[outputSlot] = itemstack;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getGas(EnumGas type)
|
||||
public int getGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(type == gasType)
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setGas(EnumGas type, int amount)
|
||||
public void setGas(EnumGas type, int amount, Object... data)
|
||||
{
|
||||
if(type == gasType)
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMaxGas(EnumGas type)
|
||||
public int getMaxGas(EnumGas type, Object... data)
|
||||
{
|
||||
return MAX_GAS;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import ic2.api.energy.tile.IEnergySink;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.IStrictEnergyAcceptor;
|
||||
import mekanism.api.IUpgradeManagement;
|
||||
|
@ -112,7 +111,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
{
|
||||
synchronized(Mekanism.audioHandler.sounds)
|
||||
{
|
||||
handleSound();
|
||||
updateSound();
|
||||
}
|
||||
}
|
||||
} catch(NoSuchMethodError e) {}
|
||||
|
@ -139,9 +138,9 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
if(inventory[4].itemID == Item.redstone.itemID && electricityStored+1000 <= MekanismUtils.getEnergy(energyMultiplier, MAX_ELECTRICITY))
|
||||
{
|
||||
setJoules(electricityStored + 1000);
|
||||
--inventory[4].stackSize;
|
||||
inventory[4].stackSize--;
|
||||
|
||||
if (inventory[4].stackSize <= 0)
|
||||
if(inventory[4].stackSize <= 0)
|
||||
{
|
||||
inventory[4] = null;
|
||||
}
|
||||
|
@ -159,7 +158,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
energyMultiplier+=1;
|
||||
energyMultiplier++;
|
||||
|
||||
inventory[0].stackSize--;
|
||||
|
||||
|
@ -178,7 +177,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
else if(upgradeTicks == UPGRADE_TICKS_REQUIRED)
|
||||
{
|
||||
upgradeTicks = 0;
|
||||
speedMultiplier+=1;
|
||||
speedMultiplier++;
|
||||
|
||||
inventory[0].stackSize--;
|
||||
|
||||
|
@ -210,7 +209,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
type = infuse.type;
|
||||
inventory[1].stackSize--;
|
||||
|
||||
if (inventory[1].stackSize <= 0)
|
||||
if(inventory[1].stackSize <= 0)
|
||||
{
|
||||
inventory[1] = null;
|
||||
}
|
||||
|
@ -221,17 +220,18 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
|
||||
if(electricityStored >= ENERGY_PER_TICK)
|
||||
{
|
||||
if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier))
|
||||
if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
++operatingTicks;
|
||||
operatingTicks++;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
else if(canOperate() && (operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier))
|
||||
else if(canOperate() && (operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED))
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
operate();
|
||||
}
|
||||
|
||||
operatingTicks = 0;
|
||||
electricityStored -= ENERGY_PER_TICK;
|
||||
}
|
||||
|
@ -261,7 +261,8 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleSound()
|
||||
@Override
|
||||
public void updateSound()
|
||||
{
|
||||
if(Mekanism.audioHandler != null)
|
||||
{
|
||||
|
@ -292,7 +293,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
|
||||
public void operate()
|
||||
{
|
||||
if (!canOperate())
|
||||
if(!canOperate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -301,12 +302,12 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
|
||||
infuseStored -= output.getInfuseRequired();
|
||||
|
||||
if (inventory[2].stackSize <= 0)
|
||||
if(inventory[2].stackSize <= 0)
|
||||
{
|
||||
inventory[2] = null;
|
||||
}
|
||||
|
||||
if (inventory[3] == null)
|
||||
if(inventory[3] == null)
|
||||
{
|
||||
inventory[3] = output.resource.copy();
|
||||
}
|
||||
|
@ -317,14 +318,14 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
|
||||
public boolean canOperate()
|
||||
{
|
||||
if (inventory[2] == null)
|
||||
if(inventory[2] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
InfusionOutput output = RecipeHandler.getOutput(InfusionInput.getInfusion(type, infuseStored, inventory[2]), false, Recipe.METALLURGIC_INFUSER.get());
|
||||
|
||||
if (output == null)
|
||||
if(output == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -334,17 +335,16 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
return false;
|
||||
}
|
||||
|
||||
if (inventory[3] == null)
|
||||
if(inventory[3] == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!inventory[3].isItemEqual(output.resource))
|
||||
if(!inventory[3].isItemEqual(output.resource))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return inventory[3].stackSize + output.resource.stackSize <= inventory[3].getMaxStackSize();
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
|
||||
public int getScaledProgress(int i)
|
||||
{
|
||||
return operatingTicks*i / MekanismUtils.getTicks(speedMultiplier);
|
||||
return operatingTicks*i / MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED);
|
||||
}
|
||||
|
||||
public int getScaledUpgradeProgress(int i)
|
||||
|
|
|
@ -35,7 +35,7 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getGas(EnumGas type)
|
||||
public int getGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(type == EnumGas.OXYGEN)
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setGas(EnumGas type, int amount)
|
||||
public void setGas(EnumGas type, int amount, Object... data)
|
||||
{
|
||||
if(type == EnumGas.OXYGEN)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMaxGas(EnumGas type)
|
||||
public int getMaxGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(type == EnumGas.OXYGEN)
|
||||
{
|
||||
|
|
|
@ -21,13 +21,13 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
|
|||
@Override
|
||||
public HashMap getRecipes()
|
||||
{
|
||||
return (HashMap)Collections.synchronizedMap(new HashMap<ItemStack, ItemStack>());
|
||||
return new HashMap<ItemStack, ItemStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operate()
|
||||
{
|
||||
if (!canOperate())
|
||||
if(!canOperate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
|
|||
|
||||
inventory[0].stackSize--;
|
||||
|
||||
if (inventory[0].stackSize <= 0)
|
||||
if(inventory[0].stackSize <= 0)
|
||||
{
|
||||
inventory[0] = null;
|
||||
}
|
||||
|
@ -47,22 +47,12 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
|
|||
@Override
|
||||
public boolean canOperate()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
if(inventory[0] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(electricityStored < ENERGY_PER_TICK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(secondaryEnergyStored < SECONDARY_ENERGY_PER_TICK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inventory[2] != null)
|
||||
if(inventory[2] != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -73,7 +63,7 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
|
|||
@Override
|
||||
public int getFuelTicks(ItemStack itemstack)
|
||||
{
|
||||
if (itemstack.itemID == Item.diamond.itemID) return 1000;
|
||||
if(itemstack.itemID == Item.diamond.itemID) return 1000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ public class Version
|
|||
public static Version get(String s)
|
||||
{
|
||||
String[] split = s.replace('.', ':').split(":");
|
||||
|
||||
if(split.length != 3)
|
||||
{
|
||||
System.out.println(split.length);
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.common.IActiveState;
|
||||
import mekanism.common.IBoundingBlock;
|
||||
import mekanism.common.ISustainedInventory;
|
||||
import mekanism.common.Mekanism;
|
||||
|
|
|
@ -22,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.5.2", dependencies = "required-after:Mekanism")
|
||||
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.5.4", dependencies = "required-after:Mekanism")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||
public class MekanismGenerators
|
||||
{
|
||||
|
@ -77,13 +77,13 @@ public class MekanismGenerators
|
|||
"SES", "SES", "III", Character.valueOf('S'), new ItemStack(Generator, 1, 1), Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('I'), Item.ingotIron
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Generator, 1, 4), new Object[] {
|
||||
"RER", "BIB", "NEN", Character.valueOf('R'), Item.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('B'), BioFuel, Character.valueOf('I'), new ItemStack(Mekanism.BasicBlock, 1, 9), Character.valueOf('N'), Item.ingotIron
|
||||
"RER", "BIB", "NEN", Character.valueOf('R'), Item.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('B'), BioFuel, Character.valueOf('I'), new ItemStack(Mekanism.BasicBlock, 1, 8), Character.valueOf('N'), Item.ingotIron
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Generator, 1, 2), new Object[] {
|
||||
"IRI", "ECE", "IRI", Character.valueOf('I'), Item.ingotIron, Character.valueOf('R'), Item.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('C'), ElectrolyticCore
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Generator, 1, 3), new Object[] {
|
||||
"PEP", "ICI", "PEP", Character.valueOf('P'), "ingotOsmium", Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('I'), new ItemStack(Mekanism.BasicBlock, 1, 9), Character.valueOf('C'), ElectrolyticCore
|
||||
"PEP", "ICI", "PEP", Character.valueOf('P'), "ingotOsmium", Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('I'), new ItemStack(Mekanism.BasicBlock, 1, 8), Character.valueOf('C'), ElectrolyticCore
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ElectrolyticCore), new Object[] {
|
||||
"EPE", "IEG", "EPE", Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('P'), "dustOsmium", Character.valueOf('I'), "dustIron", Character.valueOf('G'), "dustGold"
|
||||
|
|
|
@ -364,13 +364,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMaxGas(EnumGas type)
|
||||
public int getMaxGas(EnumGas type, Object... data)
|
||||
{
|
||||
return MAX_GAS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGas(EnumGas type, int amount)
|
||||
public void setGas(EnumGas type, int amount, Object... data)
|
||||
{
|
||||
if(type == EnumGas.HYDROGEN)
|
||||
{
|
||||
|
@ -383,7 +383,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getGas(EnumGas type)
|
||||
public int getGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(type == EnumGas.HYDROGEN)
|
||||
{
|
||||
|
|
|
@ -16,12 +16,12 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import mekanism.api.IActiveState;
|
||||
import mekanism.api.ICableOutputter;
|
||||
import mekanism.api.IUniversalCable;
|
||||
import mekanism.client.IHasSound;
|
||||
import mekanism.client.Sound;
|
||||
import mekanism.common.CableUtils;
|
||||
import mekanism.common.IActiveState;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
|
@ -88,7 +88,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
{
|
||||
synchronized(Mekanism.audioHandler.sounds)
|
||||
{
|
||||
handleSound();
|
||||
updateSound();
|
||||
}
|
||||
}
|
||||
} catch(NoSuchMethodError e) {}
|
||||
|
@ -144,7 +144,8 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleSound()
|
||||
@Override
|
||||
public void updateSound()
|
||||
{
|
||||
if(Mekanism.audioHandler != null)
|
||||
{
|
||||
|
|
|
@ -115,7 +115,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setGas(EnumGas type, int amount)
|
||||
public void setGas(EnumGas type, int amount, Object... data)
|
||||
{
|
||||
if(type == EnumGas.HYDROGEN)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getGas(EnumGas type)
|
||||
public int getGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(type == EnumGas.HYDROGEN)
|
||||
{
|
||||
|
@ -272,7 +272,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMaxGas(EnumGas type)
|
||||
public int getMaxGas(EnumGas type, Object... data)
|
||||
{
|
||||
if(type == EnumGas.HYDROGEN)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
|
|||
}
|
||||
|
||||
@Override
|
||||
public void handleSound() {}
|
||||
public void updateSound() {/* No super - prevent sound updating */}
|
||||
|
||||
@Override
|
||||
public int getSizeInventorySide(ForgeDirection side)
|
||||
|
|
|
@ -22,7 +22,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.5.2", dependencies = "required-after:Mekanism")
|
||||
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.5.4", dependencies = "required-after:Mekanism")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||
public class MekanismTools
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue