Compare commits

...

2 Commits

Author SHA1 Message Date
Tom Dodd 918bcb6813 Merge branch 'master' of https://github.com/turbodiesel4598/NuclearCraft 2020-08-10 18:14:54 +01:00
Tom Dodd fbea471f1c Moving towards v2o.3.7 2020-08-10 18:14:48 +01:00
15 changed files with 177 additions and 87 deletions

View File

@ -2,8 +2,16 @@ v2o.3.7
* Updated Chinese Patchouli localisation [thanks to WuzgXY and ghostbird03!]
* Tweaked turbine throughput bonus (ask in Discord server for subtle details)
* Tweaked default turbine coil efficiencies
* Fixed crash when shift-clicking items in the vessel and heater port GUIs
* Hopefully fixed even more turbine rotor render crashes
+ Added config to give players total radiation immunity
+ Added config to disable chunk radiation non-TE block contributions
* Fixed radiation immunity not being applied when radiation death persistence is disabled
v2o.3.6
* Hopefully fixed more turbine rotor render crashes

View File

@ -507,7 +507,7 @@ ________________________________________________________________________________
Note A: These methods must use the `preinit` loader!
Note B: If ContentTweaker is installed, assets can be located in its generated resources directory rather than a resource pack!
Note B: If ContentTweaker is installed, assets can be located in its generated resources directory rather than a resource pack. Make sure to use a new `nuclearcraft` sub-directory rather than the generated `contenttweaker` one!
mods.nuclearcraft.Registration.registerFissionSink(String sinkID, int coolingRate, String placementRule);
mods.nuclearcraft.Registration.registerFissionHeater(String heaterID, String fluidInput, int inputAmount, String fluidOutput, int outputAmount, int coolingRate, String placementRule);

View File

