Rendering enhancements

This commit is contained in:
Aidan Brady 2013-12-12 22:31:27 -05:00
parent 55dd8f5bf9
commit 0e35aca15a
9 changed files with 20 additions and 8 deletions

View file

@ -1,4 +1,4 @@
package mekanism.client.render.mekanism.client.render;
package mekanism.client.render;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon;

View file

@ -105,7 +105,7 @@ public class RenderPartTransmitter implements IIconRegister
public void renderContents(PartUniversalCable cable, Vector3 pos)
{
if(cable.getTransmitterNetwork().clientEnergyScale == 0)
if(cable.currentPower == 0)
{
return;
}

View file

@ -65,7 +65,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
displayList[getStages(data.height)-1].render();
}
else {
displayList[(int)(((float)tileEntity.structure.fluidStored.amount/(float)tileEntity.clientCapacity)*((float)getStages(data.height)-1))].render();
displayList[(int)(tileEntity.prevScale*((float)getStages(data.height)-1))].render();
}
MekanismRenderer.glowOff();

View file

@ -53,6 +53,7 @@ public class MultipartMekanism implements IPartFactory, IPartConverter
int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
return PartTransmitter.getPartType(TransmissionType.fromOldMeta(meta));
}
return null;
}
}

View file

@ -6,8 +6,8 @@ import java.util.Set;
import mekanism.api.Object3D;
import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.PartTransmitterIcons;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
import mekanism.common.FluidNetwork;
import mekanism.common.PipeUtils;
import net.minecraft.client.renderer.texture.IconRegister;

View file

@ -10,8 +10,8 @@ import mekanism.api.gas.GasNetwork;
import mekanism.api.gas.IGasAcceptor;
import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.PartTransmitterIcons;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;

View file

@ -14,8 +14,8 @@ import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType;
import mekanism.api.transmitters.TransmissionType.Size;
import mekanism.api.transmitters.TransmitterNetworkRegistry;
import mekanism.client.render.PartTransmitterIcons;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
import mekanism.common.ITileNetwork;
import mekanism.common.Mekanism;
import mekanism.common.item.ItemConfigurator;

View file

@ -15,7 +15,6 @@ import codechicken.lib.vec.Vector3;
import codechicken.multipart.TileMultipart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon;
import universalelectricity.core.block.IConductor;
@ -35,6 +34,7 @@ import mekanism.api.energy.ICableOutputter;
import mekanism.api.energy.IStrictEnergyAcceptor;
import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.PartTransmitterIcons;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.EnergyNetwork;
import mekanism.common.Mekanism;
@ -51,8 +51,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implements IEnergySink, IEnergyHandler, IElectrical
{
public static PartTransmitterIcons cableIcons;
public double currentPower = 0;
@Override
@ -61,11 +61,13 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
if(world().isRemote)
{
double targetPower = getTransmitterNetwork().clientEnergyScale;
if(Math.abs(currentPower - targetPower) > 0.01)
{
currentPower = (9*currentPower + targetPower)/10;
}
}
super.update();
}

View file

@ -56,6 +56,8 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock
/** Whether or not this tank segment is rendering the structure. */
public boolean isRendering;
public float prevScale;
public TileEntityDynamicTank()
{
this("DynamicTank");
@ -104,6 +106,13 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock
{
Mekanism.proxy.doTankAnimation(this);
}
float targetScale = (float)(structure.fluidStored != null ? structure.fluidStored.amount : 0)/clientCapacity;
if(Math.abs(prevScale - targetScale) > 0.01)
{
prevScale = (9*prevScale + targetScale)/10;
}
}
prevStructure = clientHasStructure;