Rendering enhancements
This commit is contained in:
parent
55dd8f5bf9
commit
0e35aca15a
9 changed files with 20 additions and 8 deletions
|
@ -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.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
|
@ -105,7 +105,7 @@ public class RenderPartTransmitter implements IIconRegister
|
||||||
|
|
||||||
public void renderContents(PartUniversalCable cable, Vector3 pos)
|
public void renderContents(PartUniversalCable cable, Vector3 pos)
|
||||||
{
|
{
|
||||||
if(cable.getTransmitterNetwork().clientEnergyScale == 0)
|
if(cable.currentPower == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
|
||||||
displayList[getStages(data.height)-1].render();
|
displayList[getStages(data.height)-1].render();
|
||||||
}
|
}
|
||||||
else {
|
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();
|
MekanismRenderer.glowOff();
|
||||||
|
|
|
@ -53,6 +53,7 @@ public class MultipartMekanism implements IPartFactory, IPartConverter
|
||||||
int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
|
int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
|
||||||
return PartTransmitter.getPartType(TransmissionType.fromOldMeta(meta));
|
return PartTransmitter.getPartType(TransmissionType.fromOldMeta(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Set;
|
||||||
import mekanism.api.Object3D;
|
import mekanism.api.Object3D;
|
||||||
import mekanism.api.transmitters.ITransmitter;
|
import mekanism.api.transmitters.ITransmitter;
|
||||||
import mekanism.api.transmitters.TransmissionType;
|
import mekanism.api.transmitters.TransmissionType;
|
||||||
|
import mekanism.client.render.PartTransmitterIcons;
|
||||||
import mekanism.client.render.RenderPartTransmitter;
|
import mekanism.client.render.RenderPartTransmitter;
|
||||||
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
|
|
||||||
import mekanism.common.FluidNetwork;
|
import mekanism.common.FluidNetwork;
|
||||||
import mekanism.common.PipeUtils;
|
import mekanism.common.PipeUtils;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
|
|
@ -10,8 +10,8 @@ import mekanism.api.gas.GasNetwork;
|
||||||
import mekanism.api.gas.IGasAcceptor;
|
import mekanism.api.gas.IGasAcceptor;
|
||||||
import mekanism.api.transmitters.ITransmitter;
|
import mekanism.api.transmitters.ITransmitter;
|
||||||
import mekanism.api.transmitters.TransmissionType;
|
import mekanism.api.transmitters.TransmissionType;
|
||||||
|
import mekanism.client.render.PartTransmitterIcons;
|
||||||
import mekanism.client.render.RenderPartTransmitter;
|
import mekanism.client.render.RenderPartTransmitter;
|
||||||
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
|
|
|
@ -14,8 +14,8 @@ import mekanism.api.transmitters.ITransmitter;
|
||||||
import mekanism.api.transmitters.TransmissionType;
|
import mekanism.api.transmitters.TransmissionType;
|
||||||
import mekanism.api.transmitters.TransmissionType.Size;
|
import mekanism.api.transmitters.TransmissionType.Size;
|
||||||
import mekanism.api.transmitters.TransmitterNetworkRegistry;
|
import mekanism.api.transmitters.TransmitterNetworkRegistry;
|
||||||
|
import mekanism.client.render.PartTransmitterIcons;
|
||||||
import mekanism.client.render.RenderPartTransmitter;
|
import mekanism.client.render.RenderPartTransmitter;
|
||||||
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
|
|
||||||
import mekanism.common.ITileNetwork;
|
import mekanism.common.ITileNetwork;
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
import mekanism.common.item.ItemConfigurator;
|
import mekanism.common.item.ItemConfigurator;
|
||||||
|
|
|
@ -15,7 +15,6 @@ import codechicken.lib.vec.Vector3;
|
||||||
import codechicken.multipart.TileMultipart;
|
import codechicken.multipart.TileMultipart;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import mekanism.client.render.mekanism.client.render.PartTransmitterIcons;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import universalelectricity.core.block.IConductor;
|
import universalelectricity.core.block.IConductor;
|
||||||
|
@ -35,6 +34,7 @@ import mekanism.api.energy.ICableOutputter;
|
||||||
import mekanism.api.energy.IStrictEnergyAcceptor;
|
import mekanism.api.energy.IStrictEnergyAcceptor;
|
||||||
import mekanism.api.transmitters.ITransmitter;
|
import mekanism.api.transmitters.ITransmitter;
|
||||||
import mekanism.api.transmitters.TransmissionType;
|
import mekanism.api.transmitters.TransmissionType;
|
||||||
|
import mekanism.client.render.PartTransmitterIcons;
|
||||||
import mekanism.client.render.RenderPartTransmitter;
|
import mekanism.client.render.RenderPartTransmitter;
|
||||||
import mekanism.common.EnergyNetwork;
|
import mekanism.common.EnergyNetwork;
|
||||||
import mekanism.common.Mekanism;
|
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 class PartUniversalCable extends PartTransmitter<EnergyNetwork> implements IEnergySink, IEnergyHandler, IElectrical
|
||||||
{
|
{
|
||||||
|
|
||||||
public static PartTransmitterIcons cableIcons;
|
public static PartTransmitterIcons cableIcons;
|
||||||
|
|
||||||
public double currentPower = 0;
|
public double currentPower = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,11 +61,13 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
|
||||||
if(world().isRemote)
|
if(world().isRemote)
|
||||||
{
|
{
|
||||||
double targetPower = getTransmitterNetwork().clientEnergyScale;
|
double targetPower = getTransmitterNetwork().clientEnergyScale;
|
||||||
|
|
||||||
if(Math.abs(currentPower - targetPower) > 0.01)
|
if(Math.abs(currentPower - targetPower) > 0.01)
|
||||||
{
|
{
|
||||||
currentPower = (9*currentPower + targetPower)/10;
|
currentPower = (9*currentPower + targetPower)/10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.update();
|
super.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock
|
||||||
/** Whether or not this tank segment is rendering the structure. */
|
/** Whether or not this tank segment is rendering the structure. */
|
||||||
public boolean isRendering;
|
public boolean isRendering;
|
||||||
|
|
||||||
|
public float prevScale;
|
||||||
|
|
||||||
public TileEntityDynamicTank()
|
public TileEntityDynamicTank()
|
||||||
{
|
{
|
||||||
this("DynamicTank");
|
this("DynamicTank");
|
||||||
|
@ -104,6 +106,13 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock
|
||||||
{
|
{
|
||||||
Mekanism.proxy.doTankAnimation(this);
|
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;
|
prevStructure = clientHasStructure;
|
||||||
|
|
Loading…
Reference in a new issue