v5 Pre-Release #1
*Added missing javadocs. *Fixed incomplete/misleading javadocs. *Removed unneeded imports. *Moved EnumGas to it's own class in mekanism.api. *Fixed Refined Obsidian GUI. *Made Energized Bow store it's fire state in NBT. *Fixed Advanced Solar Generator GUI. *Fixed crafting recipes and removed old Ore Dictionary registrations.
This commit is contained in:
parent
35b6e52fa8
commit
e5b57c3c66
26 changed files with 186 additions and 95 deletions
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
34
src/common/mekanism/api/EnumGas.java
Normal file
34
src/common/mekanism/api/EnumGas.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package mekanism.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public enum EnumGas
|
||||
{
|
||||
NONE("None"),
|
||||
OXYGEN("Oxygen"),
|
||||
HYDROGEN("Hydrogen");
|
||||
|
||||
public String name;
|
||||
|
||||
public static EnumGas getFromName(String gasName)
|
||||
{
|
||||
for(EnumGas gas : values())
|
||||
{
|
||||
if(gasName.contains(gas.name))
|
||||
{
|
||||
return gas;
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("[Mekanism] Invalid gas identifier when retrieving with name.");
|
||||
return NONE;
|
||||
}
|
||||
|
||||
private EnumGas(String s)
|
||||
{
|
||||
name = s;
|
||||
}
|
||||
}
|
|
@ -1,26 +1,25 @@
|
|||
package mekanism.api;
|
||||
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this if your tile entity accepts hydrogen from a foreign, external source.
|
||||
* Implement this if your tile entity accepts gas from a foreign, external source.
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public interface IGasAcceptor
|
||||
{
|
||||
/**
|
||||
* Transfer a certain amount of hydrogen to this acceptor.
|
||||
* Transfer a certain amount of gas to this acceptor.
|
||||
* @param amount - amount to transfer
|
||||
* @return rejects
|
||||
*/
|
||||
public int transferGasToAcceptor(int amount, EnumGas type);
|
||||
|
||||
/**
|
||||
* Whether or not this tile entity accepts hydrogen from a certain side.
|
||||
* Whether or not this tile entity accepts gas from a certain side.
|
||||
* @param side - side to check
|
||||
* @return if tile entity accepts energy
|
||||
* @return if tile entity accepts gas
|
||||
*/
|
||||
public boolean canReceiveGas(ForgeDirection side, EnumGas type);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package mekanism.api;
|
||||
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
|
||||
/**
|
||||
* Implement this if your tile entity can store some form of gas.
|
||||
* @author AidanBrady
|
||||
|
|
|
@ -70,32 +70,4 @@ public interface IStorageTank
|
|||
public boolean canProvideGas();
|
||||
|
||||
public EnumGas gasType();
|
||||
|
||||
public static enum EnumGas
|
||||
{
|
||||
NONE("None"),
|
||||
OXYGEN("Oxygen"),
|
||||
HYDROGEN("Hydrogen");
|
||||
|
||||
public String name;
|
||||
|
||||
public static EnumGas getFromName(String gasName)
|
||||
{
|
||||
for(EnumGas gas : values())
|
||||
{
|
||||
if(gasName.contains(gas.name))
|
||||
{
|
||||
return gas;
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("[Mekanism] Invalid gas identifier when retrieving with name.");
|
||||
return NONE;
|
||||
}
|
||||
|
||||
private EnumGas(String s)
|
||||
{
|
||||
name = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class BlockBasic extends Block
|
|||
{
|
||||
if(entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(Mekanism.instance, /*1*/ 14, world, x, y, z);
|
||||
entityplayer.openGui(Mekanism.instance, 1, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class BlockBasic extends Block
|
|||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(Mekanism.instance, /*1*/ 14, world, x, y, z);
|
||||
entityplayer.openGui(Mekanism.instance, 14, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -110,8 +110,6 @@ public class BlockBasic extends Block
|
|||
return 8;
|
||||
case 4:
|
||||
return 15;
|
||||
case 5:
|
||||
return 15;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package mekanism.common;
|
|||
|
||||
import ic2.api.IElectricItem;
|
||||
import universalelectricity.core.implement.IItemElectric;
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.IEnergizedItem;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import mekanism.api.IStorageTank;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package mekanism.common;
|
|||
import ic2.api.IElectricItem;
|
||||
import universalelectricity.core.implement.IItemElectric;
|
||||
import mekanism.api.*;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class ContainerGasTank extends Container
|
||||
|
|
|
@ -2,9 +2,9 @@ package mekanism.common;
|
|||
|
||||
import ic2.api.IElectricItem;
|
||||
import universalelectricity.core.implement.IItemElectric;
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.IEnergizedItem;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class ContainerHydrogenGenerator extends Container
|
||||
|
|
|
@ -12,8 +12,13 @@ import net.minecraft.src.*;
|
|||
|
||||
public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItemElectric
|
||||
{
|
||||
/** The maximum amount of energy this item can hold. */
|
||||
public int MAX_ENERGY;
|
||||
|
||||
/** How fast this item can transfer energy. */
|
||||
public int TRANSFER_RATE;
|
||||
|
||||
/** The number that, when the max amount of energy is divided by, will make it equal 100. */
|
||||
public int DIVIDER;
|
||||
|
||||
public ItemEnergized(int id, int energy, int rate, int divide)
|
||||
|
|
|
@ -6,8 +6,6 @@ import net.minecraft.src.*;
|
|||
|
||||
public class ItemEnergizedBow extends ItemEnergized
|
||||
{
|
||||
public boolean fireMode = false;
|
||||
|
||||
public ItemEnergizedBow(int id)
|
||||
{
|
||||
super(id, 10000, 100, 100);
|
||||
|
@ -17,7 +15,7 @@ public class ItemEnergizedBow extends ItemEnergized
|
|||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
super.addInformation(itemstack, entityplayer, list, flag);
|
||||
list.add("Fire Mode: " + (fireMode ? "ON" : "OFF"));
|
||||
list.add("Fire Mode: " + (getFireState(itemstack) ? "ON" : "OFF"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +50,7 @@ public class ItemEnergizedBow extends ItemEnergized
|
|||
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
{
|
||||
discharge(itemstack, (fireMode ? 100 : 10));
|
||||
discharge(itemstack, (getFireState(itemstack) ? 100 : 10));
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||||
|
@ -69,7 +67,7 @@ public class ItemEnergizedBow extends ItemEnergized
|
|||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(entityarrow);
|
||||
entityarrow.setFire(fireMode ? 60 : 0);
|
||||
entityarrow.setFire(getFireState(itemstack) ? 60 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,10 +104,47 @@ public class ItemEnergizedBow extends ItemEnergized
|
|||
else {
|
||||
if(!world.isRemote)
|
||||
{
|
||||
fireMode = !fireMode;
|
||||
entityplayer.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Fire Mode: " + (fireMode ? (EnumColor.DARK_GREEN + "ON") : (EnumColor.DARK_RED + "OFF")));
|
||||
setFireState(itemstack, !getFireState(itemstack));
|
||||
entityplayer.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Fire Mode: " + (getFireState(itemstack) ? (EnumColor.DARK_GREEN + "ON") : (EnumColor.DARK_RED + "OFF")));
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bow's fire state in NBT.
|
||||
* @param itemstack - the bow's itemstack
|
||||
* @param state - state to change to
|
||||
*/
|
||||
public void setFireState(ItemStack itemstack, boolean state)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
{
|
||||
itemstack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemstack.stackTagCompound.setBoolean("fireState", state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bow's fire state from NBT.
|
||||
* @param itemstack - the bow's itemstack
|
||||
* @return fire state
|
||||
*/
|
||||
public boolean getFireState(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean state = false;
|
||||
|
||||
if(itemstack.stackTagCompound.getTag("fireState") != null)
|
||||
{
|
||||
state = itemstack.stackTagCompound.getBoolean("fireState");
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mekanism.common;
|
||||
|
||||
import mekanism.api.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class ItemHydrogenTank extends ItemStorageTank
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package mekanism.common;
|
||||
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import mekanism.api.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class ItemOxygenTank extends ItemStorageTank
|
||||
|
|
|
@ -8,8 +8,13 @@ import net.minecraft.src.*;
|
|||
|
||||
public abstract class ItemStorageTank extends ItemMekanism implements IStorageTank
|
||||
{
|
||||
/** The maximum amount of gas this tank can hold. */
|
||||
public int MAX_GAS;
|
||||
|
||||
/** 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 gas, int rate, int divide)
|
||||
|
|
|
@ -519,7 +519,7 @@ public class Mekanism
|
|||
"ECE", "CPC", "ECE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), EnergyCube.getUnchargedItem(), Character.valueOf('P'), new ItemStack(PowerUnit, 1, 0)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 0), new Object[] {
|
||||
"***", "*R*", "***", Character.valueOf('*'), new ItemStack(Ingot, 1, 1), Character.valueOf('R'), Item.redstone
|
||||
"***", "*R*", "***", Character.valueOf('*'), "ingotPlatinum", Character.valueOf('R'), Item.redstone
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 1), new Object[] {
|
||||
"***", "*P*", "***", Character.valueOf('*'), Item.redstone, Character.valueOf('P'), new ItemStack(BasicBlock, 1, 0)
|
||||
|
@ -528,13 +528,13 @@ public class Mekanism
|
|||
"***", "*P*", "***", Character.valueOf('*'), Block.cobblestone, Character.valueOf('P'), new ItemStack(BasicBlock, 1, 0)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 3), new Object[] {
|
||||
"***", "*L*", "***", Character.valueOf('*'), new ItemStack(Ingot, 1, 1), Character.valueOf('L'), Item.bucketLava
|
||||
"***", "*L*", "***", Character.valueOf('*'), "ingotPlatinum", Character.valueOf('L'), Item.bucketLava
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(SpeedUpgrade), new Object[] {
|
||||
"PAP", "ARA", "PAP", Character.valueOf('P'), new ItemStack(Dust, 1, 2), Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), Item.emerald
|
||||
"PAP", "AEA", "PAP", Character.valueOf('P'), "dustPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), Item.emerald
|
||||
}));
|
||||
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'), Item.emerald
|
||||
"RAR", "AEA", "RAR", Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyCube.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
|
||||
|
@ -543,7 +543,7 @@ public class Mekanism
|
|||
"GGG", "ECE", "IRI", Character.valueOf('G'), Item.lightStoneDust, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), new ItemStack(BasicBlock, 1, 3), Character.valueOf('I'), Item.ingotIron, Character.valueOf('R'), Item.redstone
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(NuclearCore), new Object[] {
|
||||
"AOA", "PDP", "AOA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('O'), new ItemStack(Dust, 1, 3), Character.valueOf('P'), new ItemStack(Dust, 1, 2), Character.valueOf('D'), Item.diamond
|
||||
"AOA", "PDP", "AOA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('O'), "dustObsidian", Character.valueOf('P'), new ItemStack(Dust, 1, 2), Character.valueOf('D'), Item.diamond
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(NuclearDisassembler.getUnchargedItem(), new Object[] {
|
||||
"AEA", "ACA", " O ", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('C'), NuclearCore, Character.valueOf('O'), "ingotObsidian"
|
||||
|
@ -566,18 +566,9 @@ public class Mekanism
|
|||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(OxygenTank.getEmptyItem(), new Object[] {
|
||||
"III", "IGI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), "dustGold"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(HydrogenTank.getEmptyItem(), new Object[] {
|
||||
"III", "IDI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('D'), "itemDustIron"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(OxygenTank.getEmptyItem(), new Object[] {
|
||||
"III", "IGI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), "itemDustGold"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ElectrolyticCore), new Object[] {
|
||||
"EPE", "IEG", "EPE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('P'), "dustPlatinum", Character.valueOf('I'), "dustIron", Character.valueOf('G'), "dustGold"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ElectrolyticCore), new Object[] {
|
||||
"EPE", "IEG", "EPE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('P'), "dustPlatinum", Character.valueOf('I'), "itemDustIron", Character.valueOf('G'), "itemDustGold"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(GasTank, new Object[] {
|
||||
"PPP", "P P", "PPP", Character.valueOf('P'), "ingotPlatinum"
|
||||
}));
|
||||
|
@ -585,13 +576,13 @@ public class Mekanism
|
|||
"SES", "SES", "III", Character.valueOf('S'), new ItemStack(Generator, 1, 1), Character.valueOf('E'), EnrichedAlloy, Character.valueOf('I'), Item.ingotIron
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BioGenerator), new Object[] {
|
||||
"RER", "BIB", "NEN", Character.valueOf('R'), Item.redstone, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('B'), BioFuel, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 6), Character.valueOf('N'), Item.ingotIron
|
||||
"RER", "BIB", "NEN", Character.valueOf('R'), Item.redstone, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('B'), BioFuel, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 5), 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'), EnrichedAlloy, Character.valueOf('C'), ElectrolyticCore
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Generator, 1, 3), new Object[] {
|
||||
"PEP", "ICI", "PEP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 6), Character.valueOf('C'), ElectrolyticCore
|
||||
"PEP", "ICI", "PEP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 5), Character.valueOf('C'), ElectrolyticCore
|
||||
}));
|
||||
|
||||
if(extrasEnabled)
|
||||
|
@ -1056,12 +1047,6 @@ public class Mekanism
|
|||
OreDictionary.registerOre("dustPlatinum", new ItemStack(Dust, 1, 2));
|
||||
OreDictionary.registerOre("dustObsidian", new ItemStack(Dust, 1, 3));
|
||||
|
||||
//Damn you RichardG and your weird Ore Dictionary standards
|
||||
OreDictionary.registerOre("itemDustIron", new ItemStack(Dust, 1, 0));
|
||||
OreDictionary.registerOre("itemDustGold", new ItemStack(Dust, 1, 1));
|
||||
OreDictionary.registerOre("itemDustPlatinum", new ItemStack(Dust, 1, 2));
|
||||
OreDictionary.registerOre("itemDustObsidian", new ItemStack(Dust, 1, 3));
|
||||
|
||||
OreDictionary.registerOre("ingotObsidian", new ItemStack(Ingot, 1, 0));
|
||||
OreDictionary.registerOre("ingotPlatinum", new ItemStack(Ingot, 1, 1));
|
||||
OreDictionary.registerOre("ingotRedstone", new ItemStack(Ingot, 1, 2));
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.IOException;
|
|||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.INetworkManager;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package mekanism.common;
|
||||
|
||||
import ic2.api.IElectricItem;
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.IEnergizedItem;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class SlotStorageTank extends Slot
|
||||
|
|
|
@ -13,6 +13,10 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
|||
/** The full name of this machine. */
|
||||
public String fullName;
|
||||
|
||||
/**
|
||||
* A simple tile entity with a container and facing state.
|
||||
* @param name - full name of this tile entity
|
||||
*/
|
||||
public TileEntityContainerBlock(String name)
|
||||
{
|
||||
fullName = name;
|
||||
|
|
|
@ -7,10 +7,16 @@ import net.minecraft.src.*;
|
|||
|
||||
public class TileEntityControlPanel extends TileEntity implements ITileNetwork
|
||||
{
|
||||
/** A counter to send packets at defined intervals. */
|
||||
public int packetTick = 0;
|
||||
|
||||
/** x value stored in the GUI */
|
||||
public int xCached;
|
||||
|
||||
/** y value stored in the GUI */
|
||||
public int yCached;
|
||||
|
||||
/** z value stored in the GUI */
|
||||
public int zCached;
|
||||
|
||||
@Override
|
||||
|
@ -65,14 +71,8 @@ public class TileEntityControlPanel extends TileEntity implements ITileNetwork
|
|||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket()
|
||||
{
|
||||
//null
|
||||
}
|
||||
public void sendPacket() {}
|
||||
|
||||
@Override
|
||||
public void sendPacketWithRange()
|
||||
{
|
||||
//null
|
||||
}
|
||||
public void sendPacketWithRange() {}
|
||||
}
|
||||
|
|
|
@ -14,12 +14,12 @@ import com.google.common.io.ByteArrayDataInput;
|
|||
|
||||
import dan200.computer.api.IComputerAccess;
|
||||
import dan200.computer.api.IPeripheral;
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.IEnergizedItem;
|
||||
import mekanism.api.IEnergyAcceptor;
|
||||
import mekanism.api.IGasAcceptor;
|
||||
import mekanism.api.IGasStorage;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import mekanism.api.ITileNetwork;
|
||||
import net.minecraft.src.*;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
@ -245,12 +245,25 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
try {
|
||||
outputType = EnumGas.getFromName(dataStream.readUTF());
|
||||
} catch (Exception e)
|
||||
{
|
||||
System.out.println("[Mekanism] Error while handling tile entity packet.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
facing = dataStream.readInt();
|
||||
energyStored = dataStream.readInt();
|
||||
waterSlot.liquidStored = dataStream.readInt();
|
||||
oxygenStored = dataStream.readInt();
|
||||
hydrogenStored = dataStream.readInt();
|
||||
outputType = EnumGas.getFromName(dataStream.readUTF());
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
} catch (Exception e)
|
||||
{
|
||||
|
@ -262,13 +275,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public void sendPacket()
|
||||
{
|
||||
PacketHandler.sendTileEntityPacketToClients(this, 0, facing, energyStored, waterSlot.liquidStored, oxygenStored, hydrogenStored);
|
||||
PacketHandler.sendTileEntityPacketToClients(this, 0, facing, energyStored, waterSlot.liquidStored, oxygenStored, hydrogenStored, outputType.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketWithRange()
|
||||
{
|
||||
PacketHandler.sendTileEntityPacketToClients(this, 50, facing, energyStored, waterSlot.liquidStored, oxygenStored, hydrogenStored);
|
||||
PacketHandler.sendTileEntityPacketToClients(this, 50, facing, energyStored, waterSlot.liquidStored, oxygenStored, hydrogenStored, outputType.name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -491,6 +504,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
hydrogenStored = nbtTags.getInteger("hydrogenStored");
|
||||
oxygenStored = nbtTags.getInteger("oxygenStored");
|
||||
waterSlot.liquidStored = nbtTags.getInteger("waterStored");
|
||||
outputType = EnumGas.getFromName(nbtTags.getString("outputType"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -501,6 +515,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
nbtTags.setInteger("hydrogenStored", hydrogenStored);
|
||||
nbtTags.setInteger("oxygenStored", oxygenStored);
|
||||
nbtTags.setInteger("waterStored", waterSlot.liquidStored);
|
||||
nbtTags.setString("outputType", outputType.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,14 +5,26 @@ import universalelectricity.core.vector.Vector3;
|
|||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.IGasAcceptor;
|
||||
import mekanism.api.IGasStorage;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class TileEntityGasTank extends TileEntityContainerBlock implements IGasStorage, IGasAcceptor
|
||||
{
|
||||
/** The type of gas stored in this tank. */
|
||||
public EnumGas gasType;
|
||||
|
||||
/** The maximum amount of gas this tank can hold. */
|
||||
public int MAX_GAS = 96000;
|
||||
|
||||
/** How much gas this tank is currently storing. */
|
||||
public int gasStored;
|
||||
|
||||
/** How fast this tank can output gas. */
|
||||
public int output = 16;
|
||||
|
||||
public TileEntityGasTank()
|
||||
{
|
||||
super("Gas Tank");
|
||||
|
@ -20,14 +32,6 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
|
|||
inventory = new ItemStack[2];
|
||||
}
|
||||
|
||||
public EnumGas gasType;
|
||||
|
||||
public int MAX_GAS = 96000;
|
||||
|
||||
public int gasStored;
|
||||
|
||||
public int output = 16;
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
|
|
|
@ -9,11 +9,11 @@ import universalelectricity.core.implement.IItemElectric;
|
|||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import dan200.computer.api.IComputerAccess;
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.api.IEnergizedItem;
|
||||
import mekanism.api.IGasAcceptor;
|
||||
import mekanism.api.IGasStorage;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.api.IStorageTank.EnumGas;
|
||||
import net.minecraft.src.*;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
|
|
|
@ -14,8 +14,10 @@ import net.minecraft.src.*;
|
|||
|
||||
public class TileEntitySolarGenerator extends TileEntityGenerator
|
||||
{
|
||||
/** Whether or not this generator sees the sun. */
|
||||
public boolean seesSun = false;
|
||||
|
||||
/** How fast this tile entity generates energy. */
|
||||
public int GENERATION_RATE;
|
||||
|
||||
public TileEntitySolarGenerator()
|
||||
|
|
|
@ -68,6 +68,7 @@ public class GuiCredits extends GuiScreen {
|
|||
drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -2,9 +2,11 @@ package mekanism.client;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import mekanism.api.EnumGas;
|
||||
import mekanism.common.ContainerElectrolyticSeparator;
|
||||
import mekanism.common.ContainerHeatGenerator;
|
||||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.TileEntityElectrolyticSeparator;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
|
@ -20,6 +22,37 @@ public class GuiElectrolyticSeparator extends GuiContainer
|
|||
super(new ContainerElectrolyticSeparator(inventory, tentity));
|
||||
tileEntity = tentity;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void initGui()
|
||||
{
|
||||
controlList.clear();
|
||||
controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
if(!guibutton.enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(guibutton.id == 1)
|
||||
{
|
||||
if(tileEntity.outputType == EnumGas.OXYGEN)
|
||||
{
|
||||
tileEntity.outputType = EnumGas.HYDROGEN;
|
||||
}
|
||||
else if(tileEntity.outputType == EnumGas.HYDROGEN)
|
||||
{
|
||||
tileEntity.outputType = EnumGas.OXYGEN;
|
||||
}
|
||||
|
||||
PacketHandler.sendTileEntityPacketToServer(tileEntity, tileEntity.outputType.name);
|
||||
|
||||
outputButton.displayString = tileEntity.outputType.name;
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
|
|
|
@ -25,7 +25,7 @@ public class GuiSolarGenerator extends GuiContainer
|
|||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
|
||||
fontRenderer.drawString(tileEntity.fullName, tileEntity.fullName != "Advanced Solar Generator" ? 45 : 30, 6, 0x404040);
|
||||
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRenderer.drawString(MekanismUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY), 51, 26, 0x404040);
|
||||
fontRenderer.drawString("Sun: " + tileEntity.seesSun, 51, 35, 0x404040);
|
||||
|
|
Loading…
Reference in a new issue