Readded Grate and Pump

This commit is contained in:
Calclavia 2014-01-11 13:03:42 +08:00
parent 870a5338ba
commit d62a3e075e
13 changed files with 128 additions and 198 deletions

View file

@ -8,6 +8,10 @@ import resonantinduction.mechanical.belt.BlockConveyorBelt;
import resonantinduction.mechanical.belt.TileConveyorBelt;
import resonantinduction.mechanical.fluid.pipe.BlockPipe;
import resonantinduction.mechanical.fluid.pipe.TilePipe;
import resonantinduction.mechanical.fluid.pump.BlockGrate;
import resonantinduction.mechanical.fluid.pump.BlockPump;
import resonantinduction.mechanical.fluid.pump.TileGrate;
import resonantinduction.mechanical.fluid.pump.TilePump;
import resonantinduction.mechanical.fluid.tank.BlockTank;
import resonantinduction.mechanical.fluid.tank.TileTank;
import calclavia.lib.content.ContentRegistry;
@ -49,16 +53,23 @@ public class Mechanical
// Transport
public static Block blockConveyorBelt;
// #Fluids
public static Block blockTank;
public static Block blockPipe;
public static Block blockGrate;
public static Block blockPump;
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
NetworkRegistry.instance().registerGuiHandler(this, proxy);
blockConveyorBelt = contentRegistry.createTile(BlockConveyorBelt.class, TileConveyorBelt.class);
blockTank = contentRegistry.createTile(BlockTank.class, TileTank.class);
blockPipe = contentRegistry.createTile(BlockPipe.class, TilePipe.class);
blockGrate = contentRegistry.createTile(BlockGrate.class, TileGrate.class);
blockPump = contentRegistry.createTile(BlockPump.class, TilePump.class);
proxy.preInit();
}

View file

@ -14,6 +14,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.prefab.TileFluidNetworkTile;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.old.core.recipe.RecipeLoader;
@ -21,7 +22,6 @@ import universalelectricity.api.vector.Vector3;
public class ItemBlockPipe extends ItemBlock
{
public ItemBlockPipe(int id)
{
super(id);
@ -32,7 +32,7 @@ public class ItemBlockPipe extends ItemBlock
@Override
public int getMetadata(int damage)
{
return 0;
return damage;
}
@Override
@ -54,7 +54,7 @@ public class ItemBlockPipe extends ItemBlock
TileEntity entity = vec.getTileEntity(world);
if (entity instanceof TileTank && ((TileTank) entity).getTankInfo() != null && ((TileTank) entity).getTankInfo()[0] != null)
{
ItemStack itemStack = new ItemStack(RecipeLoader.blockTank);
ItemStack itemStack = new ItemStack(Mechanical.blockTank);
FluidStack stack = ((TileTank) entity).getTankInfo()[0].fluid;
if (itemStack.getTagCompound() == null)

View file

@ -1,129 +0,0 @@
package resonantinduction.mechanical.fluid.pump;
import java.util.List;
import java.util.Set;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.core.tilenetwork.prefab.NetworkTileEntities;
import resonantinduction.old.client.render.BlockRenderHelper;
import resonantinduction.old.core.recipe.RecipeLoader;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockConstructionPump extends BlockRI
{
public BlockConstructionPump()
{
super("constructionPump", Material.iron);
this.setHardness(1f);
this.setResistance(5f);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "ironMachineSide");
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int damageDropped(int meta)
{
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return BlockRenderHelper.renderID;
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(RecipeLoader.blockConPump, 1, 0);
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase p, ItemStack itemStack)
{
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityConstructionPump();
}
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(par1, 1, 0));
}
@Override
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
int meta = world.getBlockMetadata(x, y, z);
int angle = MathHelper.floor_double((entityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityConstructionPump)
{
NetworkTileEntities.invalidate(entity);
}
if (meta == 3)
{
world.setBlockMetadataWithNotify(x, y, z, 0, 3);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3);
}
return true;
}
return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ);
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("ConstructionPump", TileEntityConstructionPump.class));
}
}

View file

@ -124,12 +124,4 @@ public class BlockGrate extends BlockRI
}
return true;
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("FluidDrain", TileGrate.class));
}
}

View file

