Skip to content

Commit

Permalink
trim lossless wire configs
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Aug 9, 2021
1 parent 4f36d36 commit 90b8e04
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class WireProperties implements IMaterialProperty<WireProperties> {
public final int voltage;
public final int amperage;
public final int lossPerBlock;
public final boolean isSuperconductor = false; // todo implement

public WireProperties(int voltage, int baseAmperage, int lossPerBlock) {
this.voltage = voltage;
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ public class ConfigHolder {
@Config.RequiresMcRestart
public static int gasTurbineBonusOutput = 6144;

@Config.Comment("If true, powered zero loss wires will damage the player. Default: false")
public static boolean doLosslessWiresDamage = false;

@Config.Comment("If true, lossless cables will have lossy wires. Default: false")
@Config.RequiresMcRestart
public static boolean doLosslessWiresMakeLossyCables = false;

@Config.Comment("Array of blacklisted dimension IDs in which Air Collector does not work. Default: none")
public static int[] airCollectorDimensionBlacklist = new int[]{};

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/gregtech/common/pipelike/cable/BlockCable.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,10 @@ public boolean canPipeConnectToBlock(IPipeTile<Insulation, WireProperties> selfT
public void onEntityCollision(World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Entity entityIn) {
if (worldIn.isRemote) return;
Insulation insulation = getPipeTileEntity(worldIn, pos).getPipeType();
boolean damageOnLossless = ConfigHolder.doLosslessWiresDamage;
if (!worldIn.isRemote && insulation.insulationLevel == -1 && entityIn instanceof EntityLivingBase) {
EntityLivingBase entityLiving = (EntityLivingBase) entityIn;
EnergyNet energyNet = getWorldPipeNet(worldIn).getNetFromPos(pos);
if (energyNet != null && (damageOnLossless || energyNet.getAllNodes().get(pos).data.lossPerBlock > 0)) {
if (energyNet != null && (energyNet.getAllNodes().get(pos).data.lossPerBlock > 0)) {
long voltage = energyNet.getLastMaxVoltage();
long amperage = energyNet.getLastAmperage();
if (voltage > 0L && amperage > 0L) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public OrePrefix getOrePrefix() {
public WireProperties modifyProperties(WireProperties baseProperties) {

int lossPerBlock;
if (ConfigHolder.doLosslessWiresMakeLossyCables && baseProperties.lossPerBlock == 0)
if (!baseProperties.isSuperconductor && baseProperties.lossPerBlock == 0)
lossPerBlock = (int) (0.75 * lossMultiplier);
else lossPerBlock = baseProperties.lossPerBlock * lossMultiplier;

Expand Down

0 comments on commit 90b8e04

Please sign in to comment.