@ -254,6 +254,8 @@ public class NCConfig {
private static boolean radiation_enabled;
public static boolean radiation_enabled_public;
public static String[] radiation_immune_players;
public static int radiation_world_chunks_per_tick;
public static int radiation_player_tick_rate;
@ -284,6 +286,7 @@ public class NCConfig {
public static double radiation_lowest_rate;
public static double radiation_chunk_limit;
public static boolean radiation_check_blocks;
public static int radiation_block_effect_max_rate;
public static double radiation_rain_mult;
public static double radiation_swim_mult;
@ -721,7 +724,7 @@ public class NCConfig {
propertyTurbineBladeExpansion.setLanguageKey("gui.nc.config.turbine_blade_expansion");
Property propertyTurbineStatorExpansion = config.get(CATEGORY_TURBINE, "turbine_stator_expansion", 0.75D, Lang.localise("gui.nc.config.turbine_stator_expansion.comment"), 0.01D, 1D);
propertyTurbineStatorExpansion.setLanguageKey("gui.nc.config.turbine_stator_expansion");
Property propertyTurbineCoilConductivity = config.get(CATEGORY_TURBINE, "turbine_coil_conductivity", new double[] {0.86D, 0.9D, 0.98D, 1.04D, 1.1D, 1.12D}, Lang.localise("gui.nc.config.turbine_coil_conductivity.comment"), 0.01D, 15D);
Property propertyTurbineCoilConductivity = config.get(CATEGORY_TURBINE, "turbine_coil_conductivity", new double[] {0.88D, 0.9D, 1D, 1.04D, 1.06D, 1.12D}, Lang.localise("gui.nc.config.turbine_coil_conductivity.comment"), 0.01D, 15D);
propertyTurbineCoilConductivity.setLanguageKey("gui.nc.config.turbine_coil_conductivity");
Property propertyTurbineCoilRule = config.get(CATEGORY_TURBINE, "turbine_coil_rule", new String[] { "one bearing || one connector", "one magnesium coils", "two magnesium coil", "one aluminum coil", "one beryllium coil", "one gold coil && one copper coil" }, Lang.localise("gui.nc.config.turbine_coil_rule.comment"));
propertyTurbineCoilRule.setLanguageKey("gui.nc.config.turbine_coil_rule");
@ -796,6 +799,9 @@ public class NCConfig {
Property propertyRadiationEnabled = config.get(CATEGORY_RADIATION, "radiation_enabled", true, Lang.localise("gui.nc.config.radiation_enabled.comment"));
propertyRadiationEnabled.setLanguageKey("gui.nc.config.radiation_enabled");
Property propertyRadiationImmunePlayers = config.get(CATEGORY_RADIATION, "radiation_immune_players", new String[] {}, Lang.localise("gui.nc.config.radiation_immune_players.comment"));
propertyRadiationImmunePlayers.setLanguageKey("gui.nc.config.radiation_immune_players");
Property propertyRadiationWorldChunksPerTick = config.get(CATEGORY_RADIATION, "radiation_world_chunks_per_tick", 5, Lang.localise("gui.nc.config.radiation_world_chunks_per_tick.comment"), 1, 400);
propertyRadiationWorldChunksPerTick.setLanguageKey("gui.nc.config.radiation_world_chunks_per_tick");
Property propertyRadiationPlayerTickRate = config.get(CATEGORY_RADIATION, "radiation_player_tick_rate", 5, Lang.localise("gui.nc.config.radiation_player_tick_rate.comment"), 1, 400);
@ -851,6 +857,9 @@ public class NCConfig {
propertyRadiationLowestRate.setLanguageKey("gui.nc.config.radiation_lowest_rate");
Property propertyRadiationChunkLimit = config.get(CATEGORY_RADIATION, "radiation_chunk_limit", -1D, Lang.localise("gui.nc.config.radiation_chunk_limit.comment"), -1D, Double.MAX_VALUE);
propertyRadiationChunkLimit.setLanguageKey("gui.nc.config.radiation_chunk_limit");
Property propertyRadiationCheckBlocks = config.get(CATEGORY_RADIATION, "radiation_check_blocks", true, Lang.localise("gui.config.radiation.radiation_check_blocks.comment"));
propertyRadiationCheckBlocks.setLanguageKey("gui.config.radiation.radiation_check_blocks");
Property propertyRadiationBlockEffectMaxRate = config.get(CATEGORY_RADIATION, "radiation_block_effect_max_rate", 0, Lang.localise("gui.nc.config.radiation_block_effect_max_rate.comment"), 0, 15);
propertyRadiationBlockEffectMaxRate.setLanguageKey("gui.nc.config.radiation_block_effect_max_rate");
Property propertyRadiationRainMult = config.get(CATEGORY_RADIATION, "radiation_rain_mult", 1D, Lang.localise("gui.nc.config.radiation_rain_mult.comment"), 0.000001D, 1000000D);
@ -1232,6 +1241,7 @@ public class NCConfig {
List<String> propertyOrderRadiation = new ArrayList<>();
propertyOrderRadiation.add(propertyRadiationEnabled.getName());
propertyOrderRadiation.add(propertyRadiationImmunePlayers.getName());
propertyOrderRadiation.add(propertyRadiationWorldChunksPerTick.getName());
propertyOrderRadiation.add(propertyRadiationPlayerTickRate.getName());
propertyOrderRadiation.add(propertyRadiationWorlds.getName());
@ -1258,8 +1268,7 @@ public class NCConfig {
propertyOrderRadiation.add(propertyRadiationDecayRate.getName());
propertyOrderRadiation.add(propertyRadiationLowestRate.getName());
propertyOrderRadiation.add(propertyRadiationChunkLimit.getName());
// propertyOrderRadiation.add(propertyRadiationBlockEffects.getName());
// propertyOrderRadiation.add(propertyRadiationBlockEffectLimit.getName());
propertyOrderRadiation.add(propertyRadiationCheckBlocks.getName());
propertyOrderRadiation.add(propertyRadiationBlockEffectMaxRate.getName());
propertyOrderRadiation.add(propertyRadiationRainMult.getName());
propertyOrderRadiation.add(propertyRadiationSwimMult.getName());
@ -1545,6 +1554,8 @@ public class NCConfig {
radiation_enabled = propertyRadiationEnabled.getBoolean();
radiation_immune_players = propertyRadiationImmunePlayers.getStringList();
radiation_world_chunks_per_tick = propertyRadiationWorldChunksPerTick.getInt();
radiation_player_tick_rate = propertyRadiationPlayerTickRate.getInt();
@ -1575,10 +1586,7 @@ public class NCConfig {
radiation_lowest_rate = propertyRadiationLowestRate.getDouble();
radiation_chunk_limit = propertyRadiationChunkLimit.getDouble();
// radiation_block_effects =
// propertyRadiationBlockEffects.getStringList();
// radiation_block_effect_limit =
// propertyRadiationBlockEffectLimit.getDouble();
radiation_check_blocks = propertyRadiationCheckBlocks.getBoolean();
radiation_block_effect_max_rate = propertyRadiationBlockEffectMaxRate.getInt();
radiation_rain_mult = propertyRadiationRainMult.getDouble();
radiation_swim_mult = propertyRadiationSwimMult.getDouble();
@ -1866,6 +1874,8 @@ public class NCConfig {
propertyRadiationEnabled.set(radiation_enabled);
propertyRadiationImmunePlayers.set(radiation_immune_players);
propertyRadiationWorldChunksPerTick.set(radiation_world_chunks_per_tick);
propertyRadiationPlayerTickRate.set(radiation_player_tick_rate);
@ -1896,8 +1906,7 @@ public class NCConfig {
propertyRadiationLowestRate.set(radiation_lowest_rate);
propertyRadiationChunkLimit.set(radiation_chunk_limit);
// propertyRadiationBlockEffects.set(radiation_block_effects);
// propertyRadiationBlockEffectLimit.set(radiation_block_effect_limit);
propertyRadiationCheckBlocks.set(radiation_check_blocks);
propertyRadiationBlockEffectMaxRate.set(radiation_block_effect_max_rate);
propertyRadiationRainMult.set(radiation_rain_mult);
propertyRadiationSwimMult.set(radiation_swim_mult);

View File

@ -42,10 +42,8 @@ public class PlayerRespawnHandler {
if (event.isWasDeath()) {
if (radiation_death_persist) {
newRads.setTotalRads(oldRads.getTotalRads() * radiation_death_persist_fraction % oldRads.getMaxRads(), false);
newRads.setRadiationImmunityTime(oldRads.getTotalRads() * radiation_death_immunity_time * 20D / oldRads.getMaxRads());
}
newRads.setGiveGuidebook(oldRads.getGiveGuidebook());
newRads.setRadiationImmunityTime(radiation_death_immunity_time * 20D);
}
else {
newRads.setConsumedMedicine(oldRads.getConsumedMedicine());
@ -65,8 +63,9 @@ public class PlayerRespawnHandler {
newRads.setRecentRadXAddition(oldRads.getRecentRadXAddition());
newRads.setShouldWarn(oldRads.getShouldWarn());
newRads.setTotalRads(oldRads.getTotalRads(), false);
newRads.setGiveGuidebook(oldRads.getGiveGuidebook());
}
newRads.setGiveGuidebook(oldRads.getGiveGuidebook());
}
}

View File

@ -42,7 +42,7 @@ public class ContainerFissionHeaterPort extends ContainerTile<TileFissionHeaterP
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = inventorySlots.get(index);
int invStart = 2, invEnd = 38;
int invStart = 0, invEnd = 36;
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();

View File

@ -42,7 +42,7 @@ public class ContainerFissionVesselPort extends ContainerTile<TileFissionVesselP
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = inventorySlots.get(index);
int invStart = 2, invEnd = 38;
int invStart = 0, invEnd = 36;
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();

View File

@ -9,6 +9,7 @@ import net.minecraft.util.math.BlockPos;
public class TurbineFormPacket extends MultiblockUpdatePacket {
public boolean nullArray;
public BlockPos[] bladePosArray;
public Vector3f[] renderPosArray;
public float[] bladeAngleArray;
@ -19,6 +20,7 @@ public class TurbineFormPacket extends MultiblockUpdatePacket {
public TurbineFormPacket(BlockPos pos, BlockPos[] bladePosArray, Vector3f[] renderPosArray, float[] bladeAngleArray) {
this.pos = pos;
nullArray = bladePosArray == null || renderPosArray == null || bladeAngleArray == null;
this.bladePosArray = bladePosArray;
this.renderPosArray = renderPosArray;
this.bladeAngleArray = bladeAngleArray;
@ -29,19 +31,21 @@ public class TurbineFormPacket extends MultiblockUpdatePacket {
@Override
public void readMessage(ByteBuf buf) {
pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
bladePosArray = new BlockPos[buf.readInt()];
for (int i = 0; i < bladePosArray.length; i++) {
bladePosArray[i] = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
nullArray = buf.readBoolean();
if (!nullArray) {
bladePosArray = new BlockPos[buf.readInt()];
for (int i = 0; i < bladePosArray.length; i++) {
bladePosArray[i] = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
}
renderPosArray = new Vector3f[buf.readInt()];
for (int i = 0; i < renderPosArray.length; i++) {
renderPosArray[i] = new Vector3f(buf.readFloat(), buf.readFloat(), buf.readFloat());
}
bladeAngleArray = new float[buf.readInt()];
for (int i = 0; i < bladeAngleArray.length; i++) {
bladeAngleArray[i] = buf.readFloat();
}
}
renderPosArray = new Vector3f[buf.readInt()];
for (int i = 0; i < renderPosArray.length; i++) {
renderPosArray[i] = new Vector3f(buf.readFloat(), buf.readFloat(), buf.readFloat());
}
bladeAngleArray = new float[buf.readInt()];
for (int i = 0; i < bladeAngleArray.length; i++) {
bladeAngleArray[i] = buf.readFloat();
}
}
@Override
@ -49,21 +53,24 @@ public class TurbineFormPacket extends MultiblockUpdatePacket {
buf.writeInt(pos.getX());
buf.writeInt(pos.getY());
buf.writeInt(pos.getZ());
buf.writeInt(bladePosArray.length);
for (BlockPos rotorPos : bladePosArray) {
buf.writeInt(rotorPos.getX());
buf.writeInt(rotorPos.getY());
buf.writeInt(rotorPos.getZ());
}
buf.writeInt(renderPosArray.length);
for (Vector3f planePos : renderPosArray) {
buf.writeFloat(planePos.x);
buf.writeFloat(planePos.y);
buf.writeFloat(planePos.z);
}
buf.writeInt(bladeAngleArray.length);
for (float bladeAngle : bladeAngleArray) {
buf.writeFloat(bladeAngle);
buf.writeBoolean(nullArray);
if (!nullArray) {
buf.writeInt(bladePosArray.length);
for (BlockPos rotorPos : bladePosArray) {
buf.writeInt(rotorPos.getX());
buf.writeInt(rotorPos.getY());
buf.writeInt(rotorPos.getZ());
}
buf.writeInt(renderPosArray.length);
for (Vector3f planePos : renderPosArray) {
buf.writeFloat(planePos.x);
buf.writeFloat(planePos.y);
buf.writeFloat(planePos.z);
}
buf.writeInt(bladeAngleArray.length);
for (float bladeAngle : bladeAngleArray) {
buf.writeFloat(bladeAngle);
}
}
}

View File

@ -10,19 +10,32 @@ import javax.vecmath.Vector3f;
import com.google.common.collect.Lists;
import it.unimi.dsi.fastutil.doubles.*;
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
import it.unimi.dsi.fastutil.doubles.DoubleList;
import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.objects.*;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectSet;
import nc.Global;
import nc.config.NCConfig;
import nc.handler.SoundHandler.SoundInfo;
import nc.multiblock.*;
import nc.multiblock.ILogicMultiblock;
import nc.multiblock.Multiblock;
import nc.multiblock.cuboidal.CuboidalMultiblock;
import nc.multiblock.network.*;
import nc.multiblock.network.TurbineFormPacket;
import nc.multiblock.network.TurbineRenderPacket;
import nc.multiblock.network.TurbineUpdatePacket;
import nc.multiblock.tile.ITileMultiblockPart;
import nc.multiblock.tile.TileBeefAbstract.SyncReason;
import nc.multiblock.turbine.TurbineRotorBladeUtil.*;
import nc.multiblock.turbine.tile.*;
import nc.recipe.*;
import nc.multiblock.turbine.TurbineRotorBladeUtil.ITurbineRotorBlade;
import nc.multiblock.turbine.TurbineRotorBladeUtil.TurbinePartDir;
import nc.multiblock.turbine.tile.ITurbineController;
import nc.multiblock.turbine.tile.ITurbinePart;
import nc.multiblock.turbine.tile.TileTurbineRotorBlade;
import nc.multiblock.turbine.tile.TileTurbineRotorStator;
import nc.recipe.ProcessorRecipe;
import nc.recipe.RecipeInfo;
import nc.tile.internal.energy.EnergyStorage;
import nc.tile.internal.fluid.Tank;
import nc.util.NCMath;
@ -32,7 +45,8 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.MutableBlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.*;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacket> implements ILogicMultiblock<TurbineLogic, ITurbinePart> {
@ -56,7 +70,7 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
public double rawPower = 0D, rawLimitPower = 0D, rawMaxPower = 0D;
public EnumFacing flowDir = null;
public int shaftWidth = 0, inertia = 0, bladeLength = 0, noBladeSets = 0, recipeInputRate = 0, dynamoCoilCount = 0, dynamoCoilCountOpposite = 0;
public double totalExpansionLevel = 1D, idealTotalExpansionLevel = 1D, basePowerPerMB = 0D, recipeInputRateFP = 0D, maxBladeExpansionCoefficient = 1D, bearingTension = 0D;
public double totalExpansionLevel = 1D, idealTotalExpansionLevel = 1D, basePowerPerMB = 0D, recipeInputRateFP = 0D, minBladeExpansionCoefficient = Double.MAX_VALUE, maxBladeExpansionCoefficient = 1D, minStatorExpansionCoefficient = 1D, maxStatorExpansionCoefficient = Double.MIN_VALUE, effectiveMaxLength = NCConfig.turbine_max_size, bearingTension = 0D;
public DoubleList expansionLevels = new DoubleArrayList(), rawBladeEfficiencies = new DoubleArrayList();
@SideOnly(Side.CLIENT)
@ -230,6 +244,9 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
}
public TurbinePartDir getShaftDir() {
if (flowDir == null) {
return TurbinePartDir.Y;
}
switch (flowDir.getAxis()) {
case Y:
return TurbinePartDir.Y;
@ -243,6 +260,9 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
}
public TurbinePartDir getBladeDir(PlaneDir planeDir) {
if (flowDir == null) {
return TurbinePartDir.Y;
}
switch (flowDir.getAxis()) {
case Y:
switch (planeDir) {
@ -326,7 +346,11 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
data.setDouble("idealTotalExpansionLevel", idealTotalExpansionLevel);
data.setDouble("basePowerPerMB", basePowerPerMB);
data.setDouble("recipeInputRateFP", recipeInputRateFP);
data.setDouble("minBladeExpansionCoefficient", minBladeExpansionCoefficient);
data.setDouble("maxBladeExpansionCoefficient", maxBladeExpansionCoefficient);
data.setDouble("minStatorExpansionCoefficient", minStatorExpansionCoefficient);
data.setDouble("maxStatorExpansionCoefficient", maxStatorExpansionCoefficient);
data.setDouble("effectiveMaxLength", effectiveMaxLength);
data.setDouble("bearingTension", bearingTension);
data.setInteger("expansionLevelsSize", expansionLevels.size());
for (int i = 0; i < expansionLevels.size(); i++) {
@ -369,7 +393,11 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
idealTotalExpansionLevel = data.getDouble("idealTotalExpansionLevel");
basePowerPerMB = data.getDouble("basePowerPerMB");
recipeInputRateFP = data.getDouble("recipeInputRateFP");
minBladeExpansionCoefficient = data.getDouble("minBladeExpansionCoefficient");
maxBladeExpansionCoefficient = data.getDouble("maxBladeExpansionCoefficient");
minStatorExpansionCoefficient = data.getDouble("minStatorExpansionCoefficient");
maxStatorExpansionCoefficient = data.getDouble("maxStatorExpansionCoefficient");
effectiveMaxLength = data.getDouble("effectiveMaxLength");
bearingTension = data.getDouble("bearingTension");
expansionLevels = new DoubleArrayList();
if (data.hasKey("expansionLevelsSize")) {

View File

@ -273,7 +273,9 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
getTurbine().angVel = getTurbine().rotorAngle = 0F;
getTurbine().flowDir = null;
getTurbine().shaftWidth = getTurbine().inertia = getTurbine().bladeLength = getTurbine().noBladeSets = getTurbine().recipeInputRate = 0;
getTurbine().totalExpansionLevel = getTurbine().idealTotalExpansionLevel = getTurbine().maxBladeExpansionCoefficient = 1D;
getTurbine().totalExpansionLevel = getTurbine().idealTotalExpansionLevel = getTurbine().maxBladeExpansionCoefficient = getTurbine().minStatorExpansionCoefficient = 1D;
getTurbine().minBladeExpansionCoefficient = Double.MAX_VALUE;
getTurbine().maxStatorExpansionCoefficient = Double.MIN_VALUE;
getTurbine().particleEffect = "cloud";
getTurbine().particleSpeedMult = 1D / 23.2D;
getTurbine().basePowerPerMB = getTurbine().recipeInputRateFP = 0D;
@ -659,8 +661,13 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
getTurbine().totalExpansionLevel *= currentBladeType.getExpansionCoefficient();
getTurbine().rawBladeEfficiencies.add(currentBladeType.getEfficiency());
if (!(currentBladeType instanceof IRotorStatorType)) {
if (currentBladeType instanceof IRotorStatorType) {
getTurbine().minStatorExpansionCoefficient = Math.min(currentBladeType.getExpansionCoefficient(), getTurbine().minStatorExpansionCoefficient);
getTurbine().maxStatorExpansionCoefficient = Math.max(currentBladeType.getExpansionCoefficient(), getTurbine().maxStatorExpansionCoefficient);
}
else {
getTurbine().noBladeSets++;
getTurbine().minBladeExpansionCoefficient = Math.min(currentBladeType.getExpansionCoefficient(), getTurbine().minBladeExpansionCoefficient);
getTurbine().maxBladeExpansionCoefficient = Math.max(currentBladeType.getExpansionCoefficient(), getTurbine().maxBladeExpansionCoefficient);
}
}
@ -701,6 +708,7 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
refreshRecipe();
setRotorEfficiency();
setEffectiveMaxLength();
setInputRatePowerBonus();
double previousRawPower = getTurbine().rawPower, previousRawLimitPower = getTurbine().rawLimitPower, previousRawMaxPower = getTurbine().rawMaxPower;
@ -927,15 +935,27 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
}
public double getThroughputEfficiency() {
double leniencyMult = Math.max(turbine_throughput_efficiency_leniency, getTurbine().idealTotalExpansionLevel <= 1D || getTurbine().maxBladeExpansionCoefficient <= 1 ? Double.MAX_VALUE : Math.ceil(Math.log(getTurbine().idealTotalExpansionLevel) / Math.log(getTurbine().maxBladeExpansionCoefficient)));
double leniencyMult = Math.max(turbine_throughput_efficiency_leniency, getTurbine().idealTotalExpansionLevel <= 1D || getTurbine().maxBladeExpansionCoefficient <= 1D ? Double.MAX_VALUE : Math.ceil(Math.log(getTurbine().idealTotalExpansionLevel) / Math.log(getTurbine().maxBladeExpansionCoefficient)));
double absoluteLeniency = getTurbine().getBladeArea() * leniencyMult * turbine_mb_per_blade;
return getMaxRecipeRateMultiplier() == 0 ? 1D : Math.min(1D, (getTurbine().recipeInputRateFP + absoluteLeniency) / getMaxRecipeRateMultiplier());
}
public void setEffectiveMaxLength() {
if (getTurbine().minBladeExpansionCoefficient <= 1) {
getTurbine().effectiveMaxLength = getMaximumInteriorLength();
}
else if (getTurbine().minStatorExpansionCoefficient >= 1) {
getTurbine().effectiveMaxLength = NCMath.clamp(Math.log(getTurbine().idealTotalExpansionLevel)/Math.log(getTurbine().minBladeExpansionCoefficient), 1D, getMaximumInteriorLength());
}
else {
getTurbine().effectiveMaxLength = NCMath.clamp((Math.log(getTurbine().idealTotalExpansionLevel) - getMaximumInteriorLength()*Math.log(getTurbine().minStatorExpansionCoefficient))/(Math.log(getTurbine().minBladeExpansionCoefficient) - Math.log(getTurbine().minStatorExpansionCoefficient)), 1D, getMaximumInteriorLength());
}
}
public void setInputRatePowerBonus() {
double rate = (double) Math.min(getTurbine().recipeInputRate, getMaxRecipeRateMultiplier());
double lengthBonus = rate / (turbine_mb_per_blade * getTurbine().getBladeArea() * getMaximumInteriorLength());
double areaBonus = Math.sqrt(2D * rate / (turbine_mb_per_blade * getTurbine().getFlowLength() * NCMath.sq(getMaximumInteriorLength())));
double lengthBonus = rate / (turbine_mb_per_blade * getTurbine().getBladeArea() * getTurbine().effectiveMaxLength);
double areaBonus = Math.sqrt(2D * rate / (turbine_mb_per_blade * getTurbine().getFlowLength() * getMaximumInteriorLength() * getTurbine().effectiveMaxLength));
getTurbine().powerBonus = 1D + turbine_power_bonus_multiplier * Math.pow(lengthBonus * areaBonus, 2D / 3D);
}
@ -1149,6 +1169,13 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
}
public void onFormPacket(TurbineFormPacket message) {
if (message.nullArray) {
getTurbine().bladePosArray = null;
getTurbine().renderPosArray = null;
getTurbine().bladeAngleArray = null;
return;
}
getTurbine().bladePosArray = message.bladePosArray;
getTurbine().renderPosArray = message.renderPosArray;
getTurbine().bladeAngleArray = message.bladeAngleArray;

View File

@ -86,7 +86,15 @@ public class RadiationHandler {
playerRads.setRadiationImmunityStage(default_rad_immunity ^ GameStageHelper.hasAnyOf(player, rad_immunity_stages));
}
if (!player.isCreative() && !player.isSpectator() && playerRads.isFatal()) {
String idString = event.player.getUniqueID().toString();
for (String uuid : radiation_immune_players) {
if (idString.equals(uuid)) {
playerRads.setRadiationImmunityStage(true);
break;
}
}
if (!player.isCreative() && !player.isSpectator() && !playerRads.isImmune() && playerRads.isFatal()) {
player.attackEntityFrom(DamageSources.FATAL_RADS, Float.MAX_VALUE);
}
@ -125,7 +133,7 @@ public class RadiationHandler {
playerRads.setRadiationLevel(radiationLevel);
if (!player.isCreative() && !player.isSpectator()) {
if (!player.isCreative() && !player.isSpectator() && !playerRads.isImmune()) {
if (playerRads.isFatal()) {
player.attackEntityFrom(DamageSources.FATAL_RADS, Float.MAX_VALUE);
}
@ -336,7 +344,7 @@ public class RadiationHandler {
}
}
if (i == chunkStart) {
if (radiation_check_blocks && i == chunkStart) {
int packed = RecipeItemHelper.pack(StackHelper.blockStateToStack(world.getBlockState(randomChunkPos)));
if (RadSources.STACK_MAP.containsKey(packed)) {
RadiationHelper.addToSourceBuffer(chunkSource, RadSources.STACK_MAP.get(packed));

View File

@ -106,11 +106,10 @@ public class RadiationRenders {
return;
}
// Draw the chunk borders if we're either holding a geiger block OR
// looking at one
for (EnumHand hand : EnumHand.values()) {
ItemStack heldItem = MC.player.getHeldItem(hand);
if (NCItems.geiger_counter == heldItem.getItem() || Item.getItemFromBlock(NCBlocks.radiation_scrubber) == heldItem.getItem()) {
ItemStack heldStack = MC.player.getHeldItem(hand);
Item heldItem = heldStack.getItem();
if (NCItems.geiger_counter == heldItem || Item.getItemFromBlock(NCBlocks.geiger_block) == heldItem || Item.getItemFromBlock(NCBlocks.radiation_scrubber) == heldItem) {
chunkBorders = true;
break;
}
@ -118,7 +117,7 @@ public class RadiationRenders {
if (!chunkBorders && MC.objectMouseOver != null && MC.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK) {
TileEntity te = MC.world.getTileEntity(MC.objectMouseOver.getBlockPos());
if (!chunkBorders && (te instanceof TileGeigerCounter || te instanceof TileRadiationScrubber)) {
if (te instanceof TileGeigerCounter || te instanceof TileRadiationScrubber) {
chunkBorders = true;
}
}

View File

@ -41,7 +41,7 @@ public class RenderTurbineRotor extends TileEntitySpecialRenderer<TileTurbineCon
if (turbine == null) return;
int flowLength = turbine.getFlowLength(), bladeLength = turbine.bladeLength, shaftWidth = turbine.shaftWidth;
if (turbine.rotorStateArray == null || turbine.bladeDepths == null || turbine.statorDepths == null || turbine.rotorStateArray.length < 1 + 4 * flowLength) {
if (turbine.renderPosArray == null || turbine.bladeAngleArray == null || turbine.rotorStateArray == null || turbine.bladeDepths == null || turbine.statorDepths == null || turbine.rotorStateArray.length < 1 + 4 * flowLength) {
resendForm(controller);
return;
}

View File

@ -22,6 +22,15 @@ public class NCMath {
}
}
public static double clamp(double num, double min, double max) {
if (num < min) {
return min;
}
else {
return num > max ? max : num;
}
}
public static int sq(int number) {
return number * number;
}

View File

@ -2670,6 +2670,9 @@ gui.nc.config.category.radiation.tooltip=Configure aspects of nuclear radiation.
gui.nc.config.radiation_enabled=Enable Radiation
gui.nc.config.radiation_enabled.comment=Will nuclear radiation exist in the world? Note that the game will require a restart for radiation-related items to be shown in JEI after enabling this feature.
gui.config.radiation.radiation_immune_players=Player Radiation Immunity
gui.config.radiation.radiation_immune_players.comment=List of UUIDs for players who will be given permanent radiation immunity.
gui.nc.config.radiation_world_chunks_per_tick=Radiation World Chunks Per Tick
gui.nc.config.radiation_world_chunks_per_tick.comment=The maximum number of chunks in which radiation will be updated per tick.
gui.nc.config.radiation_player_tick_rate=Radiation Player Tick Rate
@ -2726,6 +2729,8 @@ gui.nc.config.radiation_lowest_rate=Lowest Radiation Rate
gui.nc.config.radiation_lowest_rate.comment=The lowest rate of player and chunk irradiation possible in Rad/t - amounts below this are ignored.
gui.nc.config.radiation_chunk_limit=Chunk Radiation Limit
gui.nc.config.radiation_chunk_limit.comment=The maximum chunk radiation level possible in Rad/t. A negative value means there is no limit.
gui.nc.config.radiation_check_blocks=Block Radiation Contribution
gui.nc.config.radiation_check_blocks.comment=Should non-tile entity blocks contribute to chunk radiation?
gui.nc.config.radiation_block_effect_max_rate=Radiation Block Mutation Max Rate
gui.nc.config.radiation_block_effect_max_rate.comment=The maximum number of attempts per chunk radiation update to mutate blocks.
gui.nc.config.radiation_rain_mult=Radiation Rain Multiplier
@ -3353,9 +3358,9 @@ death.attack.fatal_rads=%1$s died due to fatal radiation poisoning
# Guide Book
nc.guide_book.name=NuclearCraft Guide
nc.guide_book.name=NuclearCraft Guide (WIP)
nc.guide_book.edition=Overhaul Edition
nc.guide_book.desc=The official guide for NuclearCraft: Overhauled.
nc.guide_book.desc=The official guide for NuclearCraft: Overhauled (WIP).
# String Formatting

View File

@ -1,28 +1,17 @@
Have scrubber show chunk boundaries when held
Neutron shields should not act as active moderators for MSRs
Tweak turbine coil and blade stats?
Complete printing of registered multiblock component stats and rules to config file
Move onAdded tile methods to onLoad()?
Refactor old tile entity hierarchy - modularise item/fluid/energy handling
Modularise processor classes
Add input/output config to all ports and vents
Replace casing emergency cooling with cluster/port based version (no placement rules)
Adjacent MSR vessels with same filter connect to share flux, shared criticality factor is sum of vessel criticality factors
Adjacent MSR vessels connect to share flux, shared criticality factor is sum of vessel criticality factors
Replace casing emergency cooling with cluster/port based version (no placement rules)
Emergency cooling JEI and CT support
Complete printing of registered multiblock component stats and rules to config file
Finish fission meltdown mechanics
Add melting logic to non-fuel components
Graphite/beryllium fires, heavy water evaporation, etc.
Hydrogen build-up by ZA fuels above a certain temperature, hygrogen explosion if breaking open reactor above this temperature?
Hot SFRs/MSRs heat up more quickly/slowly & produce more/less radiation? (https://discordapp.com/channels/425461908712325130/425461908716519425/645399574109749279)
Fuel decay heat and neutron poison (https://discordapp.com/channels/425461908712325130/425470889354723350/738167468283002932)
Show potential (pre-primed) stats if reactor is idle
@ -31,9 +20,11 @@ Keep clusters running even when multiblock is invalidated
Link managers to listeners with multitool (default behaviour: act on all listeners)
Multiblock monitors: show cluster information, side configurations, etc.
Multiblock monitors: show cluster information, meltdown locations, side configurations, etc.
Dimension dependent radiation spread rate, use overworld rate if entry doesn't exist
Move onAdded tile methods to onLoad()?
Refactor old tile entity hierarchy - modularise item/fluid/energy handling
Modularise processor classes
OC support for side configurations
@ -77,7 +68,7 @@ ________________________________________________________________________________
1.15: Specialised fuel-making machine
Pebble-bed Reactor that produces energy directly
Pebble-Bed Reactor that produces energy directly
1.15: MSR split: NaK coolant for thermal, PbBi coolant for fast?
___________________________________________________________________________________________________________________________