@ -12,6 +12,8 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler;
import resonantinduction.old.client.render.BlockRenderHelper;
import resonantinduction.old.core.recipe.RecipeLoader;
@ -20,9 +22,9 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPumpMachine extends BlockRI
public class BlockPump extends BlockRI
{
public BlockPumpMachine()
public BlockPump()
{
super("pump", Material.iron);
this.setHardness(1f);
@ -46,7 +48,7 @@ public class BlockPumpMachine extends BlockRI
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return BlockRenderHelper.renderID;
return MechanicalBlockRenderingHandler.ID;
}
@Override
@ -69,7 +71,7 @@ public class BlockPumpMachine extends BlockRI
if (meta < 4)
{
return new ItemStack(RecipeLoader.blockPumpMachine, 1, 0);
return new ItemStack(Mechanical.blockPump, 1, 0);
}
return null;
@ -78,7 +80,7 @@ public class BlockPumpMachine extends BlockRI
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileEntityStarterPump();
return new TilePump();
}
@Override
@ -86,11 +88,4 @@ public class BlockPumpMachine extends BlockRI
{
par3List.add(new ItemStack(par1, 1, 0));
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("starterPump", TileEntityStarterPump.class));
}
}

View file

@ -1,4 +1,4 @@
package resonantinduction.old.client.render;
package resonantinduction.mechanical.fluid.pump;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
@ -7,7 +7,6 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.fluid.pump.TileEntityStarterPump;
import resonantinduction.old.client.model.ModelPump;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -15,19 +14,13 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderPump extends TileEntitySpecialRenderer
{
int type = 0;
private ModelPump model;
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pumps/WaterPump.png");
public RenderPump()
{
model = new ModelPump();
}
public static final ModelPump MODEL = new ModelPump();
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pump.png");
@Override
public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f)
public void renderTileEntityAt(TileEntity t, double d, double d1, double d2, float f)
{
int meta = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord);
int meta = t.worldObj.getBlockMetadata(t.xCoord, t.yCoord, t.zCoord);
bindTexture(TEXTURE);
GL11.glPushMatrix();
@ -48,11 +41,13 @@ public class RenderPump extends TileEntitySpecialRenderer
GL11.glRotatef(270f, 0f, 1f, 0f);
break;
}
model.render(0.0625F);
if (te instanceof TileEntityStarterPump)
MODEL.render(0.0625F);
if (t instanceof TilePump)
{
model.renderMotion(0.0625F, ((TileEntityStarterPump) te).rotation);
MODEL.renderMotion(0.0625F, ((TilePump) t).rotation);
}
GL11.glPopMatrix();
}

View file

