Moved tank to Archaic tier

This commit is contained in:
Calclavia 2014-02-28 21:56:11 +08:00
parent a9c445c140
commit d28bbbdeb4
33 changed files with 92 additions and 396 deletions

View file

@ -23,6 +23,8 @@ import resonantinduction.archaic.fluid.grate.BlockGrate;
import resonantinduction.archaic.fluid.grate.TileGrate;
import resonantinduction.archaic.fluid.gutter.BlockGutter;
import resonantinduction.archaic.fluid.gutter.TileGutter;
import resonantinduction.archaic.fluid.tank.BlockTank;
import resonantinduction.archaic.fluid.tank.TileTank;
import resonantinduction.archaic.process.BlockCastingMold;
import resonantinduction.archaic.process.BlockMillstone;
import resonantinduction.archaic.process.TileCastingMold;
@ -33,6 +35,7 @@ import resonantinduction.core.Settings;
import resonantinduction.core.TabRI;
import resonantinduction.core.prefab.imprint.ItemImprint;
import resonantinduction.core.resource.ItemHandCrank;
import resonantinduction.mechanical.fluid.pipe.ItemBlockFluidContainer;
import calclavia.lib.content.ContentRegistry;
import calclavia.lib.network.PacketAnnotation;
import calclavia.lib.network.PacketHandler;
@ -93,6 +96,7 @@ public class Archaic
// Fluid
public static Block blockGrate;
public static Block blockGutter;
public static Block blockTank;
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
@ -110,6 +114,7 @@ public class Archaic
blockGutter = contentRegistry.createTile(BlockGutter.class, TileGutter.class);
blockGrate = contentRegistry.createTile(BlockGrate.class, TileGrate.class);
blockFilter = contentRegistry.createTile(BlockFilter.class, TileFilter.class);
blockTank = contentRegistry.createBlock(BlockTank.class, ItemBlockFluidContainer.class, TileTank.class);
itemHandCrank = contentRegistry.createItem(ItemHandCrank.class);
itemImprint = contentRegistry.createItem(ItemImprint.class);
@ -152,6 +157,8 @@ public class Archaic
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrate, "WBW", "B B", "WBW", 'B', Block.fenceIron, 'W', "plankWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(blockHotPlate, "SSS", "III", 'I', Item.ingotIron, 'S', Block.stone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockMillstone, "SPS", "SAS", "SSS", 'P', Block.pistonBase, 'A', Item.pickaxeStone, 'S', Block.stone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockTank, "GGG", "GSG", "GGG", 'G', Block.glass, 'S', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(itemHandCrank, "S ", "SSS", " S", 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(itemImprint, "PPP", "PIP", "PPP", 'P', Item.paper, 'I', new ItemStack(Item.dyePowder, 0)));
GameRegistry.addRecipe(new ShapedOreRecipe(itemHammer, "CC ", "CS ", " S", 'C', Block.cobblestone, 'S', Item.stick));

View file

@ -1,6 +1,13 @@
package resonantinduction.archaic;
import resonantinduction.archaic.fluid.tank.RenderTank;
import calclavia.lib.render.item.GlobalItemRenderer;
public class ClientProxy extends CommonProxy
{
@Override
public void preInit()
{
GlobalItemRenderer.register(Archaic.blockTank.blockID, RenderTank.INSTANCE);
}
}

View file

