Compare commits

...

2 Commits

Author SHA1 Message Date
Tom Dodd daa26c4bf5
Version 2.18m 2019-12-22 21:07:49 +00:00
Tom Dodd 02de59a05b Version 2.18m 2019-12-22 21:04:37 +00:00
18 changed files with 181 additions and 90 deletions

View File

@ -1,3 +1,12 @@
v2.18m
* Fixed stack overflow error caused by deep recursion in recipe generation
+ Added configs for reactor sound effect volumes
+ Added server logging of reactor meltdowns
* Feral Ghoul spawners now ignore the natural spawning limitations
v2.18l v2.18l
* Fixed energy providers emitting GTCE EU when integration is disabled * Fixed energy providers emitting GTCE EU when integration is disabled

View File

@ -1,7 +1,7 @@
mc_version=1.12.2 mc_version=1.12.2
forge_version=14.23.5.2838 forge_version=14.23.5.2838
mapping_version=stable_39 mapping_version=stable_39
mod_version=2.18l mod_version=2.18m
ic2_version=2.8.170-ex112 ic2_version=2.8.170-ex112
jei_version=4.15.0.+ jei_version=4.15.0.+

View File

@ -60,16 +60,19 @@ public class BlockFissionController extends BlockProcessor {
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
super.randomDisplayTick(state, world, pos, rand); super.randomDisplayTick(state, world, pos, rand);
if (NCConfig.fission_sound_volume == 0D) return;
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileFissionController) { if (tile instanceof TileFissionController) {
TileFissionController controller = (TileFissionController) tile; TileFissionController controller = (TileFissionController) tile;
if (controller.cells <= 0) return;
BlockFinder finder = new BlockFinder(pos, world, controller.getBlockMetadata()); BlockFinder finder = new BlockFinder(pos, world, controller.getBlockMetadata());
BlockPos position = finder.randomWithin(controller.minX, controller.maxX, controller.minY, controller.maxY, controller.minZ, controller.maxZ); BlockPos position = finder.randomWithin(controller.minX, controller.maxX, controller.minY, controller.maxY, controller.minZ, controller.maxZ);
if (controller.cells <= 0) return;
double soundRate = MathHelper.clamp(0.04D, Math.sqrt(controller.cells)/NCConfig.fission_max_size, 1D); double soundRate = MathHelper.clamp(0.04D, Math.sqrt(controller.cells)/NCConfig.fission_max_size, 1D);
if (controller.isProcessing) if (rand.nextDouble() < soundRate) { if (controller.isProcessing) if (rand.nextDouble() < soundRate) {
world.playSound(position.getX(), position.getY(), position.getZ(), NCSounds.geiger_tick, SoundCategory.BLOCKS, 1.6F, 1F + 0.12F*(rand.nextFloat() - 0.5F), false); world.playSound(position.getX(), position.getY(), position.getZ(), NCSounds.geiger_tick, SoundCategory.BLOCKS, (float) (1.6D*NCConfig.fission_sound_volume), 1F + 0.12F*(rand.nextFloat() - 0.5F), false);
} }
} }
} }

View File

@ -139,16 +139,19 @@ public class BlockFissionControllerNewFixed extends BlockProcessor {
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
super.randomDisplayTick(state, world, pos, rand); super.randomDisplayTick(state, world, pos, rand);
if (NCConfig.fission_sound_volume == 0D) return;
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileFissionController) { if (tile instanceof TileFissionController) {
TileFissionController controller = (TileFissionController) tile; TileFissionController controller = (TileFissionController) tile;
if (controller.cells <= 0) return;
BlockFinder finder = new BlockFinder(pos, world, controller.getBlockMetadata() & 7); BlockFinder finder = new BlockFinder(pos, world, controller.getBlockMetadata() & 7);
BlockPos position = finder.randomWithin(controller.minX, controller.maxX, controller.minY, controller.maxY, controller.minZ, controller.maxZ); BlockPos position = finder.randomWithin(controller.minX, controller.maxX, controller.minY, controller.maxY, controller.minZ, controller.maxZ);
if (controller.cells <= 0) return;
double soundRate = MathHelper.clamp(0.08D, 2*Math.sqrt(controller.cells)/NCConfig.fission_max_size, 1D); double soundRate = MathHelper.clamp(0.08D, 2*Math.sqrt(controller.cells)/NCConfig.fission_max_size, 1D);
if (controller.isProcessing) if (rand.nextDouble() < soundRate) { if (controller.isProcessing) if (rand.nextDouble() < soundRate) {
world.playSound(position.getX(), position.getY(), position.getZ(), NCSounds.geiger_tick, SoundCategory.BLOCKS, 1.6F, 1F + 0.12F*(rand.nextFloat() - 0.5F), false); world.playSound(position.getX(), position.getY(), position.getZ(), NCSounds.geiger_tick, SoundCategory.BLOCKS, (float) (1.6D*NCConfig.fission_sound_volume), 1F + 0.12F*(rand.nextFloat() - 0.5F), false);
} }
} }
} }

View File