@ -24,7 +24,7 @@ import universalelectricity.api.vector.VectorHelper;
import com.builtbroken.common.Pair;
public class TileEntityConstructionPump extends TileEntityStarterPump implements IFluidHandler, ITileConnector
public class TileConstructionPump extends TilePump implements IFluidHandler, ITileConnector
{
/* LIQUID FLOW CONNECTION SIDES */
/** Internal tank for interaction but not real storage */
@ -32,7 +32,7 @@ public class TileEntityConstructionPump extends TileEntityStarterPump implements
List<IDrain> drainsUsed = new ArrayList<IDrain>();
public TileEntityConstructionPump()
public TileConstructionPump()
{
super(50, 50, 30);
}

View file

@ -20,7 +20,7 @@ import com.builtbroken.common.Pair;
import dark.lib.interfaces.IReadOut;
public class TileEntityStarterPump extends TileEntityEnergyMachine implements IReadOut, ITileConnector
public class TilePump extends TileEntityEnergyMachine implements IReadOut, ITileConnector
{
private int currentWorldEdits, MAX_WORLD_EDITS_PER_PROCESS;
@ -31,7 +31,7 @@ public class TileEntityStarterPump extends TileEntityEnergyMachine implements IR
public int rotation = 0;
public TileEntityStarterPump()
public TilePump()
{
this(10, 50, 5);
}
@ -41,7 +41,7 @@ public class TileEntityStarterPump extends TileEntityEnergyMachine implements IR
* @param wattDrain - cost in watts to drain or fill one block
* @param maxEdits - max world edits per update (1/2 second)
*/
public TileEntityStarterPump(long wattTick, long wattDrain, int maxEdits)
public TilePump(long wattTick, long wattDrain, int maxEdits)
{
// Power calculation for max power (worldEdits * watts per edit) + (watts per tick * one
// second)

View file

@ -10,12 +10,14 @@ import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.pipe.RenderPipe;
import resonantinduction.mechanical.fluid.pump.RenderPump;
import resonantinduction.mechanical.fluid.tank.RenderTank;
import resonantinduction.old.client.model.ModelConveyorBelt;
import resonantinduction.old.client.model.ModelCrusher;
import resonantinduction.old.client.model.ModelGrinder;
import resonantinduction.old.client.model.ModelManipulator;
import resonantinduction.old.client.model.ModelRejectorPiston;
import resonantinduction.old.client.render.RenderFrackingPipe;
import resonantinduction.old.core.recipe.RecipeLoader;
import resonantinduction.old.transport.hopper.BlockAdvancedHopper;
import cpw.mods.fml.client.FMLClientHandler;
@ -59,7 +61,7 @@ public class MechanicalBlockRenderingHandler implements ISimpleBlockRenderingHan
else if (block == Mechanical.blockPipe)
{
GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 1.3F, 0.0F);
GL11.glTranslatef(0.0F, 1F, 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderPipe.getTexture(metadata));
RenderPipe.MODEL_PIPE.renderFront();
@ -67,6 +69,15 @@ public class MechanicalBlockRenderingHandler implements ISimpleBlockRenderingHan
RenderPipe.MODEL_PIPE.renderBack();
GL11.glPopMatrix();
}
else if (Mechanical.blockPump != null)
{
GL11.glTranslatef(0.0F, 1.3F, 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderPump.TEXTURE);
RenderPump.MODEL.render(0.0725F);
RenderPump.MODEL.renderMotion(0.0725F, 0);
}
else if (RecipeLoader.blockRejector != null && block.blockID == RecipeLoader.blockRejector.blockID)
{
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "rejector.png"));
@ -88,6 +99,57 @@ public class MechanicalBlockRenderingHandler implements ISimpleBlockRenderingHan
modelInjector.render(0.0625F, true, 0);
GL11.glPopMatrix();
}
/*
* if (RecipeLoader.blockPumpMachine != null && block.blockID ==
* RecipeLoader.blockPumpMachine.blockID && metadata < 4)
* {
* GL11.glTranslatef(0.0F, 1.1F, 0.0F);
* GL11.glRotatef(180f, 0f, 0f, 1f);
* FMLClientHandler.instance().getClient().renderEngine.bindTexture(new
* ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pumps/WaterPump.png"));
* modelPump.render(0.0725F);
* modelPump.renderMotion(0.0725F, 0);
* }
* else if (RecipeLoader.blockSink != null && block.blockID ==
* RecipeLoader.blockSink.blockID)
* {
* GL11.glTranslatef(0.0F, .8F, 0.0F);
* GL11.glRotatef(180f, 0f, 0f, 1f);
* FMLClientHandler.instance().getClient().renderEngine.bindTexture(new
* ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "Sink.png"));
* sink.render(0.0565F);
* }
* else if (RecipeLoader.blockRod != null && block.blockID == RecipeLoader.blockRod.blockID)
* {
* GL11.glTranslatef(0.0F, 1.5F, 0.0F);
* GL11.glRotatef(180f, 0f, 0f, 1f);
* FMLClientHandler.instance().getClient().renderEngine.bindTexture(new
* ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY +
* "mechanical/GearRod.png"));
* modelRod.render(0.0825F, 0);
* }
* else if (RecipeLoader.blockConPump != null && block.blockID ==
* RecipeLoader.blockConPump.blockID && metadata < 4)
* {
* GL11.glTranslatef(0.0F, 1.2F, 0.0F);
* GL11.glRotatef(180f, 0f, 0f, 1f);
* FMLClientHandler.instance().getClient().renderEngine.bindTexture(new
* ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "ConstructionPump.png"));
* conPump.render(0.0725F);
* conPump.renderMotor(0.0725F);
* }
* else if (RecipeLoader.frackingPipe != null && block.blockID ==
* RecipeLoader.frackingPipe.blockID)
* {
* FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderFrackingPipe.TEXTURE
* );
* GL11.glTranslatef(0, 1F, 0);
* GL11.glScalef(1.0F, -1F, -1F);
* RenderFrackingPipe.model.renderAll();
* }
* GL11.glPopMatrix();
*/
/*
* else if (RecipeLoader.blockArmbot != null && block.blockID ==
* RecipeLoader.blockArmbot.blockID)

View file

@ -9,8 +9,8 @@ import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import resonantinduction.mechanical.fluid.TileReleaseValve;
import resonantinduction.mechanical.fluid.pipe.TilePipe;
import resonantinduction.mechanical.fluid.pump.TileEntityConstructionPump;
import resonantinduction.mechanical.fluid.pump.TileEntityStarterPump;
import resonantinduction.mechanical.fluid.pump.TileConstructionPump;
import resonantinduction.mechanical.fluid.pump.TilePump;
import resonantinduction.mechanical.fluid.tank.RenderTank;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler;
@ -59,13 +59,13 @@ public class ClientProxy extends CommonProxy
{
super.init();
ClientRegistry.bindTileEntitySpecialRenderer(TilePipe.class, new RenderPipe());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStarterPump.class, new RenderPump());
ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new RenderPump());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRod.class, new RenderGearRod());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGenerator.class, new
// RenderGenerator());
ClientRegistry.bindTileEntitySpecialRenderer(TileReleaseValve.class, new RenderReleaseValve());
ClientRegistry.bindTileEntitySpecialRenderer(TileKitchenSink.class, new RenderSink());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConstructionPump.class, new RenderConstructionPump());
ClientRegistry.bindTileEntitySpecialRenderer(TileConstructionPump.class, new RenderConstructionPump());
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
MinecraftForgeClient.registerItemRenderer(RecipeLoader.blockPipe.blockID, new ItemPipeRenderer());

View file

@ -7,7 +7,7 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.fluid.pump.TileEntityConstructionPump;
import resonantinduction.mechanical.fluid.pump.TileConstructionPump;
import resonantinduction.old.client.model.ModelConstructionPump;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -48,7 +48,7 @@ public class RenderConstructionPump extends TileEntitySpecialRenderer
break;
}
model.render(0.0625F);
if (tileEntity instanceof TileEntityConstructionPump)
if (tileEntity instanceof TileConstructionPump)
{
// TODO animation life
}

View file

@ -10,8 +10,31 @@ meta.resonantinduction.credits=Visit website for credits.
fluid.mixture=Mixture
### Mechanical Module
## Transport
tile.resonantinduction\:pump.name=Pump
tile.resonantinduction\:grate.name=Grate
tile.resonantinduction\:conveyorBelt.name=Conveyor Belt
# Fluid pipes
tile.resonantinduction\:fluidPipe.0.name=Wood Trough
tile.resonantinduction\:fluidPipe.1.name=Black Wood Trough
tile.resonantinduction\:fluidPipe.2.name=Red Wood Trough
tile.resonantinduction\:fluidPipe.3.name=Green Wood Trough
tile.resonantinduction\:fluidPipe.4.name=Brown Wood Trough
tile.resonantinduction\:fluidPipe.5.name=Blue Wood Trough
tile.resonantinduction\:fluidPipe.6.name=Purple Wood Trough
tile.resonantinduction\:fluidPipe.7.name=Cyan Wood Trough
tile.resonantinduction\:fluidPipe.8.name=Silver Wood Trough
tile.resonantinduction\:fluidPipe.9.name=Grey Wood Trough
tile.resonantinduction\:fluidPipe.10.name=Pink Wood Trough
tile.resonantinduction\:fluidPipe.11.name=Lime Wood Trough
tile.resonantinduction\:fluidPipe.12.name=Yellow Wood Trough
tile.resonantinduction\:fluidPipe.13.name=Light Blue Wood Trough
tile.resonantinduction\:fluidPipe.14.name=Magenta Wood Trough
tile.resonantinduction\:fluidPipe.15.name=Orange Wood Trough
tile.resonantinduction\:fluidPipe.16.name=White Wood Trough
### Electrical Module
## Blocks
tile.resonantinduction\:tesla.name=Tesla Coil
@ -95,7 +118,6 @@ assemblyline.gui.crafting=Crafting
tile.StarterPump.0.name=Pump
tile.ReleaseValve.0.name=Release Valve
tile.FluidSink.0.name = Sink
tile.FluidDrain.0.name = Fluid Drain
tile.ConstructionPump.0.name = Construction Pump
tile.crate.name=Crate
@ -378,24 +400,6 @@ item.RefinedSand.Magenta.name = Magenta Refined Sand
item.RefinedSand.Orange.name = Orange Refined Sand
item.RefinedSand.White.name = White Refined Sand
# Fluid pipes
tile.FluidPipe.0.name =Wood Trough
tile.FluidPipe.1.name =Black Wood Trough
tile.FluidPipe.2.name =Red Wood Trough
tile.FluidPipe.3.name =Green Wood Trough
tile.FluidPipe.4.name =Brown Wood Trough
tile.FluidPipe.5.name =Blue Wood Trough
tile.FluidPipe.6.name =Purple Wood Trough
tile.FluidPipe.7.name =Cyan Wood Trough
tile.FluidPipe.8.name =Silver Wood Trough
tile.FluidPipe.9.name =Grey Wood Trough
tile.FluidPipe.10.name =Pink Wood Trough
tile.FluidPipe.11.name =Lime Wood Trough
tile.FluidPipe.12.name =Yellow Wood Trough
tile.FluidPipe.13.name =Light Blue Wood Trough
tile.FluidPipe.14.name =Magenta Wood Trough
tile.FluidPipe.15.name =Orange Wood Trough
tile.FluidPipe.16.name =White Wood Trough
tile.FluidPipe.1000.name =Glass Tube
tile.FluidPipe.1001.name =Black Glass Tube

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB