Completed Opaque Transmitter implementation. Yay!

This commit is contained in:
aidancbrady 2016-07-19 14:03:11 -04:00
parent 640de3ef4c
commit 0ae477fd01
39 changed files with 40 additions and 39 deletions

View file

@ -72,7 +72,6 @@ public class MekanismConfig
{
public static boolean enablePlayerSounds = true;
public static boolean enableMachineSounds = true;
public static boolean fancyUniversalCableRender = true;
public static boolean holidays = true;
public static float baseSoundVolume = 1F;
public static boolean machineEffects = true;
@ -81,7 +80,7 @@ public class MekanismConfig
public static boolean renderCTM = true;
public static boolean enableAmbientLighting;
public static int ambientLightingLevel;
public static boolean opaque = false;
public static boolean opaqueTransmitters = false;
}
public static class machines

View file

@ -216,18 +216,18 @@ public class ClientProxy extends CommonProxy
{
super.loadConfiguration();
client.enablePlayerSounds = Mekanism.configuration.get("client", "EnablePlayerSounds", true).getBoolean(true);
client.enableMachineSounds = Mekanism.configuration.get("client", "EnableMachineSounds", true).getBoolean(true);
client.fancyUniversalCableRender = Mekanism.configuration.get("client", "FancyUniversalCableRender", true).getBoolean(true);
client.holidays = Mekanism.configuration.get("client", "Holidays", true).getBoolean(true);
client.baseSoundVolume = (float)Mekanism.configuration.get("client", "SoundVolume", 1D).getDouble(1D);
client.machineEffects = Mekanism.configuration.get("client", "MachineEffects", true).getBoolean(true);
client.enablePlayerSounds = Mekanism.configuration.get("client", "EnablePlayerSounds", true).getBoolean();
client.enableMachineSounds = Mekanism.configuration.get("client", "EnableMachineSounds", true).getBoolean();
client.holidays = Mekanism.configuration.get("client", "Holidays", true).getBoolean();
client.baseSoundVolume = (float)Mekanism.configuration.get("client", "SoundVolume", 1D).getDouble();
client.machineEffects = Mekanism.configuration.get("client", "MachineEffects", true).getBoolean();
client.oldTransmitterRender = Mekanism.configuration.get("client", "OldTransmitterRender", false).getBoolean();
client.replaceSoundsWhenResuming = Mekanism.configuration.get("client", "ReplaceSoundsWhenResuming", true,
"If true, will reduce lagging between player sounds. Setting to false will reduce GC load").getBoolean();
client.renderCTM = Mekanism.configuration.get("client", "CTMRenderer", true).getBoolean();
client.enableAmbientLighting = Mekanism.configuration.get("general", "EnableAmbientLighting", true).getBoolean();
client.ambientLightingLevel = Mekanism.configuration.get("general", "AmbientLightingLevel", 15).getInt();
client.enableAmbientLighting = Mekanism.configuration.get("client", "EnableAmbientLighting", true).getBoolean();
client.ambientLightingLevel = Mekanism.configuration.get("client", "AmbientLightingLevel", 15).getInt();
client.opaqueTransmitters = Mekanism.configuration.get("client", "OpaqueTransmitterRender", false).getBoolean();
if(Mekanism.configuration.hasChanged())
{

View file

@ -7,6 +7,7 @@ import java.util.Collection;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.MekanismConfig.client;
import mekanism.api.Range4D;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter;
@ -48,7 +49,6 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
public Tier.TransporterTier tier = Tier.TransporterTier.BASIC;
public static TransmitterIcons transporterIcons = new TransmitterIcons(8, 16);
private static boolean opaque = Mekanism.configuration.get("client", "opaque", false).getBoolean();
public int pullDelay = 0;
@ -95,7 +95,7 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
@SideOnly(Side.CLIENT)
public void renderDynamic(Vector3 pos, float f, int pass)
{
if(pass == 0 && !opaque)
if(pass == 0 && !client.opaqueTransmitters)
{
RenderPartTransmitter.getInstance().renderContents(this, f, pos);
}

View file

@ -2,10 +2,10 @@ package mekanism.common.multipart;
import java.util.Collection;
import mekanism.api.MekanismConfig.client;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.FluidNetwork;
import mekanism.common.Mekanism;
import mekanism.common.Tier;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.PipeTier;
@ -31,7 +31,6 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PartMechanicalPipe extends PartTransmitter<IFluidHandler, FluidNetwork> implements IFluidHandler
{
public static TransmitterIcons pipeIcons = new TransmitterIcons(4, 8);
private static boolean opaque = Mekanism.configuration.get("client", "opaque", false).getBoolean();
public float currentScale;
@ -229,7 +228,7 @@ public class PartMechanicalPipe extends PartTransmitter<IFluidHandler, FluidNetw
@SideOnly(Side.CLIENT)
public void renderDynamic(Vector3 pos, float f, int pass)
{
if(pass == 0 && !opaque)
if(pass == 0 && !client.opaqueTransmitters)
{
RenderPartTransmitter.getInstance().renderContents(this, pos);
}

View file

@ -2,6 +2,7 @@ package mekanism.common.multipart;
import java.util.Collection;
import mekanism.api.MekanismConfig.client;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasNetwork;
import mekanism.api.gas.GasStack;
@ -10,7 +11,6 @@ import mekanism.api.gas.GasTransmission;
import mekanism.api.gas.IGasHandler;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.Mekanism;
import mekanism.common.Tier;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.TubeTier;
@ -31,7 +31,6 @@ public class PartPressurizedTube extends PartTransmitter<IGasHandler, GasNetwork
public Tier.TubeTier tier = Tier.TubeTier.BASIC;
public static TransmitterIcons tubeIcons = new TransmitterIcons(4, 8);
private static boolean opaque = Mekanism.configuration.get("client", "opaque", false).getBoolean();
public float currentScale;
@ -235,7 +234,7 @@ public class PartPressurizedTube extends PartTransmitter<IGasHandler, GasNetwork
@SideOnly(Side.CLIENT)
public void renderDynamic(Vector3 pos, float f, int pass)
{
if(pass == 0 && !opaque)
if(pass == 0 && !client.opaqueTransmitters)
{
RenderPartTransmitter.getInstance().renderContents(this, pos);
}

View file

@ -4,10 +4,10 @@ import java.util.Collection;
import mekanism.api.Coord4D;
import mekanism.api.IHeatTransfer;
import mekanism.api.MekanismConfig.client;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.HeatNetwork;
import mekanism.common.Mekanism;
import mekanism.common.Tier;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.ConductorTier;
@ -29,7 +29,6 @@ public class PartThermodynamicConductor extends PartTransmitter<IHeatTransfer, H
public Tier.ConductorTier tier;
public static TransmitterIcons conductorIcons = new TransmitterIcons(4, 8);
private static boolean opaque = Mekanism.configuration.get("client", "opaque", false).getBoolean();
public double temperature = 0;
public double clientTemperature = 0;
@ -125,7 +124,7 @@ public class PartThermodynamicConductor extends PartTransmitter<IHeatTransfer, H
@SideOnly(Side.CLIENT)
public void renderDynamic(Vector3 pos, float f, int pass)
{
if(pass == 0 && !opaque)
if(pass == 0 && !client.opaqueTransmitters)
{
RenderPartTransmitter.getInstance().renderContents(this, pos);
}

View file

@ -14,7 +14,6 @@ import mekanism.api.energy.IStrictEnergyStorage;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.EnergyNetwork;
import mekanism.common.Mekanism;
import mekanism.common.Tier;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.CableTier;
@ -39,7 +38,6 @@ public class PartUniversalCable extends PartTransmitter<EnergyAcceptorWrapper, E
public Tier.CableTier tier;
public static TransmitterIcons cableIcons = new TransmitterIcons(4, 8);
private static boolean opaque = Mekanism.configuration.get("client", "opaque", false).getBoolean();
public double currentPower = 0;
public double lastWrite = 0;
@ -232,7 +230,7 @@ public class PartUniversalCable extends PartTransmitter<EnergyAcceptorWrapper, E
@SideOnly(Side.CLIENT)
public void renderDynamic(Vector3 pos, float frame, int pass)
{
if(pass == 0 && client.fancyUniversalCableRender && !opaque)
if(pass == 0 && !client.opaqueTransmitters)
{
RenderPartTransmitter.getInstance().renderContents(this, pos);
}

View file

@ -1,6 +1,6 @@
package mekanism.common.multipart;
import mekanism.common.Mekanism;
import mekanism.api.MekanismConfig.client;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
@ -8,23 +8,25 @@ public class TransmitterIcons
{
private IIcon[] sideIcons;
private IIcon[] centerIcons;
private static boolean opaque = Mekanism.configuration.get("client", "opaque", false).getBoolean();
private IIcon[] sideIcons_opaque;
private IIcon[] centerIcons_opaque;
public TransmitterIcons(int numCentres, int numSides)
{
sideIcons = new IIcon[numSides];
centerIcons = new IIcon[numCentres];
sideIcons_opaque = new IIcon[numSides];
centerIcons_opaque = new IIcon[numCentres];
}
public void registerCenterIcons(IIconRegister register, String[] filenames)
{
for(int i = 0; i < centerIcons.length; i++)
{
if(!opaque) {
centerIcons[i] = register.registerIcon("mekanism:models/" + filenames[i]);
} else {
centerIcons[i] = register.registerIcon("mekanism:models/opaque/" + filenames[i]);
}
centerIcons_opaque[i] = register.registerIcon("mekanism:models/opaque/" + filenames[i]);
}
}
@ -32,21 +34,18 @@ public class TransmitterIcons
{
for(int i = 0; i < sideIcons.length; i++)
{
if(!opaque) {
sideIcons[i] = register.registerIcon("mekanism:models/" + filenames[i]);
} else {
sideIcons[i] = register.registerIcon("mekanism:models/opaque/" + filenames[i]);
}
sideIcons_opaque[i] = register.registerIcon("mekanism:models/opaque/" + filenames[i]);
}
}
public IIcon getSideIcon(int n)
{
return sideIcons[n];
return client.opaqueTransmitters ? sideIcons_opaque[n] : sideIcons[n];
}
public IIcon getCenterIcon(int n)
{
return centerIcons[n];
return client.opaqueTransmitters ? centerIcons_opaque[n] : centerIcons[n];
}
}

View file

@ -6,6 +6,7 @@ import java.util.Collection;
import java.util.HashSet;
import mekanism.api.Coord4D;
import mekanism.api.MekanismConfig.client;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasNetwork;
import mekanism.api.gas.GasRegistry;
@ -61,7 +62,13 @@ public class PacketTransmitterUpdate implements IMessageHandler<TransmitterUpdat
network.updateCapacity();
}
}
else if(message.packetType == PacketType.ENERGY)
if(client.opaqueTransmitters)
{
return null;
}
if(message.packetType == PacketType.ENERGY)
{
TileEntity tileEntity = message.coord4D.getTileEntity(player.worldObj);
@ -119,6 +126,7 @@ public class PacketTransmitterUpdate implements IMessageHandler<TransmitterUpdat
}
}
}
return null;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB