mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Doubled base Solar Evaporation Plant processing rate and added config property, double check transporter paths to prevent bad calculations
This commit is contained in:
1 parent
42ce42aee2
commit
81511d3800
5 files changed
+31
-7
No files matched your search
@@ -52,6 +52,7 @@ public class MekanismConfig
|
||||
public static int armoredJetpackDamageMax;
|
||||
public static boolean aestheticWorldDamage;
|
||||
public static boolean opsBypassRestrictions;
|
||||
public static double solarEvaporationSpeed;
|
||||
}
|
||||
|
||||
public static class client
|
||||
|
||||
@@ -259,6 +259,7 @@ public class CommonProxy
|
||||
general.armoredJetpackDamageMax = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115).getInt();
|
||||
general.aestheticWorldDamage = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AestheticWorldDamage", true).getBoolean();
|
||||
general.opsBypassRestrictions = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OpsBypassRestrictions", true).getBoolean();
|
||||
general.solarEvaporationSpeed = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SolarEvaporationSpeed", 1.0D).getDouble();
|
||||
|
||||
general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean();
|
||||
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean();
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.transmitters.ITransmitterTile;
|
||||
import mekanism.common.InventoryNetwork;
|
||||
import mekanism.common.InventoryNetwork.AcceptorData;
|
||||
import mekanism.common.base.ILogisticalTransporter;
|
||||
@@ -20,7 +19,6 @@ import mekanism.common.content.transporter.TransporterPathfinder.Pathfinder.Dest
|
||||
import mekanism.common.content.transporter.TransporterStack.Path;
|
||||
import mekanism.common.tile.TileEntityLogisticalSorter;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@@ -72,7 +70,7 @@ public final class TransporterPathfinder
|
||||
return new Destination(ret, true, null, 0).setPathType(Path.NONE);
|
||||
}
|
||||
else {
|
||||
Destination newPath = TransporterPathfinder.getNewBasePath((ILogisticalTransporter)((ITransmitterTile<IInventory, InventoryNetwork>)start.getTileEntity(worldObj)).getTransmitter(), transportStack, 0);
|
||||
Destination newPath = TransporterPathfinder.getNewBasePath(((ITransporterTile)start.getTileEntity(worldObj)).getTransmitter(), transportStack, 0);
|
||||
|
||||
if(newPath != null && TransporterManager.didEmit(transportStack.itemStack, newPath.rejected))
|
||||
{
|
||||
@@ -264,11 +262,33 @@ public final class TransporterPathfinder
|
||||
return paths;
|
||||
}
|
||||
|
||||
public static boolean checkPath(World world, List<Coord4D> path, TransporterStack stack)
|
||||
{
|
||||
for(int i = path.size()-1; i > 0; i--)
|
||||
{
|
||||
TileEntity tile = path.get(i).getTileEntity(world);
|
||||
|
||||
if(!(tile instanceof ITransporterTile))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ITransporterTile transporterTile = (ITransporterTile)tile;
|
||||
|
||||
if(transporterTile.getTransmitter() == null || (transporterTile.getTransmitter().getColor() != null && transporterTile.getTransmitter().getColor() != stack.color))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Destination getPath(DestChecker checker, EnumSet<ForgeDirection> sides, ILogisticalTransporter start, Coord4D dest, TransporterStack stack, ItemStack rejects, int min)
|
||||
{
|
||||
List<Coord4D> test = PathfinderCache.getCache(start.coord(), dest, sides);
|
||||
|
||||
if(test != null)
|
||||
if(test != null && checkPath(start.world(), test, stack))
|
||||
{
|
||||
return new Destination(test, false, rejects, 0).calculateScore(start.world());
|
||||
}
|
||||
@@ -296,7 +316,7 @@ public final class TransporterPathfinder
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return paths.get(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
dataStream.writeInt(general.armoredJetpackDamageMax);
|
||||
dataStream.writeBoolean(general.aestheticWorldDamage);
|
||||
dataStream.writeBoolean(general.opsBypassRestrictions);
|
||||
dataStream.writeDouble(general.solarEvaporationSpeed);
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
@@ -131,6 +132,7 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
general.armoredJetpackDamageMax = dataStream.readInt();
|
||||
general.aestheticWorldDamage = dataStream.readBoolean();
|
||||
general.opsBypassRestrictions = dataStream.readBoolean();
|
||||
general.solarEvaporationSpeed = dataStream.readDouble();
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Set;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.ISalinationSolar;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.client.SparkleAnimation.INodeChecker;
|
||||
import mekanism.common.Mekanism;
|
||||
@@ -28,7 +29,6 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -333,7 +333,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1 + (height-3)*0.5F;
|
||||
return 1 + (height-3)*(float)general.solarEvaporationSpeed;
|
||||
}
|
||||
|
||||
public float getTempMultiplier()
|
||||
|
||||
Reference in new issue
Block a user