@ -5,11 +5,9 @@ import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import resonantinduction.api.IFilterable;
import resonantinduction.core.prefab.imprint.BlockImprintable;
/**

View file

@ -16,7 +16,6 @@ import resonantinduction.core.prefab.imprint.TileFilterable;
import resonantinduction.core.resource.ResourceGenerator;
import resonantinduction.core.resource.fluid.BlockFluidMixture;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.prefab.tile.TileExternalInventory;
import calclavia.lib.utility.LanguageUtility;
import calclavia.lib.utility.inventory.InventoryUtility;

View file

@ -79,7 +79,7 @@ public class RenderGutter extends TileEntitySpecialRenderer implements ISimpleIt
if (liquid != null && liquid.amount > 0)
{
float percentage = (float) liquid.amount / (float) capacity;
float percentage = Math.min((float) liquid.amount / (float) capacity, 1);
int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, tile.worldObj, false);
bindTexture(RenderFluidHelper.getFluidSheet(liquid));

View file

@ -6,6 +6,7 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import resonantinduction.api.mechanical.fluid.IFluidNetwork;
import resonantinduction.api.mechanical.fluid.IFluidPipe;
@ -20,29 +21,20 @@ public class TileGutter extends TileFluidNetwork implements IFluidPipe
getInternalTank().setCapacity(FluidContainerRegistry.BUCKET_VOLUME);
}
@Override
public void updateEntity()
{
super.updateEntity();
}
@Override
public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side)
{
if (!this.worldObj.isRemote)
{
if (tileEntity instanceof IFluidPipe)
if (tileEntity instanceof TileGutter)
{
if (tileEntity instanceof TileGutter)
{
getNetwork().merge(((TileGutter) tileEntity).getNetwork());
this.setRenderSide(side, true);
connectedBlocks[side.ordinal()] = tileEntity;
}
getNetwork().merge(((TileGutter) tileEntity).getNetwork());
setRenderSide(side, true);
connectedBlocks[side.ordinal()] = tileEntity;
}
else if (tileEntity instanceof IFluidHandler)
{
this.setRenderSide(side, true);
setRenderSide(side, true);
connectedBlocks[side.ordinal()] = tileEntity;
}
}
@ -62,16 +54,14 @@ public class TileGutter extends TileFluidNetwork implements IFluidPipe
this.network = new PipeNetwork();
this.network.addConnector(this);
}
return this.network;
}
@Override
public void setNetwork(IFluidNetwork network)
{
if (network instanceof PipeNetwork)
{
this.network = network;
}
this.network = network;
}
@Override
@ -120,7 +110,7 @@ public class TileGutter extends TileFluidNetwork implements IFluidPipe
onFluidChanged();
return fill;
}
return 0;
}
@ -151,4 +141,10 @@ public class TileGutter extends TileFluidNetwork implements IFluidPipe
{
return from != ForgeDirection.UP && !fluid.isGaseous();
}
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from)
{
return new FluidTankInfo[] { getInternalTank().getInfo() };
}
}

View file

@ -20,8 +20,6 @@ import universalelectricity.api.CompatibilityModule;
import universalelectricity.api.electricity.IElectricalNetwork;
import universalelectricity.api.energy.IConductor;
import universalelectricity.api.energy.IEnergyNetwork;
import universalelectricity.api.energy.UnitDisplay;
import universalelectricity.api.energy.UnitDisplay.Unit;
import universalelectricity.api.net.IConnector;
import atomicscience.api.ITemperature;
import calclavia.lib.network.IPacketReceiver;

View file

@ -12,8 +12,6 @@ import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import universalelectricity.api.energy.UnitDisplay;
import universalelectricity.api.energy.UnitDisplay.Unit;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.render.item.ISimpleItemRenderer;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid.tank;
package resonantinduction.archaic.fluid.tank;
import java.util.ArrayList;
import java.util.List;

View file

@ -4,7 +4,7 @@
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package resonantinduction.mechanical.fluid.tank;
package resonantinduction.archaic.fluid.tank;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid.tank;
package resonantinduction.archaic.fluid.tank;
import java.awt.Color;
@ -9,9 +9,9 @@ import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
import resonantinduction.archaic.Archaic;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.render.RenderFluidHelper;
import resonantinduction.mechanical.Mechanical;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.render.item.ISimpleItemRenderer;
import cpw.mods.fml.relauncher.Side;
@ -55,7 +55,7 @@ public class RenderTank extends TileEntitySpecialRenderer implements ISimpleItem
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
RenderUtility.renderBlockWithConnectedTextures(renderSides, Mechanical.blockTank, null, ResonantInduction.blockMachinePart, null);
RenderUtility.renderBlockWithConnectedTextures(renderSides, Archaic.blockTank, null, ResonantInduction.blockMachinePart, null);
GL11.glPopMatrix();
if (fluid != null)

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid.tank;
package resonantinduction.archaic.fluid.tank;
import java.util.LinkedHashSet;
import java.util.Set;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid.tank;
package resonantinduction.archaic.fluid.tank;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;

View file

@ -3,7 +3,6 @@ package resonantinduction.mechanical;
import resonantinduction.mechanical.energy.gear.RenderGear;
import resonantinduction.mechanical.energy.gear.RenderGearShaft;
import resonantinduction.mechanical.fluid.pipe.RenderPipe;
import resonantinduction.mechanical.fluid.tank.RenderTank;
import calclavia.lib.render.item.GlobalItemRenderer;
public class ClientProxy extends CommonProxy
@ -14,6 +13,5 @@ public class ClientProxy extends CommonProxy
GlobalItemRenderer.register(Mechanical.itemGear.itemID, RenderGear.INSTANCE);
GlobalItemRenderer.register(Mechanical.itemGearShaft.itemID, RenderGearShaft.INSTANCE);
GlobalItemRenderer.register(Mechanical.itemPipe.itemID, RenderPipe.INSTANCE);
GlobalItemRenderer.register(Mechanical.blockTank.blockID, RenderTank.INSTANCE);
}
}

View file

@ -7,10 +7,6 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import resonantinduction.api.mechanical.IMechanical;
import resonantinduction.archaic.filter.BlockFilter;
import resonantinduction.archaic.filter.TileFilter;
import resonantinduction.archaic.fluid.grate.BlockGrate;
import resonantinduction.archaic.fluid.grate.TileGrate;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.Settings;
@ -26,10 +22,7 @@ import resonantinduction.mechanical.energy.turbine.SchematicWaterTurbine;
import resonantinduction.mechanical.energy.turbine.SchematicWindTurbine;
import resonantinduction.mechanical.energy.turbine.TileWaterTurbine;
import resonantinduction.mechanical.energy.turbine.TileWindTurbine;
import resonantinduction.mechanical.fluid.pipe.ItemBlockFluidContainer;
import resonantinduction.mechanical.fluid.pipe.ItemPipe;
import resonantinduction.mechanical.fluid.tank.BlockTank;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.mechanical.fluid.transport.BlockPump;
import resonantinduction.mechanical.fluid.transport.TilePump;
import resonantinduction.mechanical.logistic.belt.BlockDetector;
@ -99,7 +92,6 @@ public class Mechanical
public static Block blockRejector;
// Fluids
public static Block blockTank;
public static Block blockReleaseValve;
public static Block blockPump;
public static Item itemPipe;
@ -130,7 +122,6 @@ public class Mechanical
blockDetector = contentRegistry.createTile(BlockDetector.class, TileDetector.class);
blockRejector = contentRegistry.createTile(BlockRejector.class, TileRejector.class);
blockTank = contentRegistry.createBlock(BlockTank.class, ItemBlockFluidContainer.class, TileTank.class);
blockPump = contentRegistry.createTile(BlockPump.class, TilePump.class);
itemPipe = contentRegistry.createItem(ItemPipe.class);
@ -180,7 +171,6 @@ public class Mechanical
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 1), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 0), 'W', Block.stone, 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 2), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 1), 'W', UniversalRecipe.PRIMARY_METAL.get(), 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(blockTank, "GGG", "GSG", "GGG", 'G', Block.glass, 'S', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockPump, "PPP", "GGG", "PPP", 'P', itemPipe, 'G', new ItemStack(itemGear, 1, 2)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3), "BBB", " ", "BBB", 'B', Item.ingotIron));

View file

@ -1,9 +1,7 @@
package resonantinduction.mechanical.energy.network;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.WeakHashMap;
import net.minecraft.tileentity.TileEntity;

View file

@ -2,13 +2,11 @@ package resonantinduction.mechanical.energy.network;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.api.mechanical.IMechanical;
import resonantinduction.api.mechanical.IMechanicalNetwork;
import resonantinduction.core.ResonantInduction;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.energy.gear.PartGearShaft;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.network.IPacketReceiver;
import calclavia.lib.network.PacketHandler;

View file

@ -2,16 +2,11 @@ package resonantinduction.mechanical.energy.turbine;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.render.RIBlockRenderingHandler;
import calclavia.lib.prefab.turbine.BlockTurbine;
import calclavia.lib.prefab.turbine.TileTurbine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -2,16 +2,11 @@ package resonantinduction.mechanical.energy.turbine;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.render.RIBlockRenderingHandler;
import calclavia.lib.prefab.turbine.BlockTurbine;
import calclavia.lib.prefab.turbine.TileTurbine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -7,8 +7,6 @@ import resonantinduction.api.mechanical.IMechanical;
import resonantinduction.api.mechanical.IMechanicalNetwork;
import resonantinduction.mechanical.energy.network.MechanicalNetwork;
import universalelectricity.api.energy.EnergyStorageHandler;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.network.Synced;
import calclavia.lib.network.Synced.SyncedInput;
import calclavia.lib.network.Synced.SyncedOutput;
import calclavia.lib.prefab.turbine.TileTurbine;

View file

@ -14,9 +14,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import resonantinduction.archaic.Archaic;
import resonantinduction.archaic.fluid.tank.TileTank;
import resonantinduction.core.prefab.fluid.TileFluidNetwork;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.tank.TileTank;
import universalelectricity.api.energy.UnitDisplay;
import universalelectricity.api.energy.UnitDisplay.Unit;
import universalelectricity.api.energy.UnitDisplay.UnitPrefix;
@ -57,9 +57,11 @@ public class ItemBlockFluidContainer extends ItemBlock
public static ItemStack getWrenchedItem(World world, Vector3 vec)
{
TileEntity entity = vec.getTileEntity(world);
if (entity instanceof TileTank && ((TileTank) entity).getInternalTank() != null && ((TileTank) entity).getInternalTank().getFluid() != null)
{
ItemStack itemStack = new ItemStack(Mechanical.blockTank);
ItemStack itemStack = new ItemStack(Archaic.blockTank);
FluidStack stack = ((TileTank) entity).getInternalTank().getFluid();
if (itemStack.getTagCompound() == null)
@ -73,6 +75,7 @@ public class ItemBlockFluidContainer extends ItemBlock
}
return itemStack;
}
return null;
}

View file

@ -1,294 +0,0 @@
// Date: 1/22/2013 9:59:56 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package resonantinduction.mechanical.fluid.tank;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelPump extends ModelBase
{
// fields
ModelRenderer Body;
ModelRenderer pipecc1;
ModelRenderer pipecc3;
ModelRenderer wheelcenter;
ModelRenderer wheelcenter2;
ModelRenderer joint;
ModelRenderer wheelcc0;
ModelRenderer wheelcc1;
ModelRenderer wheelcc2;
ModelRenderer wheelcc3;
ModelRenderer wheelcc4;
ModelRenderer wheelcc5;
ModelRenderer wheelcc6;
ModelRenderer wheelcc7;
ModelRenderer wheelBrace;
ModelRenderer piston_top;
ModelRenderer piston;
ModelRenderer wheelBrace2;
ModelRenderer joint2;
ModelRenderer w2;
ModelRenderer w22;
ModelRenderer w2cc;
ModelRenderer w2cc1;
ModelRenderer w2cc2;
ModelRenderer w2cc3;
ModelRenderer w2cc4;
ModelRenderer w2cc5;
ModelRenderer w2cc6;
ModelRenderer w2cc7;
ModelRenderer side7;
ModelRenderer side8;
public ModelPump()
{
textureWidth = 128;
textureHeight = 128;
Body = new ModelRenderer(this, 0, 109);
Body.addBox(-3F, 0F, -3F, 6, 12, 6);
Body.setRotationPoint(0F, 12F, 0F);
Body.setTextureSize(128, 128);
Body.mirror = true;
setRotation(Body, 0F, 0F, 0F);
pipecc1 = new ModelRenderer(this, 21, 92);
pipecc1.addBox(-3.5F, -3.5F, 3F, 7, 7, 5);
pipecc1.setRotationPoint(0F, 16F, 0F);
pipecc1.setTextureSize(128, 128);
pipecc1.mirror = true;
setRotation(pipecc1, 0F, 1.570796F, 0F);
pipecc3 = new ModelRenderer(this, 8, 50);
pipecc3.addBox(-3.5F, -4F, 3F, 7, 5, 5);
pipecc3.setRotationPoint(0F, 16F, 0F);
pipecc3.setTextureSize(128, 128);
pipecc3.mirror = true;
setRotation(pipecc3, 0F, 3.141593F, 0F);
wheelcenter = new ModelRenderer(this, 0, 25);
wheelcenter.addBox(0F, -2.5F, -2.5F, 1, 5, 5);
wheelcenter.setRotationPoint(-5F, 18F, 0F);
wheelcenter.setTextureSize(128, 128);
wheelcenter.mirror = true;
setRotation(wheelcenter, 0F, 0F, 0F);
wheelcenter2 = new ModelRenderer(this, 0, 25);
wheelcenter2.addBox(0F, -2.5F, -2.5F, 1, 5, 5);
wheelcenter2.setRotationPoint(-5F, 18F, 0F);
wheelcenter2.setTextureSize(128, 128);
wheelcenter2.mirror = true;
setRotation(wheelcenter2, 0.7853982F, 0F, 0F);
joint = new ModelRenderer(this, 0, 18);
joint.addBox(0F, -1.5F, -1.5F, 1, 3, 3);
joint.setRotationPoint(-4F, 18F, 0F);
joint.setTextureSize(128, 128);
joint.mirror = true;
setRotation(joint, 0F, 0F, 0F);
wheelcc0 = new ModelRenderer(this, 0, 0);
wheelcc0.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc0.setRotationPoint(-5F, 18F, 0F);
wheelcc0.setTextureSize(128, 128);
wheelcc0.mirror = true;
setRotation(wheelcc0, 1.570796F, 0F, 0F);
wheelcc1 = new ModelRenderer(this, 0, 0);
wheelcc1.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc1.setRotationPoint(-5F, 18F, 0F);
wheelcc1.setTextureSize(128, 128);
wheelcc1.mirror = true;
setRotation(wheelcc1, 0F, 0F, 0F);
wheelcc2 = new ModelRenderer(this, 0, 0);
wheelcc2.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc2.setRotationPoint(-5F, 18F, 0F);
wheelcc2.setTextureSize(128, 128);
wheelcc2.mirror = true;
setRotation(wheelcc2, -1.570796F, 0F, 0F);
wheelcc3 = new ModelRenderer(this, 0, 0);
wheelcc3.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc3.setRotationPoint(-5F, 18F, 0F);
wheelcc3.setTextureSize(128, 128);
wheelcc3.mirror = true;
setRotation(wheelcc3, 3.141593F, 0F, 0F);
wheelcc4 = new ModelRenderer(this, 0, 0);
wheelcc4.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc4.setRotationPoint(-5F, 18F, 0F);
wheelcc4.setTextureSize(128, 128);
wheelcc4.mirror = true;
setRotation(wheelcc4, 0.7853982F, 0F, 0F);
wheelcc5 = new ModelRenderer(this, 0, 0);
wheelcc5.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc5.setRotationPoint(-5F, 18F, 0F);
wheelcc5.setTextureSize(128, 128);
wheelcc5.mirror = true;
setRotation(wheelcc5, -2.356194F, 0F, 0F);
wheelcc6 = new ModelRenderer(this, 0, 0);
wheelcc6.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc6.setRotationPoint(-5F, 18F, 0F);
wheelcc6.setTextureSize(128, 128);
wheelcc6.mirror = true;
setRotation(wheelcc6, -0.7853982F, 0F, 0F);
wheelcc7 = new ModelRenderer(this, 0, 0);
wheelcc7.addBox(0F, -4.5F, -2F, 1, 1, 4);
wheelcc7.setRotationPoint(-5F, 18F, 0F);
wheelcc7.setTextureSize(128, 128);
wheelcc7.mirror = true;
setRotation(wheelcc7, 2.356194F, 0F, 0F);
wheelBrace = new ModelRenderer(this, 27, 5);
wheelBrace.addBox(0F, -1.5F, -1.5F, 1, 8, 3);
wheelBrace.setRotationPoint(-6F, 18F, 0F);
wheelBrace.setTextureSize(128, 128);
wheelBrace.mirror = true;
setRotation(wheelBrace, 0F, 0F, 0F);
piston_top = new ModelRenderer(this, 0, 81);
piston_top.addBox(-3F, 0F, -3F, 6, 1, 6);
piston_top.setRotationPoint(0F, 10F, 0F);
piston_top.setTextureSize(128, 128);
piston_top.mirror = true;
setRotation(piston_top, 0F, 0F, 0F);
piston = new ModelRenderer(this, 0, 90);
piston.addBox(-2.5F, 0F, -2.5F, 5, 12, 5);
piston.setRotationPoint(0F, 11F, 0F);
piston.setTextureSize(128, 128);
piston.mirror = true;
setRotation(piston, 0F, 0F, 0F);
wheelBrace2 = new ModelRenderer(this, 26, 18);
wheelBrace2.addBox(0F, 0F, -1.5F, 2, 1, 3);
wheelBrace2.setRotationPoint(-5F, 23F, 0F);
wheelBrace2.setTextureSize(128, 128);
wheelBrace2.mirror = true;
setRotation(wheelBrace2, 0F, 0F, 0F);
joint2 = new ModelRenderer(this, 0, 14);
joint2.addBox(0F, -0.5F, -0.5F, 1, 1, 1);
joint2.setRotationPoint(-4F, 14F, -6F);
joint2.setTextureSize(128, 128);
joint2.mirror = true;
setRotation(joint2, 0F, 0F, 0F);
w2 = new ModelRenderer(this, 0, 55);
w2.addBox(0F, -1F, -1F, 1, 2, 2);
w2.setRotationPoint(-5F, 14F, -6F);
w2.setTextureSize(128, 128);
w2.mirror = true;
setRotation(w2, 0.7853982F, 0F, 0F);
w22 = new ModelRenderer(this, 0, 55);
w22.addBox(0F, -1F, -1F, 1, 2, 2);
w22.setRotationPoint(-5F, 14F, -6F);
w22.setTextureSize(128, 128);
w22.mirror = true;
setRotation(w22, 0F, 0F, 0F);
w2cc = new ModelRenderer(this, 0, 50);
w2cc.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc.setRotationPoint(-5F, 14F, -6F);
w2cc.setTextureSize(128, 128);
w2cc.mirror = true;
setRotation(w2cc, 1.570796F, 0F, 0F);
w2cc1 = new ModelRenderer(this, 0, 50);
w2cc1.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc1.setRotationPoint(-5F, 14F, -6F);
w2cc1.setTextureSize(128, 128);
w2cc1.mirror = true;
setRotation(w2cc1, 0.7853982F, 0F, 0F);
w2cc2 = new ModelRenderer(this, 0, 50);
w2cc2.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc2.setRotationPoint(-5F, 14F, -6F);
w2cc2.setTextureSize(128, 128);
w2cc2.mirror = true;
setRotation(w2cc2, 0F, 0F, 0F);
w2cc3 = new ModelRenderer(this, 0, 50);
w2cc3.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc3.setRotationPoint(-5F, 14F, -6F);
w2cc3.setTextureSize(128, 128);
w2cc3.mirror = true;
setRotation(w2cc3, -0.7853982F, 0F, 0F);
w2cc4 = new ModelRenderer(this, 0, 50);
w2cc4.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc4.setRotationPoint(-5F, 14F, -6F);
w2cc4.setTextureSize(128, 128);
w2cc4.mirror = true;
setRotation(w2cc4, -1.570796F, 0F, 0F);
w2cc5 = new ModelRenderer(this, 0, 50);
w2cc5.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc5.setRotationPoint(-5F, 14F, -6F);
w2cc5.setTextureSize(128, 128);
w2cc5.mirror = true;
setRotation(w2cc5, -2.356194F, 0F, 0F);
w2cc6 = new ModelRenderer(this, 0, 50);
w2cc6.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc6.setRotationPoint(-5F, 14F, -6F);
w2cc6.setTextureSize(128, 128);
w2cc6.mirror = true;
setRotation(w2cc6, 3.141593F, 0F, 0F);
w2cc7 = new ModelRenderer(this, 0, 50);
w2cc7.addBox(0F, 1.3F, -1F, 1, 1, 2);
w2cc7.setRotationPoint(-5F, 14F, -6F);
w2cc7.setTextureSize(128, 128);
w2cc7.mirror = true;
setRotation(w2cc7, -3.926991F, 0F, 0F);
side7 = new ModelRenderer(this, 0, 65);
side7.addBox(-2.5F, -4F, 3F, 5, 7, 4);
side7.setRotationPoint(0F, 21F, 0F);
side7.setTextureSize(128, 128);
side7.mirror = true;
setRotation(side7, 0F, 3.141593F, 0F);
side8 = new ModelRenderer(this, 25, 111);
side8.addBox(-2.5F, 0F, 3F, 5, 11, 3);
side8.setRotationPoint(0F, 13F, 0F);
side8.setTextureSize(128, 128);
side8.mirror = true;
setRotation(side8, 0F, 0F, 0F);
}
public void render(float f5)
{
Body.render(f5);
pipecc1.render(f5);
pipecc3.render(f5);
joint.render(f5);
wheelBrace.render(f5);
piston_top.render(f5);
piston.render(f5);
wheelBrace2.render(f5);
joint2.render(f5);
side7.render(f5);
side8.render(f5);
}
public void renderMotion(float f5, int i)
{
// wheel 1
wheelcenter.render(f5);
wheelcenter2.render(f5);
wheelcc0.render(f5);
wheelcc1.render(f5);
wheelcc2.render(f5);
wheelcc3.render(f5);
wheelcc4.render(f5);
wheelcc5.render(f5);
wheelcc6.render(f5);
wheelcc7.render(f5);
// wheel 2
w2.render(f5);
w22.render(f5);
w2cc.render(f5);
w2cc1.render(f5);
w2cc2.render(f5);
w2cc3.render(f5);
w2cc4.render(f5);
w2cc5.render(f5);
w2cc6.render(f5);
w2cc7.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -8,8 +8,8 @@ import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
import calclavia.lib.render.RenderUtility;
import resonantinduction.core.Reference;
import calclavia.lib.render.RenderUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -9,7 +9,6 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.client.model.obj.WavefrontObject;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Reference;
import calclavia.lib.render.RenderUtility;

View file

@ -4,14 +4,12 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import calclavia.lib.utility.LanguageUtility;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.oredict.OreDictionary;
import resonantinduction.api.mechanical.IMechanical;
import resonantinduction.api.recipe.MachineRecipes;
import resonantinduction.api.recipe.MachineRecipes.RecipeType;

View file

@ -1,5 +1,7 @@
package resonantinduction.api.mechanical.fluid;
import net.minecraftforge.fluids.FluidTank;
/**
* Applied to tiles that are pipes and support pressure
*
@ -7,11 +9,16 @@ package resonantinduction.api.mechanical.fluid;
*/
public interface IFluidPipe extends IFluidConnector, IPressure
{
public FluidTank getInternalTank();
public void onFluidChanged();
public boolean canFlow();
/**
* Max flow rate of fluid this pipe can support
*
* @return amount in liters.
*/
int getMaxFlowRate();
public int getMaxFlowRate();
}