@ -97,6 +97,7 @@ public class NCConfig {
public static int fission_comparator_max_heat; public static int fission_comparator_max_heat;
public static boolean fission_force_heat_comparator; public static boolean fission_force_heat_comparator;
public static int active_cooler_max_rate; public static int active_cooler_max_rate;
public static double fission_sound_volume;
public static double fission_moderator_extra_power; public static double fission_moderator_extra_power;
public static double fission_moderator_extra_heat; public static double fission_moderator_extra_heat;
@ -159,8 +160,8 @@ public class NCConfig {
public static int fusion_max_size; // Default: 24 public static int fusion_max_size; // Default: 24
public static int fusion_comparator_max_efficiency; public static int fusion_comparator_max_efficiency;
public static int fusion_electromagnet_power; public static int fusion_electromagnet_power;
public static boolean fusion_enable_sound;
public static boolean fusion_plasma_craziness; public static boolean fusion_plasma_craziness;
public static double fusion_sound_volume;
public static double[] fusion_fuel_time; public static double[] fusion_fuel_time;
public static double[] fusion_power; public static double[] fusion_power;
@ -193,7 +194,7 @@ public class NCConfig {
public static double[] turbine_power_per_mb; public static double[] turbine_power_per_mb;
public static double[] turbine_expansion_level; public static double[] turbine_expansion_level;
public static int turbine_mb_per_blade; public static int turbine_mb_per_blade;
public static boolean turbine_enable_sound; public static double turbine_sound_volume;
public static int accelerator_electromagnet_power; public static int accelerator_electromagnet_power;
public static int accelerator_supercooler_coolant; public static int accelerator_supercooler_coolant;
@ -474,6 +475,8 @@ public class NCConfig {
propertyFissionForceHeatComparator.setLanguageKey("gui.config.fission.fission_force_heat_comparator"); propertyFissionForceHeatComparator.setLanguageKey("gui.config.fission.fission_force_heat_comparator");
Property propertyFissionActiveCoolerMaxRate = config.get(CATEGORY_FISSION, "fission_active_cooler_max_rate", 10, Lang.localise("gui.config.fission.fission_active_cooler_max_rate.comment"), 1, 8000); Property propertyFissionActiveCoolerMaxRate = config.get(CATEGORY_FISSION, "fission_active_cooler_max_rate", 10, Lang.localise("gui.config.fission.fission_active_cooler_max_rate.comment"), 1, 8000);
propertyFissionActiveCoolerMaxRate.setLanguageKey("gui.config.fission.fission_active_cooler_max_rate"); propertyFissionActiveCoolerMaxRate.setLanguageKey("gui.config.fission.fission_active_cooler_max_rate");
Property propertyFissionSoundVolume = config.get(CATEGORY_FISSION, "fission_sound_volume", 1D, Lang.localise("gui.config.fission.fission_sound_volume.comment"), 0D, 15D);
propertyFissionSoundVolume.setLanguageKey("gui.config.fission.fission_sound_volume");
Property propertyFissionModeratorExtraPower = config.get(CATEGORY_FISSION, "fission_moderator_extra_power", 1D, Lang.localise("gui.config.fission.fission_moderator_extra_power.comment"), 0D, 15D); Property propertyFissionModeratorExtraPower = config.get(CATEGORY_FISSION, "fission_moderator_extra_power", 1D, Lang.localise("gui.config.fission.fission_moderator_extra_power.comment"), 0D, 15D);
propertyFissionModeratorExtraPower.setLanguageKey("gui.config.fission.fission_moderator_extra_power"); propertyFissionModeratorExtraPower.setLanguageKey("gui.config.fission.fission_moderator_extra_power");
@ -587,10 +590,10 @@ public class NCConfig {
propertyFusionComparatorMaxEfficiency.setLanguageKey("gui.config.fusion.fusion_comparator_max_efficiency"); propertyFusionComparatorMaxEfficiency.setLanguageKey("gui.config.fusion.fusion_comparator_max_efficiency");
Property propertyFusionElectromagnetPower = config.get(CATEGORY_FUSION, "fusion_electromagnet_power", 4000, Lang.localise("gui.config.fusion.fusion_electromagnet_power.comment"), 0, Integer.MAX_VALUE); Property propertyFusionElectromagnetPower = config.get(CATEGORY_FUSION, "fusion_electromagnet_power", 4000, Lang.localise("gui.config.fusion.fusion_electromagnet_power.comment"), 0, Integer.MAX_VALUE);
propertyFusionElectromagnetPower.setLanguageKey("gui.config.fusion.fusion_electromagnet_power"); propertyFusionElectromagnetPower.setLanguageKey("gui.config.fusion.fusion_electromagnet_power");
Property propertyFusionEnableSound = config.get(CATEGORY_FUSION, "fusion_enable_sound", true, Lang.localise("gui.config.fusion.fusion_enable_sound.comment"));
propertyFusionEnableSound.setLanguageKey("gui.config.fusion.fusion_enable_sound");
Property propertyFusionPlasmaCraziness = config.get(CATEGORY_FUSION, "fusion_plasma_craziness", true, Lang.localise("gui.config.fusion.fusion_plasma_craziness.comment")); Property propertyFusionPlasmaCraziness = config.get(CATEGORY_FUSION, "fusion_plasma_craziness", true, Lang.localise("gui.config.fusion.fusion_plasma_craziness.comment"));
propertyFusionPlasmaCraziness.setLanguageKey("gui.config.fusion.fusion_plasma_craziness"); propertyFusionPlasmaCraziness.setLanguageKey("gui.config.fusion.fusion_plasma_craziness");
Property propertyFusionSoundVolume = config.get(CATEGORY_FUSION, "fusion_sound_volume", 1D, Lang.localise("gui.config.fusion.fusion_sound_volume.comment"), 0D, 15D);
propertyFusionSoundVolume.setLanguageKey("gui.config.fusion.fusion_sound_volume");
Property propertyFusionFuelTime = config.get(CATEGORY_FUSION, "fusion_fuel_time", new double[] {100D, 150D, 200D, 200D, 350D, 400D, 600D, 200D, 250D, 250D, 400D, 450D, 650D, 300D, 300D, 450D, 500D, 700D, 300D, 450D, 500D, 700D, 600D, 650D, 850D, 700D, 900D, 1100D}, Lang.localise("gui.config.fusion.fusion_fuel_time.comment"), 1D, 32767D); Property propertyFusionFuelTime = config.get(CATEGORY_FUSION, "fusion_fuel_time", new double[] {100D, 150D, 200D, 200D, 350D, 400D, 600D, 200D, 250D, 250D, 400D, 450D, 650D, 300D, 300D, 450D, 500D, 700D, 300D, 450D, 500D, 700D, 600D, 650D, 850D, 700D, 900D, 1100D}, Lang.localise("gui.config.fusion.fusion_fuel_time.comment"), 1D, 32767D);
propertyFusionFuelTime.setLanguageKey("gui.config.fusion.fusion_fuel_time"); propertyFusionFuelTime.setLanguageKey("gui.config.fusion.fusion_fuel_time");
@ -651,8 +654,8 @@ public class NCConfig {
propertyTurbineExpansionLevel.setLanguageKey("gui.config.turbine.turbine_expansion_level"); propertyTurbineExpansionLevel.setLanguageKey("gui.config.turbine.turbine_expansion_level");
Property propertyTurbineMBPerBlade = config.get(CATEGORY_TURBINE, "turbine_mb_per_blade", 100, Lang.localise("gui.config.turbine.turbine_mb_per_blade.comment"), 1, 32767); Property propertyTurbineMBPerBlade = config.get(CATEGORY_TURBINE, "turbine_mb_per_blade", 100, Lang.localise("gui.config.turbine.turbine_mb_per_blade.comment"), 1, 32767);
propertyTurbineMBPerBlade.setLanguageKey("gui.config.turbine.turbine_mb_per_blade"); propertyTurbineMBPerBlade.setLanguageKey("gui.config.turbine.turbine_mb_per_blade");
Property propertyTurbineEnableSound = config.get(CATEGORY_TURBINE, "turbine_enable_sound", true, Lang.localise("gui.config.turbine.turbine_enable_sound.comment")); Property propertyTurbineSoundVolume = config.get(CATEGORY_TURBINE, "turbine_sound_volume", 1D, Lang.localise("gui.config.turbine.turbine_sound_volume.comment"), 0D, 15D);
propertyTurbineEnableSound.setLanguageKey("gui.config.turbine.turbine_enable_sound"); propertyTurbineSoundVolume.setLanguageKey("gui.config.turbine.turbine_sound_volume");
Property propertyAcceleratorElectromagnetPower = config.get(CATEGORY_ACCELERATOR, "accelerator_electromagnet_power", 20000, Lang.localise("gui.config.accelerator.accelerator_electromagnet_power.comment"), 0, Integer.MAX_VALUE); Property propertyAcceleratorElectromagnetPower = config.get(CATEGORY_ACCELERATOR, "accelerator_electromagnet_power", 20000, Lang.localise("gui.config.accelerator.accelerator_electromagnet_power.comment"), 0, Integer.MAX_VALUE);
propertyAcceleratorElectromagnetPower.setLanguageKey("gui.config.accelerator.accelerator_electromagnet_power"); propertyAcceleratorElectromagnetPower.setLanguageKey("gui.config.accelerator.accelerator_electromagnet_power");
@ -974,6 +977,7 @@ public class NCConfig {
propertyOrderFission.add(propertyFissionComparatorMaxHeat.getName()); propertyOrderFission.add(propertyFissionComparatorMaxHeat.getName());
propertyOrderFission.add(propertyFissionForceHeatComparator.getName()); propertyOrderFission.add(propertyFissionForceHeatComparator.getName());
propertyOrderFission.add(propertyFissionActiveCoolerMaxRate.getName()); propertyOrderFission.add(propertyFissionActiveCoolerMaxRate.getName());
propertyOrderFission.add(propertyFissionSoundVolume.getName());
propertyOrderFission.add(propertyFissionModeratorExtraPower.getName()); propertyOrderFission.add(propertyFissionModeratorExtraPower.getName());
propertyOrderFission.add(propertyFissionModeratorExtraHeat.getName()); propertyOrderFission.add(propertyFissionModeratorExtraHeat.getName());
@ -1038,8 +1042,8 @@ public class NCConfig {
propertyOrderFusion.add(propertyFusionMaxSize.getName()); propertyOrderFusion.add(propertyFusionMaxSize.getName());
propertyOrderFusion.add(propertyFusionComparatorMaxEfficiency.getName()); propertyOrderFusion.add(propertyFusionComparatorMaxEfficiency.getName());
propertyOrderFusion.add(propertyFusionElectromagnetPower.getName()); propertyOrderFusion.add(propertyFusionElectromagnetPower.getName());
propertyOrderFusion.add(propertyFusionEnableSound.getName());
propertyOrderFusion.add(propertyFusionPlasmaCraziness.getName()); propertyOrderFusion.add(propertyFusionPlasmaCraziness.getName());
propertyOrderFusion.add(propertyFusionSoundVolume.getName());
propertyOrderFusion.add(propertyFusionFuelTime.getName()); propertyOrderFusion.add(propertyFusionFuelTime.getName());
propertyOrderFusion.add(propertyFusionPower.getName()); propertyOrderFusion.add(propertyFusionPower.getName());
@ -1078,7 +1082,7 @@ public class NCConfig {
propertyOrderTurbine.add(propertyTurbinePowerPerMB.getName()); propertyOrderTurbine.add(propertyTurbinePowerPerMB.getName());
propertyOrderTurbine.add(propertyTurbineExpansionLevel.getName()); propertyOrderTurbine.add(propertyTurbineExpansionLevel.getName());
propertyOrderTurbine.add(propertyTurbineMBPerBlade.getName()); propertyOrderTurbine.add(propertyTurbineMBPerBlade.getName());
propertyOrderTurbine.add(propertyTurbineEnableSound.getName()); propertyOrderTurbine.add(propertyTurbineSoundVolume.getName());
config.setCategoryPropertyOrder(CATEGORY_TURBINE, propertyOrderTurbine); config.setCategoryPropertyOrder(CATEGORY_TURBINE, propertyOrderTurbine);
List<String> propertyOrderAccelerator = new ArrayList<String>(); List<String> propertyOrderAccelerator = new ArrayList<String>();
@ -1272,6 +1276,7 @@ public class NCConfig {
fission_comparator_max_heat = propertyFissionComparatorMaxHeat.getInt(); fission_comparator_max_heat = propertyFissionComparatorMaxHeat.getInt();
fission_force_heat_comparator = propertyFissionForceHeatComparator.getBoolean(); fission_force_heat_comparator = propertyFissionForceHeatComparator.getBoolean();
active_cooler_max_rate = propertyFissionActiveCoolerMaxRate.getInt(); active_cooler_max_rate = propertyFissionActiveCoolerMaxRate.getInt();
fission_sound_volume = propertyFissionSoundVolume.getDouble();
fission_moderator_extra_power = propertyFissionModeratorExtraPower.getDouble(); fission_moderator_extra_power = propertyFissionModeratorExtraPower.getDouble();
fission_moderator_extra_heat = propertyFissionModeratorExtraHeat.getDouble(); fission_moderator_extra_heat = propertyFissionModeratorExtraHeat.getDouble();
@ -1334,8 +1339,8 @@ public class NCConfig {
fusion_max_size = propertyFusionMaxSize.getInt(); fusion_max_size = propertyFusionMaxSize.getInt();
fusion_comparator_max_efficiency = propertyFusionComparatorMaxEfficiency.getInt(); fusion_comparator_max_efficiency = propertyFusionComparatorMaxEfficiency.getInt();
fusion_electromagnet_power = propertyFusionElectromagnetPower.getInt(); fusion_electromagnet_power = propertyFusionElectromagnetPower.getInt();
fusion_enable_sound = propertyFusionEnableSound.getBoolean();
fusion_plasma_craziness = propertyFusionPlasmaCraziness.getBoolean(); fusion_plasma_craziness = propertyFusionPlasmaCraziness.getBoolean();
fusion_sound_volume = propertyFusionSoundVolume.getDouble();
fusion_fuel_time = readDoubleArrayFromConfig(propertyFusionFuelTime); fusion_fuel_time = readDoubleArrayFromConfig(propertyFusionFuelTime);
fusion_power = readDoubleArrayFromConfig(propertyFusionPower); fusion_power = readDoubleArrayFromConfig(propertyFusionPower);
@ -1368,7 +1373,7 @@ public class NCConfig {
turbine_power_per_mb = readDoubleArrayFromConfig(propertyTurbinePowerPerMB); turbine_power_per_mb = readDoubleArrayFromConfig(propertyTurbinePowerPerMB);
turbine_expansion_level = readDoubleArrayFromConfig(propertyTurbineExpansionLevel); turbine_expansion_level = readDoubleArrayFromConfig(propertyTurbineExpansionLevel);
turbine_mb_per_blade = propertyTurbineMBPerBlade.getInt(); turbine_mb_per_blade = propertyTurbineMBPerBlade.getInt();
turbine_enable_sound = propertyTurbineEnableSound.getBoolean(); turbine_sound_volume = propertyTurbineSoundVolume.getDouble();
accelerator_electromagnet_power = propertyAcceleratorElectromagnetPower.getInt(); accelerator_electromagnet_power = propertyAcceleratorElectromagnetPower.getInt();
accelerator_supercooler_coolant = propertyAcceleratorSupercoolerCoolant.getInt(); accelerator_supercooler_coolant = propertyAcceleratorSupercoolerCoolant.getInt();
@ -1558,6 +1563,7 @@ public class NCConfig {
propertyFissionComparatorMaxHeat.set(fission_comparator_max_heat); propertyFissionComparatorMaxHeat.set(fission_comparator_max_heat);
propertyFissionForceHeatComparator.set(fission_force_heat_comparator); propertyFissionForceHeatComparator.set(fission_force_heat_comparator);
propertyFissionActiveCoolerMaxRate.set(active_cooler_max_rate); propertyFissionActiveCoolerMaxRate.set(active_cooler_max_rate);
propertyFissionSoundVolume.set(fission_sound_volume);
propertyFissionModeratorExtraPower.set(fission_moderator_extra_power); propertyFissionModeratorExtraPower.set(fission_moderator_extra_power);
propertyFissionModeratorExtraHeat.set(fission_moderator_extra_heat); propertyFissionModeratorExtraHeat.set(fission_moderator_extra_heat);
@ -1620,8 +1626,8 @@ public class NCConfig {
propertyFusionMaxSize.set(fusion_max_size); propertyFusionMaxSize.set(fusion_max_size);
propertyFusionComparatorMaxEfficiency.set(fusion_comparator_max_efficiency); propertyFusionComparatorMaxEfficiency.set(fusion_comparator_max_efficiency);
propertyFusionElectromagnetPower.set(fusion_electromagnet_power); propertyFusionElectromagnetPower.set(fusion_electromagnet_power);
propertyFusionEnableSound.set(fusion_enable_sound);
propertyFusionPlasmaCraziness.set(fusion_plasma_craziness); propertyFusionPlasmaCraziness.set(fusion_plasma_craziness);
propertyFusionSoundVolume.set(fusion_sound_volume);
propertyFusionFuelTime.set(fusion_fuel_time); propertyFusionFuelTime.set(fusion_fuel_time);
propertyFusionPower.set(fusion_power); propertyFusionPower.set(fusion_power);
@ -1654,7 +1660,7 @@ public class NCConfig {
propertyTurbinePowerPerMB.set(turbine_power_per_mb); propertyTurbinePowerPerMB.set(turbine_power_per_mb);
propertyTurbineExpansionLevel.set(turbine_expansion_level); propertyTurbineExpansionLevel.set(turbine_expansion_level);
propertyTurbineMBPerBlade.set(turbine_mb_per_blade); propertyTurbineMBPerBlade.set(turbine_mb_per_blade);
propertyTurbineEnableSound.set(turbine_enable_sound); propertyTurbineSoundVolume.set(turbine_sound_volume);
propertyAcceleratorElectromagnetPower.set(accelerator_electromagnet_power); propertyAcceleratorElectromagnetPower.set(accelerator_electromagnet_power);
propertyAcceleratorSupercoolerCoolant.set(accelerator_supercooler_coolant); propertyAcceleratorSupercoolerCoolant.set(accelerator_supercooler_coolant);

View File

@ -183,7 +183,8 @@ public class EntityFeralGhoul extends EntityZombie {
@Override @Override
public boolean getCanSpawnHere() { public boolean getCanSpawnHere() {
return super.getCanSpawnHere() && world.canSeeSky(new BlockPos(posX, getEntityBoundingBox().minY, posZ)) && world.countEntities(EntityFeralGhoul.class) < 10; // Spawning limitations controlled in EntityHandler
return super.getCanSpawnHere();
} }
@Override @Override

View File

@ -0,0 +1,23 @@
package nc.handler;
import nc.entity.EntityFeralGhoul;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.fml.common.eventhandler.Event.Result;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class EntityHandler {
@SubscribeEvent
public void onLootTableLoad(LivingSpawnEvent.CheckSpawn event) {
EntityLivingBase entity = event.getEntityLiving();
if (entity instanceof EntityFeralGhoul) {
World world = entity.world;
if (!event.isSpawner() && !world.canSeeSky(new BlockPos(entity.posX, entity.getEntityBoundingBox().minY, entity.posZ)) && world.countEntities(EntityFeralGhoul.class) > 10) {
event.setResult(Result.DENY);
}
}
}
}

View File

@ -19,6 +19,7 @@ import gregtech.common.items.MetaItems;
import nc.config.NCConfig; import nc.config.NCConfig;
import nc.recipe.ProcessorRecipe; import nc.recipe.ProcessorRecipe;
import nc.recipe.RecipeHelper; import nc.recipe.RecipeHelper;
import nc.recipe.RecipeTupleGenerator;
import nc.recipe.ingredient.IFluidIngredient; import nc.recipe.ingredient.IFluidIngredient;
import nc.recipe.ingredient.IItemIngredient; import nc.recipe.ingredient.IItemIngredient;
import nc.recipe.ingredient.OreIngredient; import nc.recipe.ingredient.OreIngredient;
@ -145,7 +146,7 @@ public class GTCERecipeHelper {
List<Pair<List<ItemStack>, List<FluidStack>>> materialListTuples = new ArrayList<>(); List<Pair<List<ItemStack>, List<FluidStack>>> materialListTuples = new ArrayList<>();
RecipeHelper.generateMaterialListTuples(materialListTuples, maxNumbers, inputNumbers, itemInputLists, fluidInputLists); RecipeTupleGenerator.INSTANCE.generateMaterialListTuples(materialListTuples, maxNumbers, inputNumbers, itemInputLists, fluidInputLists);
for (Pair<List<ItemStack>, List<FluidStack>> materials : materialListTuples) { for (Pair<List<ItemStack>, List<FluidStack>> materials : materialListTuples) {
if (findRecipe(recipeMap, materials.getLeft(), materials.getRight()) != null) { if (findRecipe(recipeMap, materials.getLeft(), materials.getRight()) != null) {

View File

@ -737,6 +737,10 @@ public abstract class MultiblockBase<PACKET extends MultiblockUpdatePacket> impl
return (int)(((long)getMinZ() + (long)getMaxZ())/2); return (int)(((long)getMinZ() + (long)getMaxZ())/2);
} }
public BlockPos getMiddleCoord() {
return new BlockPos(getMiddleX(), getMiddleY(), getMiddleZ());
}
/** /**
* Called when the save delegate's tile entity is being asked for its description packet * Called when the save delegate's tile entity is being asked for its description packet
* @param data A fresh compound tag to write your multiblock data into * @param data A fresh compound tag to write your multiblock data into

View File

@ -28,6 +28,7 @@ import nc.multiblock.saltFission.tile.TileSaltFissionVessel;
import nc.multiblock.validation.IMultiblockValidator; import nc.multiblock.validation.IMultiblockValidator;
import nc.tile.internal.fluid.Tank; import nc.tile.internal.fluid.Tank;
import nc.tile.internal.heat.HeatBuffer; import nc.tile.internal.heat.HeatBuffer;
import nc.util.NCUtil;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -379,6 +380,8 @@ public class SaltFissionReactor extends CuboidalMultiblockBase<SaltFissionUpdate
} }
protected void doMeltdown() { protected void doMeltdown() {
NCUtil.getLogger().info("Molten Salt Reactor meltdown at " + getMiddleCoord().toString() + "!");
Iterator<TileSaltFissionVessel> vesselIterator = vessels.iterator(); Iterator<TileSaltFissionVessel> vesselIterator = vessels.iterator();
while (vesselIterator.hasNext()) { while (vesselIterator.hasNext()) {
TileSaltFissionVessel vessel = vesselIterator.next(); TileSaltFissionVessel vessel = vesselIterator.next();
@ -435,10 +438,10 @@ public class SaltFissionReactor extends CuboidalMultiblockBase<SaltFissionUpdate
} }
protected void playFissionSound(BlockPos pos) { protected void playFissionSound(BlockPos pos) {
if (vessels.size() <= 0) return; if (NCConfig.fission_sound_volume == 0D || vessels.size() <= 0) return;
double soundRate = Math.min(rawEfficiency/(14D*NCConfig.salt_fission_max_size*Math.sqrt(vessels.size())), 1D/vessels.size()); double soundRate = Math.min(rawEfficiency/(14D*NCConfig.salt_fission_max_size*Math.sqrt(vessels.size())), 1D/vessels.size());
if (rand.nextDouble() < soundRate) { if (rand.nextDouble() < soundRate) {
WORLD.playSound(pos.getX(), pos.getY(), pos.getZ(), NCSounds.geiger_tick, SoundCategory.BLOCKS, 1.6F, 1F + 0.12F*(rand.nextFloat() - 0.5F), false); WORLD.playSound(pos.getX(), pos.getY(), pos.getZ(), NCSounds.geiger_tick, SoundCategory.BLOCKS, (float) (1.6D*NCConfig.fission_sound_volume), 1F + 0.12F*(rand.nextFloat() - 0.5F), false);
} }
} }

View File

@ -954,7 +954,12 @@ public class Turbine extends CuboidalMultiblockBase<TurbineUpdatePacket> impleme
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private void updateSounds() { private void updateSounds() {
if (!NCConfig.turbine_enable_sound) { if (NCConfig.turbine_sound_volume == 0D) {
if (activeSounds != null) {
stopSounds();
activeSounds.clear();
activeSounds = null;
}
return; return;
} }
@ -999,8 +1004,7 @@ public class Turbine extends CuboidalMultiblockBase<TurbineUpdatePacket> impleme
// If this machine isn't playing sounds, go ahead and play them // If this machine isn't playing sounds, go ahead and play them
for (SoundInfo activeSound : activeSounds) { for (SoundInfo activeSound : activeSounds) {
if (activeSound != null && (activeSound.sound == null || !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(activeSound.sound))) { if (activeSound != null && (activeSound.sound == null || !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(activeSound.sound))) {
NCUtil.getLogger().info(angVel); activeSound.sound = SoundHandler.startTileSound(NCSounds.turbine_run, activeSound.pos, (float)((0.125F + angVel*0.5F)*NCConfig.turbine_sound_volume), SoundHelper.getPitch(6F*angVel - 2F));
activeSound.sound = SoundHandler.startTileSound(NCSounds.turbine_run, activeSound.pos, 0.125F + angVel*0.5F, SoundHelper.getPitch(6F*angVel - 2F));
} }
} }

View File

@ -8,6 +8,7 @@ import nc.config.NCConfig;
import nc.handler.CapabilityHandler; import nc.handler.CapabilityHandler;
import nc.handler.DropHandler; import nc.handler.DropHandler;
import nc.handler.DungeonLootHandler; import nc.handler.DungeonLootHandler;
import nc.handler.EntityHandler;
import nc.handler.ItemUseHandler; import nc.handler.ItemUseHandler;
import nc.handler.OreDictHandler; import nc.handler.OreDictHandler;
import nc.handler.PlayerRespawnHandler; import nc.handler.PlayerRespawnHandler;
@ -30,13 +31,13 @@ import nc.multiblock.IMultiblockRegistry;
import nc.multiblock.MultiblockEventHandler; import nc.multiblock.MultiblockEventHandler;
import nc.multiblock.MultiblockRegistry; import nc.multiblock.MultiblockRegistry;
import nc.network.PacketHandler; import nc.network.PacketHandler;
import nc.radiation.RadArmor;
import nc.radiation.RadBiomes; import nc.radiation.RadBiomes;
import nc.radiation.RadBlockEffects; import nc.radiation.RadBlockEffects;
import nc.radiation.RadPotionEffects; import nc.radiation.RadPotionEffects;
import nc.radiation.RadSources; import nc.radiation.RadSources;
import nc.radiation.RadStructures; import nc.radiation.RadStructures;
import nc.radiation.RadWorlds; import nc.radiation.RadWorlds;
import nc.radiation.RadArmor;
import nc.radiation.RadiationHandler; import nc.radiation.RadiationHandler;
import nc.radiation.environment.RadiationEnvironmentHandler; import nc.radiation.environment.RadiationEnvironmentHandler;
import nc.recipe.NCRecipes; import nc.recipe.NCRecipes;
@ -128,6 +129,7 @@ public class CommonProxy {
//GameRegistry.registerWorldGenerator(new WastelandPortalGenerator(), 10); //GameRegistry.registerWorldGenerator(new WastelandPortalGenerator(), 10);
NCEntities.register(); NCEntities.register();
MinecraftForge.EVENT_BUS.register(new EntityHandler());
if (ModCheck.tinkersLoaded()) { if (ModCheck.tinkersLoaded()) {
TConstructExtras.init(); TConstructExtras.init();

View File

@ -155,7 +155,7 @@ public abstract class AbstractRecipeHandler<T extends IRecipe> {
List<Pair<List<ItemStack>, List<FluidStack>>> materialListTuples = new ArrayList<>(); List<Pair<List<ItemStack>, List<FluidStack>>> materialListTuples = new ArrayList<>();
RecipeHelper.generateMaterialListTuples(materialListTuples, maxNumbers, inputNumbers, itemInputLists, fluidInputLists); RecipeTupleGenerator.INSTANCE.generateMaterialListTuples(materialListTuples, maxNumbers, inputNumbers, itemInputLists, fluidInputLists);
for (Pair<List<ItemStack>, List<FluidStack>> materials : materialListTuples) { for (Pair<List<ItemStack>, List<FluidStack>> materials : materialListTuples) {
for (List<ItemStack> items : permutations(materials.getLeft())) { for (List<ItemStack> items : permutations(materials.getLeft())) {

View File

@ -6,8 +6,6 @@ import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import nc.ModCheck; import nc.ModCheck;
@ -435,61 +433,6 @@ public class RecipeHelper {
return new OreIngredient(oreName, stackSize); return new OreIngredient(oreName, stackSize);
} }
public static void generateMaterialListTuples(List<Pair<List<ItemStack>, List<FluidStack>>> tuples, int[] maxNumbers, int[] inputNumbers, List<List<ItemStack>> itemInputLists, List<List<FluidStack>> fluidInputLists) {
int itemInputSize = itemInputLists.size(), fluidInputSize = fluidInputLists.size();
List<ItemStack> itemInputs = new ArrayList<>();
List<FluidStack> fluidInputs = new ArrayList<>();
for (int i = 0; i < itemInputSize; i++) {
itemInputs.add(itemInputLists.get(i).get(inputNumbers[i]));
}
for (int i = 0; i < fluidInputSize; i++) {
fluidInputs.add(fluidInputLists.get(i).get(inputNumbers[i + itemInputSize]));
}
tuples.add(Pair.of(itemInputs, fluidInputs));
boolean itemEnd = false;
if (itemInputSize == 0) {
itemEnd = true;
}
else {
for (int i = 0; i < itemInputSize; i++) {
if (inputNumbers[i] < maxNumbers[i]) {
inputNumbers[i]++;
break;
}
else {
inputNumbers[i] = 0;
if (i == itemInputSize - 1) itemEnd = true;
}
}
}
boolean fluidEnd = false;
if (fluidInputSize == 0) {
fluidEnd = true;
}
else if (itemEnd) {
for (int i = 0; i < fluidInputSize; i++) {
if (inputNumbers[i + itemInputSize] < maxNumbers[i + itemInputSize]) {
inputNumbers[i + itemInputSize]++;
break;
}
else {
inputNumbers[i + itemInputSize] = 0;
if (i == fluidInputSize - 1) fluidEnd = true;
}
}
}
if (!itemEnd || !fluidEnd) {
generateMaterialListTuples(tuples, maxNumbers, inputNumbers, itemInputLists, fluidInputLists);
}
}
public static InventoryCrafting fakeCrafter(int width, int height) { public static InventoryCrafting fakeCrafter(int width, int height) {
return new FakeCrafting(width, height); return new FakeCrafting(width, height);
} }

View File

@ -0,0 +1,76 @@
package nc.recipe;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeTupleGenerator {
public static final RecipeTupleGenerator INSTANCE = new RecipeTupleGenerator();
private RecipeTupleGenerator() {}
private boolean itemEnd, fluidEnd;
public void generateMaterialListTuples(List<Pair<List<ItemStack>, List<FluidStack>>> tuples, int[] maxNumbers, int[] inputNumbers, List<List<ItemStack>> itemInputLists, List<List<FluidStack>> fluidInputLists) {
do {
generateNextMaterialListTuple(tuples, maxNumbers, inputNumbers, itemInputLists, fluidInputLists);
}
while (!itemEnd || !fluidEnd);
}
private void generateNextMaterialListTuple(List<Pair<List<ItemStack>, List<FluidStack>>> tuples, int[] maxNumbers, int[] inputNumbers, List<List<ItemStack>> itemInputLists, List<List<FluidStack>> fluidInputLists) {
int itemInputSize = itemInputLists.size(), fluidInputSize = fluidInputLists.size();
List<ItemStack> itemInputs = new ArrayList<>();
List<FluidStack> fluidInputs = new ArrayList<>();
for (int i = 0; i < itemInputSize; i++) {
itemInputs.add(itemInputLists.get(i).get(inputNumbers[i]));
}
for (int i = 0; i < fluidInputSize; i++) {
fluidInputs.add(fluidInputLists.get(i).get(inputNumbers[i + itemInputSize]));
}
tuples.add(Pair.of(itemInputs, fluidInputs));
itemEnd = false;
if (itemInputSize == 0) {
itemEnd = true;
}
else {
for (int i = 0; i < itemInputSize; i++) {
if (inputNumbers[i] < maxNumbers[i]) {
inputNumbers[i]++;
break;
}
else {
inputNumbers[i] = 0;
if (i == itemInputSize - 1) itemEnd = true;
}
}
}
fluidEnd = false;
if (fluidInputSize == 0) {
fluidEnd = true;
}
else if (itemEnd) {
for (int i = 0; i < fluidInputSize; i++) {
if (inputNumbers[i + itemInputSize] < maxNumbers[i + itemInputSize]) {
inputNumbers[i + itemInputSize]++;
break;
}
else {
inputNumbers[i + itemInputSize] = 0;
if (i == fluidInputSize - 1) fluidEnd = true;
}
}
}
}
}

View File

@ -29,6 +29,7 @@ import nc.util.EnergyHelper;
import nc.util.Lang; import nc.util.Lang;
import nc.util.MaterialHelper; import nc.util.MaterialHelper;
import nc.util.NCMath; import nc.util.NCMath;
import nc.util.NCUtil;
import nc.util.RegistryHelper; import nc.util.RegistryHelper;
import net.minecraft.block.BlockFire; import net.minecraft.block.BlockFire;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -201,6 +202,8 @@ public class TileFissionController extends TileItemGenerator implements IGui<Fis
} }
public void meltdown() { public void meltdown() {
NCUtil.getLogger().info("Fission Reactor meltdown at " + pos.toString() + "!");
BlockPos middle = getFinder().position((minX + maxX)/2, (minY + maxY)/2, (minZ + maxZ)/2); BlockPos middle = getFinder().position((minX + maxX)/2, (minY + maxY)/2, (minZ + maxZ)/2);
IRadiationSource chunkSource = RadiationHelper.getRadiationSource(world.getChunk(middle)); IRadiationSource chunkSource = RadiationHelper.getRadiationSource(world.getChunk(middle));

View File

@ -37,6 +37,7 @@ import nc.util.CommonCapsHelper;
import nc.util.EnergyHelper; import nc.util.EnergyHelper;
import nc.util.Lang; import nc.util.Lang;
import nc.util.MaterialHelper; import nc.util.MaterialHelper;
import nc.util.NCUtil;
import nc.util.SoundHelper; import nc.util.SoundHelper;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -183,6 +184,8 @@ public class TileFusionCore extends TileFluidGenerator implements IGui<FusionUpd
} }
public void meltdown() { public void meltdown() {
NCUtil.getLogger().info("Fusion Reactor meltdown at " + pos.toString() + "!");
IRadiationSource chunkSource = RadiationHelper.getRadiationSource(world.getChunk(pos)); IRadiationSource chunkSource = RadiationHelper.getRadiationSource(world.getChunk(pos));
if (chunkSource != null) { if (chunkSource != null) {
RadiationHelper.addToSourceRadiation(chunkSource, 8D*baseProcessRadiation*size*NCConfig.fusion_fuel_use*NCConfig.fusion_meltdown_radiation_multiplier); RadiationHelper.addToSourceRadiation(chunkSource, 8D*baseProcessRadiation*size*NCConfig.fusion_fuel_use*NCConfig.fusion_meltdown_radiation_multiplier);
@ -202,7 +205,12 @@ public class TileFusionCore extends TileFluidGenerator implements IGui<FusionUpd
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private void updateSounds() { private void updateSounds() {
if (!NCConfig.fusion_enable_sound) { if (NCConfig.fusion_sound_volume == 0D) {
if (activeSounds != null) {
stopSounds();
activeSounds.clear();
activeSounds = null;
}
return; return;
} }
@ -243,7 +251,7 @@ public class TileFusionCore extends TileFluidGenerator implements IGui<FusionUpd
// If this machine isn't playing sounds, go ahead and play them // If this machine isn't playing sounds, go ahead and play them
for (SoundInfo activeSound : activeSounds) { for (SoundInfo activeSound : activeSounds) {
if (activeSound != null && (activeSound.sound == null || !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(activeSound.sound))) { if (activeSound != null && (activeSound.sound == null || !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(activeSound.sound))) {
activeSound.sound = SoundHandler.startTileSound(NCSounds.fusion_run, activeSound.pos, 0.35F, SoundHelper.getPitch(1F)); activeSound.sound = SoundHandler.startTileSound(NCSounds.fusion_run, activeSound.pos, (float) (0.35D*NCConfig.fusion_sound_volume), SoundHelper.getPitch(1F));
} }
} }

View File

@ -1918,6 +1918,8 @@ gui.config.fission.fission_force_heat_comparator=Force Heat Comparator
gui.config.fission.fission_force_heat_comparator.comment=If enabled, the controller of a heat-negative or heat-neutral reactor will output a heat-based comparator signal as if it were heat-positive instead of an energy-based one. gui.config.fission.fission_force_heat_comparator.comment=If enabled, the controller of a heat-negative or heat-neutral reactor will output a heat-based comparator signal as if it were heat-positive instead of an energy-based one.
gui.config.fission.fission_active_cooler_max_rate=Maximum Active Cooler Fluid Use gui.config.fission.fission_active_cooler_max_rate=Maximum Active Cooler Fluid Use
gui.config.fission.fission_active_cooler_max_rate.comment=Maximum rate at which the Active Fluid Cooler uses coolant in mB/s. gui.config.fission.fission_active_cooler_max_rate.comment=Maximum rate at which the Active Fluid Cooler uses coolant in mB/s.
gui.config.fission.fission_sound_volume=Fission Sound Volume
gui.config.fission.fission_sound_volume.comment=Modifier for the volume of fission sound effects.
gui.config.fission.fission_moderator_extra_power=Moderator Power Modifier gui.config.fission.fission_moderator_extra_power=Moderator Power Modifier
gui.config.fission.fission_moderator_extra_power.comment=*Only effects new mechanics.* Determines the extra power generated by each moderator block adjacent to a reactor cell. Equal to the effective number of extra cell's worth of power that would be generated by a cell totally surrounded by moderator blocks. Each moderator block will contribute one sixth of this amount of power (the amount of additional power scales linearly with the number of moderator blocks). gui.config.fission.fission_moderator_extra_power.comment=*Only effects new mechanics.* Determines the extra power generated by each moderator block adjacent to a reactor cell. Equal to the effective number of extra cell's worth of power that would be generated by a cell totally surrounded by moderator blocks. Each moderator block will contribute one sixth of this amount of power (the amount of additional power scales linearly with the number of moderator blocks).
@ -2032,10 +2034,10 @@ gui.config.fusion.fusion_max_size=Maximum Toroid Size
gui.config.fusion.fusion_max_size.comment=Maximum size of fusion toroids. gui.config.fusion.fusion_max_size.comment=Maximum size of fusion toroids.
gui.config.fusion.fusion_comparator_max_efficiency=Max Comparator Signal Efficiency gui.config.fusion.fusion_comparator_max_efficiency=Max Comparator Signal Efficiency
gui.config.fusion.fusion_comparator_max_efficiency.comment=Efficiency of a fusion reactor at which a comparator adjacent to the core will output a full-strength redstone signal. gui.config.fusion.fusion_comparator_max_efficiency.comment=Efficiency of a fusion reactor at which a comparator adjacent to the core will output a full-strength redstone signal.
gui.config.fusion.fusion_enable_sound=Enable Fusion Sound
gui.config.fusion.fusion_enable_sound.comment=If true, reactor sound effects will play.
gui.config.fusion.fusion_plasma_craziness=Fusion Plasma Fires gui.config.fusion.fusion_plasma_craziness=Fusion Plasma Fires
gui.config.fusion.fusion_plasma_craziness.comment=Will fusion plasma start fires? Disabling this will reduce lag somewhat. gui.config.fusion.fusion_plasma_craziness.comment=Will fusion plasma start fires? Disabling this will reduce lag somewhat.
gui.config.fusion.fusion_sound_volume=Fusion Sound Volume
gui.config.fusion.fusion_sound_volume.comment=Modifier for the volume of fusion sound effects.
gui.config.fusion.fusion_fuel_time=Fusion Fuel Combo Durations gui.config.fusion.fusion_fuel_time=Fusion Fuel Combo Durations
gui.config.fusion.fusion_fuel_time.comment=Base ticks the fuel combos last. Order: H-H, H-D, H-T, H-He3, H-Li6, H-Li7, H-B11, D-D, D-T, D-He3, ..., D-B11, T-T, ..., T-B11, ..., B11-B11. gui.config.fusion.fusion_fuel_time.comment=Base ticks the fuel combos last. Order: H-H, H-D, H-T, H-He3, H-Li6, H-Li7, H-B11, D-D, D-T, D-He3, ..., D-B11, T-T, ..., T-B11, ..., B11-B11.
@ -2108,8 +2110,8 @@ gui.config.turbine.turbine_expansion_level=Steam Expansion Level
gui.config.turbine.turbine_expansion_level.comment=Expansion level for this type of steam's recipe. Order: high pressure, low pressure, standard. gui.config.turbine.turbine_expansion_level.comment=Expansion level for this type of steam's recipe. Order: high pressure, low pressure, standard.
gui.config.turbine.turbine_mb_per_blade=Rotor Blade Maximum Process Rate gui.config.turbine.turbine_mb_per_blade=Rotor Blade Maximum Process Rate
gui.config.turbine.turbine_mb_per_blade.comment=Maximum mB of fluid processed per tick per rotor blade. gui.config.turbine.turbine_mb_per_blade.comment=Maximum mB of fluid processed per tick per rotor blade.
gui.config.turbine.turbine_enable_sound=Enable Turbine Sound gui.config.turbine.turbine_sound_volume=Turbine Sound Volume
gui.config.turbine.turbine_enable_sound.comment=If true, turbine sound effects will play. gui.config.turbine.turbine_sound_volume.comment=Modifier for the volume of turbine sound effects.
gui.config.category.condenser=Condenser Configs gui.config.category.condenser=Condenser Configs
gui.config.category.condenser.tooltip=Configure aspects of condensers. gui.config.category.condenser.tooltip=Configure aspects of condensers.