Fixed troughs not creating a tile

This commit is contained in:
Calclavia 2014-02-18 19:30:58 +08:00
parent f10437ab34
commit 98361f4c28
4 changed files with 63 additions and 41 deletions

View file

@ -1,53 +1,64 @@
package resonantinduction.archaic.channel;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import calclavia.lib.utility.FluidUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import resonantinduction.core.Settings;
import resonantinduction.core.Reference;
import resonantinduction.core.prefab.fluid.BlockFluidNetwork;
import resonantinduction.core.render.RIBlockRenderingHandler;
import universalelectricity.api.UniversalElectricity;
import calclavia.lib.utility.FluidUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** Early tier version of the basic pipe. Open on the top, and can't support pressure.
/**
* Early tier version of the basic pipe. Open on the top, and can't support pressure.
*
* @author Darkguardsman */
* @author Darkguardsman
*/
public class BlockChannel extends BlockFluidNetwork
{
public BlockChannel(int id)
{
super(Settings.CONFIGURATION.getBlock("Channel", id).getInt(id), UniversalElectricity.machine);
}
public BlockChannel(int id)
{
super(id, UniversalElectricity.machine);
setTextureName(Reference.PREFIX + "material_wood_surface");
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return -1;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
return FluidUtility.playerActivatedFluidItem(world, x, y, z, entityplayer, side);
}
return super.onMachineActivated(world, x, y, z, entityplayer, side, hitX, hitY, hitZ);
}
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileChannel();
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return RIBlockRenderingHandler.ID;
}
@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
return FluidUtility.playerActivatedFluidItem(world, x, y, z, entityplayer, side);
}
return super.onMachineActivated(world, x, y, z, entityplayer, side, hitX, hitY, hitZ);
}
}

View file

@ -27,7 +27,7 @@ public class RenderChannel extends TileEntitySpecialRenderer
public static void render(int meta, byte sides)
{
RenderUtility.bind(TEXTURE);
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png");
MODEL_TROUGH_PIPE.render(sides, meta == 0 ? true : false);
}

View file

@ -303,10 +303,10 @@ public class PartMultimeter extends JCuboidPart implements IConnector<Multimeter
if (tileEntity instanceof IFluidHandler)
{
FluidTankInfo[] fluidInfo = ((IFluidHandler) tileEntity).getTankInfo(receivingSide);
for(FluidTankInfo info : fluidInfo)
for (FluidTankInfo info : fluidInfo)
{
if(info.fluid != null)
if (info.fluid != null)
getNetwork().fluidGraph.queue(info.fluid.amount);
}
}
@ -625,4 +625,14 @@ public class PartMultimeter extends JCuboidPart implements IConnector<Multimeter
return getNetwork().primaryRenderer == this;
}
@Override
@SideOnly(Side.CLIENT)
public Cuboid6 getRenderBounds()
{
if (isPrimaryRendering())
return Cuboid6.full.copy().expand(Double.POSITIVE_INFINITY);
return Cuboid6.full;
}
}

View file

@ -20,6 +20,7 @@ item.resonantinduction\:oreRubble.name=%v Rubble
### Archaic Module
## machineMaterials
tile.resonantinduction\:channel.name=Fluid Channel
tile.resonantinduction\:machineMaterial.0.name=Industrial Brick
tile.resonantinduction\:machineMaterial.1.name=Industrial Brick
tile.resonantinduction\:machineMaterial.2.name=Industrial Chiseled Brick