View file

@ -1,6 +1,5 @@
package resonantinduction.core.prefab.fluid;
import java.util.HashSet;
import java.util.Set;
import net.minecraftforge.common.ForgeDirection;
@ -23,7 +22,6 @@ import calclavia.lib.utility.FluidUtility;
*/
public abstract class FluidNetwork extends NodeNetwork<IFluidNetwork, IFluidConnector, IFluidHandler> implements IFluidNetwork, IUpdate
{
protected FluidTank tank = new FluidTank(0);
protected final FluidTankInfo[] tankInfo = new FluidTankInfo[1];

View file

@ -29,6 +29,18 @@ public class PipeNetwork extends FluidNetwork
}
}
@Override
public boolean canUpdate()
{
return getConnectors().size() > 0;
}
@Override
public boolean continueUpdate()
{
return canUpdate();
}
/**
* Calculate pressure in this pipe.
*/
@ -75,7 +87,7 @@ public class PipeNetwork extends FluidNetwork
/**
* Distribute fluid in this pipe based on pressure.
*/
public static void distribute(IFluidPipe sourcePipe)
public void distribute(IFluidPipe sourcePipe)
{
for (int i = 0; i < 6; i++)
{
@ -109,7 +121,7 @@ public class PipeNetwork extends FluidNetwork
{
int amountB = tankB.getFluidAmount();
int quantity = Math.max(pressureA > pressureB ? 25 : 0, (amountA - amountB) / 2);
int quantity = Math.max(pressureA > pressureB ? (pressureA - pressureB) * sourcePipe.getMaxFlowRate() : 0, (amountA - amountB) / 2);
quantity = Math.min(Math.min(quantity, tankB.getCapacity() - amountB), amountA);
if (quantity > 0)
@ -154,18 +166,6 @@ public class PipeNetwork extends FluidNetwork
}
}
@Override
public boolean canUpdate()
{
return getConnectors().size() > 0;
}
@Override
public boolean continueUpdate()
{
return canUpdate();
}
@Override
public FluidStack drain(IFluidConnector source, ForgeDirection from, FluidStack resource, boolean doDrain)
{
@ -189,4 +189,22 @@ public class PipeNetwork extends FluidNetwork
{
return new PipeNetwork();
}
@Override
public void reconstructConnector(IFluidConnector connector)
{
connector.setNetwork(this);
}
@Override
public void distributeConnectors()
{
}
@Override
public void reconstructTankInfo()
{
}
}

View file

@ -109,7 +109,7 @@ public abstract class TileFluidNetwork extends TileAdvanced implements IFluidCon
@Override
public Object[] getConnections()
{
return this.connectedBlocks;
return connectedBlocks;
}
public void refresh()
@ -117,19 +117,19 @@ public abstract class TileFluidNetwork extends TileAdvanced implements IFluidCon
if (this.worldObj != null && !this.worldObj.isRemote)
{
byte previousConnections = renderSides;
this.connectedBlocks = new Object[6];
this.renderSides = 0;
connectedBlocks = new Object[6];
renderSides = 0;
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
this.validateConnectionSide(new Vector3(this).translate(dir).getTileEntity(this.worldObj), dir);
this.validateConnectionSide(new Vector3(this).translate(dir).getTileEntity(worldObj), dir);
}
/** Only send packet updates if visuallyConnected changed. */
if (previousConnections != renderSides)
{
this.sendRenderUpdate();
this.getNetwork().reconstruct();
sendRenderUpdate();
getNetwork().reconstruct();
}
}

View file

@ -1,12 +1,10 @@
package resonantinduction.core.prefab.imprint;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import resonantinduction.api.IFilterable;
import calclavia.lib.prefab.block.BlockRotatable;

View file

@ -1,6 +1,5 @@
package resonantinduction.core.resource;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
@ -13,9 +12,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.prefab.block.BlockTile;
import calclavia.lib.utility.inventory.InventoryUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -14,7 +14,6 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.oredict.OreDictionary;
import resonantinduction.core.Reference;
import resonantinduction.core.TabRI;
import resonantinduction.core.resource.ItemOreResource;

View file

@ -173,8 +173,6 @@ tooltip.wire.resistance=Resistance: %v
tooltip.wire.current=Current: %v
tooltip.wire.damage=Damage: %v
tooltip.wire.helpText=Higher voltages will increase transfer rate and decrease energy loss. Shift right click to place a framed wire.
# %0 goes before the localized name of the shift key, %1 goes after
tooltip.noShift=Hold %0shift %1for more information
# %0 is the color for the charge level, %1 is grey to reset it back to normal (optional), %v0 is the current charge, %v1 is the max charge
tooltip.battery.energy=Energy: %0%v0 / %v1
tooltip.multimeter.line1=Right click to place,