Merge branch 'v9' into 1.8.9

That was fun.
This commit is contained in:
Ben Spiers committed 2016-02-10 00:47:27 +00:00
commit fce32c8820
12 files changed
+218 -272

No files matched your search

@@ -12,7 +12,6 @@ import mekanism.common.base.IBoundingBlock;
import mekanism.common.block.states.BlockStateBasic;
import mekanism.common.block.states.BlockStateBasic.BasicBlock;
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
import mekanism.common.block.states.BlockStateMachine.MachineBlock;
import mekanism.common.content.tank.TankUpdateProtocol;
import mekanism.common.inventory.InventoryBin;
import mekanism.common.item.ItemBlockBasic;
@@ -21,19 +20,12 @@ import mekanism.common.multiblock.IStructuralMultiblock;
import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityBin;
import mekanism.common.tile.TileEntityDynamicTank;
import mekanism.common.tile.TileEntityDynamicValve;
import mekanism.common.tile.TileEntityInductionCasing;
import mekanism.common.tile.TileEntityInductionCell;
import mekanism.common.tile.TileEntityInductionPort;
import mekanism.common.tile.TileEntityInductionProvider;
import mekanism.common.tile.TileEntitySolarEvaporationBlock;
import mekanism.common.tile.TileEntitySolarEvaporationController;
import mekanism.common.tile.TileEntitySolarEvaporationValve;
import mekanism.common.tile.TileEntityStructuralGlass;
import mekanism.common.util.MekanismUtils;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
@@ -83,6 +75,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
* 1:2: Induction Port
* 1:3: Induction Cell
* 1:4: Induction Provider
* 1:5: Superheating Element
* 1:6: Boiler Casing
* 1:7: Boiler Valve
* @author AidanBrady
*
*/
@@ -118,7 +113,7 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
return new BlockStateBasic(this, getProperty());
}
public PropertyEnum<BasicBlockType> getProperty()
public PropertyEnum<BlockStateBasic.BasicBlockType> getProperty()
{
return getBasicBlock().getProperty();
}
@@ -126,7 +121,7 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
@Override
public IBlockState getStateFromMeta(int meta)
{
BasicBlockType type = BasicBlockType.getBlockType(getBasicBlock(), meta&0xF);
BlockStateBasic.BasicBlockType type = BlockStateBasic.BasicBlockType.get(getBasicBlock(), meta&0xF);
return this.getDefaultState().withProperty(getProperty(), type);
}
@@ -134,7 +129,7 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
@Override
public int getMetaFromState(IBlockState state)
{
BasicBlockType type = state.getValue(getProperty());
BlockStateBasic.BasicBlockType type = state.getValue(getProperty());
return type.meta;
}
/*
@@ -230,6 +225,7 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
ctms[4][1] = new CTMData("ctm/InductionProviderAdvanced", this, Arrays.asList(3, 4)).registerIcons(register).setRenderConvexConnections();
ctms[4][2] = new CTMData("ctm/InductionProviderElite", this, Arrays.asList(3, 4)).registerIcons(register).setRenderConvexConnections();
ctms[4][3] = new CTMData("ctm/InductionProviderUltimate", this, Arrays.asList(3, 4)).registerIcons(register).setRenderConvexConnections();
ctms[5][0] = new CTMData("ctm/SuperheatingElement", this, Arrays.asList(5)).registerIcons(register).setRenderConvexConnections();
icons[0][0] = ctms[0][0].mainTextureData.icon;
icons[1][0] = ctms[1][0].mainTextureData.icon;
@@ -243,6 +239,7 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
icons[4][1] = ctms[4][1].mainTextureData.icon;
icons[4][2] = ctms[4][2].mainTextureData.icon;
icons[4][3] = ctms[4][3].mainTextureData.icon;
icons[5][0] = ctms[5][0].mainTextureData.icon;
break;
}
@@ -289,6 +286,8 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
case 4:
TileEntityInductionProvider tileEntity2 = (TileEntityInductionProvider)world.getTileEntity(pos);
return icons[meta][tileEntity2.tier.ordinal()];
case 5:
return icons[meta][0];
default:
return getIcon(side, meta);
}
@@ -347,7 +346,7 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
break;
case BASIC_BLOCK_2:
for(int i = 0; i < 5; i++)
for(int i = 0; i < 6; i++)
{
if(i == 3)
{
@@ -767,38 +766,9 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
@Override
public boolean hasTileEntity(IBlockState state)
{
int metadata = state.getBlock().getMetaFromState(state);
switch(getBasicBlock())
{
case BASIC_BLOCK_1:
switch(metadata)
{
case 6:
case 9:
case 10:
case 11:
case 12:
case 14:
case 15:
return true;
default:
return false;
}
case BASIC_BLOCK_2:
switch(metadata)
{
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
}
default:
return false;
}
BasicBlockType type = BasicBlockType.get(state);
return type != null && type.tileEntityClass != null;
}
@Override
@@ -818,46 +788,12 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
@Override
public TileEntity createTileEntity(World world, IBlockState state)
{
int metadata = state.getBlock().getMetaFromState(state);
switch(getBasicBlock())
if(BasicBlockType.get(state) == null)
{
case BASIC_BLOCK_1:
switch(metadata)
{
case 6:
return new TileEntityBin();
case 9:
return new TileEntityDynamicTank();
case 10:
return new TileEntityStructuralGlass();
case 11:
return new TileEntityDynamicValve();
case 14:
return new TileEntitySolarEvaporationController();
case 15:
return new TileEntitySolarEvaporationValve();
default:
return null;
}
case BASIC_BLOCK_2:
switch(metadata)
{
case 0:
return new TileEntitySolarEvaporationBlock();
case 1:
return new TileEntityInductionCasing();
case 2:
return new TileEntityInductionPort();
case 3:
return new TileEntityInductionCell();
case 4:
return new TileEntityInductionProvider();
default:
return null;
}
default:
return null;
return null;
}
return BasicBlockType.get(state).create();
}
@Override
@@ -1,8 +1,9 @@
package mekanism.common.block.states;
import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
import mekanism.common.block.BlockBasic;
import mekanism.common.block.BlockMachine;
import mekanism.common.util.LangUtils;
import net.minecraft.block.Block;
import net.minecraft.block.properties.PropertyBool;
@@ -11,6 +12,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumFacing.Plane;
import net.minecraft.util.IStringSerializable;
@@ -33,7 +35,6 @@ public class BlockStateBasic extends BlockStateFacing
BASIC_BLOCK_1,
BASIC_BLOCK_2;
public BlockBasic implBlock;
private PropertyEnum<BasicBlockType> predicatedProperty;
public PropertyEnum<BasicBlockType> getProperty()
@@ -61,63 +62,111 @@ public class BlockStateBasic extends BlockStateFacing
public static enum BasicBlockType implements IStringSerializable
{
OSMIUM_BLOCK(BasicBlock.BASIC_BLOCK_1, 0, Predicates.<EnumFacing>alwaysFalse(), false),
BRONZE_BLOCK(BasicBlock.BASIC_BLOCK_1, 1, Predicates.<EnumFacing>alwaysFalse(), false),
REFINED_OBSIDIAN(BasicBlock.BASIC_BLOCK_1, 2, Predicates.<EnumFacing>alwaysFalse(), false),
COAL_BLOCK(BasicBlock.BASIC_BLOCK_1, 3, Predicates.<EnumFacing>alwaysFalse(), false),
REFINED_GLOWSTONE(BasicBlock.BASIC_BLOCK_1, 4, Predicates.<EnumFacing>alwaysFalse(), false),
STEEL_BLOCK(BasicBlock.BASIC_BLOCK_1, 5, Predicates.<EnumFacing>alwaysFalse(), false),
BIN(BasicBlock.BASIC_BLOCK_1, 6, Plane.HORIZONTAL, false),
TELEPORTER_FRAME(BasicBlock.BASIC_BLOCK_1, 7, Predicates.<EnumFacing>alwaysFalse(), false),
STEEL_CASING(BasicBlock.BASIC_BLOCK_1, 8, Predicates.<EnumFacing>alwaysFalse(), false),
DYNAMIC_TANK(BasicBlock.BASIC_BLOCK_1, 9, Predicates.<EnumFacing>alwaysFalse(), false),
STRUCTURAL_GLASS(BasicBlock.BASIC_BLOCK_1, 10, Predicates.<EnumFacing>alwaysFalse(), false),
DYNAMIC_VALVE(BasicBlock.BASIC_BLOCK_1, 11, Predicates.<EnumFacing>alwaysFalse(), false),
COPPER_BLOCK(BasicBlock.BASIC_BLOCK_1, 12, Predicates.<EnumFacing>alwaysFalse(), false),
TIN_BLOCK(BasicBlock.BASIC_BLOCK_1, 13, Predicates.<EnumFacing>alwaysFalse(), false),
SOLAR_EVAPORATION_CONTROLLER(BasicBlock.BASIC_BLOCK_1, 14, Plane.HORIZONTAL, false),
SOLAR_EVAPORATION_VALVE(BasicBlock.BASIC_BLOCK_1, 15, Predicates.<EnumFacing>alwaysFalse(), false),
SOLAR_EVAPORATION_BLOCK(BasicBlock.BASIC_BLOCK_2, 0, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_CASING(BasicBlock.BASIC_BLOCK_2, 1, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_PORT(BasicBlock.BASIC_BLOCK_2, 2, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_CELL(BasicBlock.BASIC_BLOCK_2, 3, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_PROVIDER(BasicBlock.BASIC_BLOCK_2, 4, Predicates.<EnumFacing>alwaysFalse(), false);
OSMIUM_BLOCK(BasicBlock.BASIC_BLOCK_1, 0, "OsmiumBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
BRONZE_BLOCK(BasicBlock.BASIC_BLOCK_1, 1, "BronzeBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
REFINED_OBSIDIAN(BasicBlock.BASIC_BLOCK_1, 2, "RefinedObsidian", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
COAL_BLOCK(BasicBlock.BASIC_BLOCK_1, 3, "CharcoalBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
REFINED_GLOWSTONE(BasicBlock.BASIC_BLOCK_1, 4, "RefinedGlowstone", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
STEEL_BLOCK(BasicBlock.BASIC_BLOCK_1, 5, "SteelBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
BIN(BasicBlock.BASIC_BLOCK_1, 6, "Bin", null, false, Plane.HORIZONTAL, false),
TELEPORTER_FRAME(BasicBlock.BASIC_BLOCK_1, 7, "TeleporterFrame", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
STEEL_CASING(BasicBlock.BASIC_BLOCK_1, 8, "SteelCasing", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
DYNAMIC_TANK(BasicBlock.BASIC_BLOCK_1, 9, "DynamicTank", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
STRUCTURAL_GLASS(BasicBlock.BASIC_BLOCK_1, 10, "StructuralGlass", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
DYNAMIC_VALVE(BasicBlock.BASIC_BLOCK_1, 11, "DynamicValve", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
COPPER_BLOCK(BasicBlock.BASIC_BLOCK_1, 12, "CopperBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
TIN_BLOCK(BasicBlock.BASIC_BLOCK_1, 13, "TinBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
SOLAR_EVAPORATION_CONTROLLER(BasicBlock.BASIC_BLOCK_1, 14, "SolarEvaporationController", null, false, Plane.HORIZONTAL, false),
SOLAR_EVAPORATION_VALVE(BasicBlock.BASIC_BLOCK_1, 15, "SolarEvaporationValve", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
SOLAR_EVAPORATION_BLOCK(BasicBlock.BASIC_BLOCK_2, 0, "SolarEvaporationBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_CASING(BasicBlock.BASIC_BLOCK_2, 1, "InductionCasing", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_PORT(BasicBlock.BASIC_BLOCK_2, 2, "InductionPort", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_CELL(BasicBlock.BASIC_BLOCK_2, 3, "InductionCell", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
INDUCTION_PROVIDER(BasicBlock.BASIC_BLOCK_2, 4, "InductionProvider", null, false, Predicates.<EnumFacing>alwaysFalse(), false),
SUPERHEATING_ELEMENT(BasicBlock.BASIC_BLOCK_2, 5, "SuperheatingElement", null, true, Predicates.<EnumFacing>alwaysFalse(), false);
//BOILER_CASING(BasicBlock.BASIC_BLOCK_2, 6, "BoilerCasing", TileEntityBoilerCasing.class, true, Predicates.<EnumFacing>alwaysFalse(), false),
//BOILER_VALVE(BasicBlock.BASIC_BLOCK_2, 7, "BoilerValve", TileEntityBoilerValve.class, true, Predicates.<EnumFacing>alwaysFalse(), false);
public BasicBlock blockType;
public int meta;
public String name;
public Class<? extends TileEntity> tileEntityClass;
public boolean isElectric;
public boolean hasDescription;
public Predicate<EnumFacing> facingPredicate;
public boolean activable;
private BasicBlockType(BasicBlock block, int metadata, Predicate<EnumFacing> facingAllowed, boolean activeState)
private BasicBlockType(BasicBlock block, int metadata, String s, Class<? extends TileEntity> tileClass, boolean hasDesc, Predicate<EnumFacing> facingAllowed, boolean activeState)
{
blockType = block;
meta = metadata;
name = s;
tileEntityClass = tileClass;
hasDescription = hasDesc;
facingPredicate = facingAllowed;
activable = activeState;
}
public static BasicBlockType getBlockType(BasicBlock blockID, int metadata)
public static BasicBlockType get(IBlockState state)
{
BasicBlockType firstTry = values()[blockID.ordinal() << 4 | metadata];
if(firstTry.blockType == blockID && firstTry.meta == metadata)
Block b = state.getBlock();
int m = b.getMetaFromState(state);
return get(b, m);
}
public static BasicBlockType get(ItemStack stack)
{
return get(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage());
}
public static BasicBlockType get(Block block, int meta)
{
if(block instanceof BlockBasic)
{
return get(((BlockBasic)block).getBasicBlock(), meta);
}
return null;
}
public static BasicBlockType get(BasicBlock blockType, int metadata)
{
BasicBlockType firstTry = values()[blockType.ordinal() << 4 | metadata];
if(firstTry.blockType == blockType && firstTry.meta == metadata)
return firstTry;
for(BasicBlockType type : values())
{
if(type.blockType == blockID && type.meta == metadata)
if(type.blockType == blockType && type.meta == metadata)
return type;
}
return null;
}
public TileEntity create()
{
try {
return tileEntityClass.newInstance();
} catch(Exception e) {
Mekanism.logger.error("Unable to indirectly create tile entity.");
e.printStackTrace();
return null;
}
}
@Override
public String getName()
{
return name().toLowerCase();
}
public String getDescription()
{
return LangUtils.localize("tooltip." + name);
}
public ItemStack getStack(int amount)
{
return new ItemStack(blockType.implBlock, amount, meta);
return new ItemStack(blockType.getBlock(), amount, meta);
}
public boolean canRotateTo(EnumFacing side)
@@ -1,19 +1,13 @@
package mekanism.common.content.boiler;
import mekanism.api.Coord4D;
import mekanism.common.content.tank.SynchronizedTankData;
import mekanism.common.multiblock.MultiblockCache;
import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fluids.FluidStack;
import java.util.HashMap;
public class BoilerCache extends MultiblockCache<SynchronizedBoilerData>
{
public ItemStack[] inventory = new ItemStack[2];
@@ -8,11 +8,14 @@ import mekanism.api.EnumColor;
import mekanism.api.Range4D;
import mekanism.api.energy.IEnergizedItem;
import mekanism.api.energy.IStrictEnergyStorage;
import mekanism.client.MekKeyHandler;
import mekanism.client.MekanismKeyHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.InductionCellTier;
import mekanism.common.Tier.InductionProviderTier;
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
import mekanism.common.inventory.InventoryBin;
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
import mekanism.common.tile.TileEntityBin;
@@ -24,6 +27,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@@ -58,6 +62,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
* 1:2: Induction Port
* 1:3: Induction Cell
* 1:4: Induction Provider
* 1:5: Superheating Element
* 1:6: Boiler Casing
* 1:7: Boiler Valve
* @author AidanBrady
*
*/
@@ -131,59 +138,66 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag)
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock && itemstack.getItemDamage() == 6)
BasicBlockType type = BasicBlockType.get(itemstack);
if(type.hasDescription)
{
InventoryBin inv = new InventoryBin(itemstack);
if(inv.getItemCount() > 0)
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
{
list.add(EnumColor.BRIGHT_GREEN + inv.getItemType().getDisplayName());
list.add(EnumColor.INDIGO + "Item amount: " + EnumColor.GREY + inv.getItemCount());
if(type == BasicBlockType.BIN)
{
InventoryBin inv = new InventoryBin(itemstack);
if(inv.getItemCount() > 0)
{
list.add(EnumColor.BRIGHT_GREEN + inv.getItemType().getDisplayName());
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.itemAmount") + ": " + EnumColor.GREY + inv.getItemCount());
}
else {
list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty"));
}
}
else if(type == BasicBlockType.INDUCTION_CELL)
{
InductionCellTier tier = InductionCellTier.values()[getTier(itemstack).ordinal()];
list.add(tier.getBaseTier().getColor() + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.maxEnergy));
}
else if(type == BasicBlockType.INDUCTION_PROVIDER)
{
InductionProviderTier tier = InductionProviderTier.values()[getTier(itemstack).ordinal()];
list.add(tier.getBaseTier().getColor() + LangUtils.localize("tooltip.outputRate") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.output));
}
if(getMaxEnergy(itemstack) > 0)
{
list.add(EnumColor.BRIGHT_GREEN + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
}
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + ".");
}
else {
list.add(EnumColor.DARK_RED + "Empty");
list.addAll(MekanismUtils.splitTooltip(type.getDescription(), itemstack));
}
}
else if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2)
{
if(itemstack.getItemDamage() == 3)
{
InductionCellTier tier = InductionCellTier.values()[getTier(itemstack).ordinal()];
list.add(tier.getBaseTier().getColor() + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.maxEnergy));
}
else if(itemstack.getItemDamage() == 4)
{
InductionProviderTier tier = InductionProviderTier.values()[getTier(itemstack).ordinal()];
list.add(tier.getBaseTier().getColor() + LangUtils.localize("tooltip.outputRate") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.output));
}
}
if(getMaxEnergy(itemstack) > 0)
{
list.add(EnumColor.BRIGHT_GREEN + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
}
}
@Override
public boolean hasContainerItem(ItemStack stack)
{
return stack.getItemDamage() == 6 && stack.getTagCompound() != null && stack.getTagCompound().hasKey("newCount");
return BasicBlockType.get(stack) == BasicBlockType.BIN && stack.getTagCompound() != null && stack.getTagCompound().hasKey("newCount");
}
/*
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock)
if(BasicType.get(stack) != BasicType.BIN)
{
if(stack.getItemDamage() != 6)
{
return true;
}
return true;
}
if(stack.getTagCompound() == null || !stack.getTagCompound().hasKey("newCount"))
@@ -198,9 +212,9 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
@Override
public ItemStack getContainerItem(ItemStack stack)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock)
if(BasicBlockType.get(stack) == BasicBlockType.BIN)
{
if(stack.getItemDamage() != 6 || stack.getTagCompound() == null || !stack.getTagCompound().hasKey("newCount"))
if(stack.getTagCompound() == null || !stack.getTagCompound().hasKey("newCount"))
{
return null;
}
@@ -221,47 +235,43 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
if(place)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock)
BasicBlockType type = BasicBlockType.get(stack);
if(type == BasicBlockType.BIN && stack.getTagCompound() != null)
{
if(stack.getItemDamage() == 6 && stack.getTagCompound() != null)
TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(pos);
InventoryBin inv = new InventoryBin(stack);
if(inv.getItemType() != null)
{
TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(pos);
InventoryBin inv = new InventoryBin(stack);
tileEntity.setItemType(inv.getItemType());
}
if(inv.getItemType() != null)
{
tileEntity.setItemType(inv.getItemType());
}
tileEntity.setItemCount(inv.getItemCount());
}
else if(type == BasicBlockType.INDUCTION_CELL)
{
TileEntityInductionCell tileEntity = (TileEntityInductionCell)world.getTileEntity(pos);
tileEntity.tier = InductionCellTier.values()[getTier(stack).ordinal()];
tileEntity.setItemCount(inv.getItemCount());
if(!world.isRemote)
{
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(tileEntity)));
}
}
else if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2)
else if(type == BasicBlockType.INDUCTION_PROVIDER)
{
if(stack.getItemDamage() == 3)
TileEntityInductionProvider tileEntity = (TileEntityInductionProvider)world.getTileEntity(pos);
tileEntity.tier = InductionProviderTier.values()[getTier(stack).ordinal()];
if(!world.isRemote)
{
TileEntityInductionCell tileEntity = (TileEntityInductionCell)world.getTileEntity(pos);
tileEntity.tier = InductionCellTier.values()[getTier(stack).ordinal()];
if(!world.isRemote)
{
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tileEntity)));
}
}
else if(stack.getItemDamage() == 4)
{
TileEntityInductionProvider tileEntity = (TileEntityInductionProvider)world.getTileEntity(pos);
tileEntity.tier = InductionProviderTier.values()[getTier(stack).ordinal()];
if(!world.isRemote)
{
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tileEntity)));
}
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(tileEntity)));
}
}
TileEntity tileEntity = world.getTileEntity(pos);
if(tileEntity instanceof IStrictEnergyStorage && !(tileEntity instanceof TileEntityMultiblock<?>))
{
((IStrictEnergyStorage)tileEntity).setEnergy(getEnergy(stack));
@@ -270,98 +280,35 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
return place;
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock)
if(BasicBlockType.get(itemstack) != null)
{
switch(itemstack.getItemDamage())
{
case 0:
name = "OsmiumBlock";
break;
case 1:
name = "BronzeBlock";
break;
case 2:
name = "RefinedObsidian";
break;
case 3:
name = "CharcoalBlock";
break;
case 4:
name = "RefinedGlowstone";
break;
case 5:
name = "SteelBlock";
break;
case 6:
name = "Bin";
break;
case 7:
name = "TeleporterFrame";
break;
case 8:
name = "SteelCasing";
break;
case 9:
name = "DynamicTank";
break;
case 10:
name = "StructuralGlass";
break;
case 11:
name = "DynamicValve";
break;
case 12:
name = "CopperBlock";
break;
case 13:
name = "TinBlock";
break;
case 14:
name = "SolarEvaporationController";
break;
case 15:
name = "SolarEvaporationValve";
break;
default:
name = "Unknown";
break;
}
}
else if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2)
{
switch(itemstack.getItemDamage())
{
case 0:
name = "SolarEvaporationBlock";
break;
case 1:
name = "InductionCasing";
break;
case 2:
name = "InductionPort";
break;
case 3:
name = "InductionCell" + getTier(itemstack).getName();
break;
case 4:
name = "InductionProvider" + getTier(itemstack).getName();
break;
}
return getUnlocalizedName() + "." + BasicBlockType.get(itemstack).name;
}
return getUnlocalizedName() + "." + name;
return "null";
}
@Override
public String getItemStackDisplayName(ItemStack itemstack)
{
BasicBlockType type = BasicBlockType.get(itemstack);
if(type == BasicBlockType.INDUCTION_CELL || type == BasicBlockType.INDUCTION_PROVIDER)
{
return getTier(itemstack).getLocalizedName() + " " + super.getItemStackDisplayName(itemstack);
}
return super.getItemStackDisplayName(itemstack);
}
@Override
public double getEnergy(ItemStack itemStack)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2 && itemStack.getItemDamage() == 3)
if(BasicBlockType.get(itemStack) == BasicBlockType.INDUCTION_CELL)
{
if(itemStack.getTagCompound() == null)
{
@@ -377,7 +324,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
@Override
public void setEnergy(ItemStack itemStack, double amount)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2 && itemStack.getItemDamage() == 3)
if(BasicBlockType.get(itemStack) == BasicBlockType.INDUCTION_CELL)
{
if(itemStack.getTagCompound() == null)
{
@@ -391,7 +338,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
@Override
public double getMaxEnergy(ItemStack itemStack)
{
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2 && itemStack.getItemDamage() == 3)
if(BasicBlockType.get(itemStack) == BasicBlockType.INDUCTION_CELL)
{
return InductionCellTier.values()[getTier(itemStack).ordinal()].maxEnergy;
}
@@ -160,7 +160,7 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
return structure != null ? structure.getEnergy(worldObj) : 0;
}
else {
return structure.clientEnergy;
return structure != null ? structure.clientEnergy : 0;
}
}
@@ -1,6 +1,5 @@
package mekanism.generators.common.tile.turbine;
package mekanism.common.tile;
import mekanism.common.tile.TileEntityBasicBlock;
public class TileEntityPressureDisperser extends TileEntityBasicBlock
{
@@ -5,6 +5,7 @@ import mekanism.common.Mekanism;
import mekanism.common.base.IGuiProvider;
import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.tile.TileEntityContainerBlock;
import mekanism.common.tile.TileEntityPressureDisperser;
import mekanism.generators.common.inventory.container.ContainerBioGenerator;
import mekanism.generators.common.inventory.container.ContainerGasGenerator;
import mekanism.generators.common.inventory.container.ContainerHeatGenerator;
@@ -26,7 +27,6 @@ import mekanism.generators.common.tile.reactor.TileEntityReactorLogicAdapter;
import mekanism.generators.common.tile.reactor.TileEntityReactorNeutronCapture;
import mekanism.generators.common.tile.reactor.TileEntityReactorPort;
import mekanism.generators.common.tile.turbine.TileEntityElectromagneticCoil;
import mekanism.generators.common.tile.turbine.TileEntityPressureDisperser;
import mekanism.generators.common.tile.turbine.TileEntityRotationalComplex;
import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing;
import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
@@ -20,6 +20,7 @@ import mekanism.common.multiblock.IMultiblock;
import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityContainerBlock;
import mekanism.common.tile.TileEntityElectricBlock;
import mekanism.common.tile.TileEntityPressureDisperser;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.generators.common.GeneratorsBlocks;
@@ -32,7 +33,6 @@ import mekanism.generators.common.tile.TileEntityHeatGenerator;
import mekanism.generators.common.tile.TileEntitySolarGenerator;
import mekanism.generators.common.tile.TileEntityWindGenerator;
import mekanism.generators.common.tile.turbine.TileEntityElectromagneticCoil;
import mekanism.generators.common.tile.turbine.TileEntityPressureDisperser;
import mekanism.generators.common.tile.turbine.TileEntityRotationalComplex;
import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing;
import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
@@ -9,11 +9,11 @@ import mekanism.common.content.tank.TankUpdateProtocol;
import mekanism.common.multiblock.MultiblockCache;
import mekanism.common.multiblock.MultiblockManager;
import mekanism.common.multiblock.UpdateProtocol;
import mekanism.common.tile.TileEntityPressureDisperser;
import mekanism.generators.common.GeneratorsBlocks;
import mekanism.generators.common.MekanismGenerators;
import mekanism.generators.common.block.BlockGenerator.GeneratorType;
import mekanism.generators.common.tile.turbine.TileEntityElectromagneticCoil;
import mekanism.generators.common.tile.turbine.TileEntityPressureDisperser;
import mekanism.generators.common.tile.turbine.TileEntityRotationalComplex;
import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing;
import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
@@ -97,6 +97,9 @@ tile.BasicBlock2.InductionProviderBasic.name=Basic Induction Provider
tile.BasicBlock2.InductionProviderAdvanced.name=Advanced Induction Provider
tile.BasicBlock2.InductionProviderElite.name=Elite Induction Provider
tile.BasicBlock2.InductionProviderUltimate.name=Ultimate Induction Provider
tile.BasicBlock3.SuperheatingElement.name=Superheating Element
tile.BasicBlock3.BoilerCasing.name=Boiler Casing
tile.BasicBlock3.BoilerValve.name=Boiler Valve
//Machine Block
tile.MachineBlock.EnrichmentChamber.name=Enrichment Chamber
@@ -689,6 +692,7 @@ tooltip.readyForReaction=Ready for Reaction
tooltip.speed=Speed
tooltip.and=and
tooltip.heat=Heat
tooltip.itemAmount=Item amount
tooltip.portableTank.bucketMode=Bucket Mode
@@ -719,6 +723,23 @@ tooltip.flamethrower.modeBump=Flamethrower mode bumped to
tooltip.seismicReader.needsEnergy=Not enough energy to interpret vibration
tooltip.seismicReader.noVibrations=Unable to discover any vibrations
tooltip.Bin=A block used to store large quantities of a single type of item.
tooltip.TeleporterFrame=The frame used to construct the Teleporter multiblock, allowing a portal to be generated within the structure.
tooltip.SteelCasing=A sturdy, steel-based casing used as a foundation for machinery.
tooltip.DynamicTank=The casing used in the Dynamic Tank multiblock, a structure capable of storing great amounts of fluid.
tooltip.StructuralGlass=An advanced, reinforced material of glass that drops when broken and can be used in the structure of any applicable multiblock.
tooltip.DynamicValve=A valve that can be placed on a Dynamic Tank multiblock, allowing for fluids to be inserted and extracted via external piping.
tooltip.SolarEvaporationController=The controller for a Solar Evaporation Plant, acting as the master block of the structure. Only one of these should be placed on a multiblock.
tooltip.SolarEvaporationValve=A valve that can be placed on a Solar Evaporation Plant multiblock, allowing for fluids to be inserted and extracted via external piping.
tooltip.SolarEvaporationBlock=A copper-alloyed casing used in the structure of a Solar Evaporation Plant, using its advanced material to conduct the great amounts of heat necessary for processing.
tooltip.InductionCasing=A type of energy-resistant casing used in the creation of an Energized Induction Matrix multiblock.
tooltip.InductionPort=A port that can be placed on an Energized Induction Matrix multiblock, allowing for energy to be inserted from and output to external cabling.
tooltip.InductionCell=A highly conductive energy capacitor capable of storing massive amounts of energy in a single block. Housed in an Energized Induction Matrix to expand the multiblock's energy storage.
tooltip.InductionProvider=An advanced complex of coolant systems, conductors and transformers capable of expanding the Energized Induction Matrix's maximum rate of energy transfer.
tooltip.SuperheatingElement=A modular, somewhat dangerous radiator that is capable of emitting massive amounts of heat to its surroundings.
tooltip.BoilerCasing=A pressure-resistant, dense casing used in the creation of a Thermoelectric Boiler multiblock.
tooltip.BoilerValve=A valve that can be placed on a Thermoelectric Boiler multiblock, allowing for the insertion of energy and water along with the extraction of produced steam.
tooltip.EnrichmentChamber=A simple machine used to enrich ores into two of their dust counterparts, as well as perform many other operations.
tooltip.OsmiumCompressor=A fairly advanced machine used to compress osmium into various dusts in order to create their ingot counterparts.
tooltip.Combiner=A machine used to combine dusts and cobblestone to form their ore counterparts.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB