Compare commits
2 Commits
d09774ca8e
...
daa26c4bf5
Author | SHA1 | Date |
---|---|---|
Tom Dodd | daa26c4bf5 | |
Tom Dodd | 02de59a05b |
|
@ -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
|
||||
|
||||
* Fixed energy providers emitting GTCE EU when integration is disabled
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
mc_version=1.12.2
|
||||
forge_version=14.23.5.2838
|
||||
mapping_version=stable_39
|
||||
mod_version=2.18l
|
||||
mod_version=2.18m
|
||||
|
||||
ic2_version=2.8.170-ex112
|
||||
jei_version=4.15.0.+
|
||||
|
|
|
@ -60,16 +60,19 @@ public class BlockFissionController extends BlockProcessor {
|
|||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
super.randomDisplayTick(state, world, pos, rand);
|
||||
|
||||
if (NCConfig.fission_sound_volume == 0D) return;
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileFissionController) {
|
||||
TileFissionController controller = (TileFissionController) tile;
|
||||
if (controller.cells <= 0) return;
|
||||
|
||||
BlockFinder finder = new BlockFinder(pos, world, controller.getBlockMetadata());
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,16 +139,19 @@ public class BlockFissionControllerNewFixed extends BlockProcessor {
|
|||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
super.randomDisplayTick(state, world, pos, rand);
|
||||
|
||||
if (NCConfig.fission_sound_volume == 0D) return;
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileFissionController) {
|
||||
TileFissionController controller = (TileFissionController) tile;
|
||||
if (controller.cells <= 0) return;
|
||||
|
||||
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);
|
||||
|
||||
if (controller.cells <= 0) return;
|
||||
double soundRate = MathHelper.clamp(0.08D, 2*Math.sqrt(controller.cells)/NCConfig.fission_max_size, 1D);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ public class NCConfig {
|
|||
public static int fission_comparator_max_heat;
|
||||
public static boolean fission_force_heat_comparator;
|
||||
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_heat;
|
||||
|
@ -159,8 +160,8 @@ public class NCConfig {
|
|||
public static int fusion_max_size; // Default: 24
|
||||
public static int fusion_comparator_max_efficiency;
|
||||
public static int fusion_electromagnet_power;
|
||||
public static boolean fusion_enable_sound;
|
||||
public static boolean fusion_plasma_craziness;
|
||||
public static double fusion_sound_volume;
|
||||
|
||||
public static double[] fusion_fuel_time;
|
||||
public static double[] fusion_power;
|
||||
|
@ -193,7 +194,7 @@ public class NCConfig {
|
|||
public static double[] turbine_power_per_mb;
|
||||
public static double[] turbine_expansion_level;
|
||||
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_supercooler_coolant;
|
||||
|
@ -474,6 +475,8 @@ public class NCConfig {
|
|||
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);
|
||||
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);
|
||||
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");
|
||||
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");
|
||||
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"));
|
||||
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);
|
||||
propertyFusionFuelTime.setLanguageKey("gui.config.fusion.fusion_fuel_time");
|
||||
|
@ -651,8 +654,8 @@ public class NCConfig {
|
|||
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);
|
||||
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"));
|
||||
propertyTurbineEnableSound.setLanguageKey("gui.config.turbine.turbine_enable_sound");
|
||||
Property propertyTurbineSoundVolume = config.get(CATEGORY_TURBINE, "turbine_sound_volume", 1D, Lang.localise("gui.config.turbine.turbine_sound_volume.comment"), 0D, 15D);
|
||||
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);
|
||||
propertyAcceleratorElectromagnetPower.setLanguageKey("gui.config.accelerator.accelerator_electromagnet_power");
|
||||
|
@ -974,6 +977,7 @@ public class NCConfig {
|
|||
propertyOrderFission.add(propertyFissionComparatorMaxHeat.getName());
|
||||
propertyOrderFission.add(propertyFissionForceHeatComparator.getName());
|
||||
propertyOrderFission.add(propertyFissionActiveCoolerMaxRate.getName());
|
||||
propertyOrderFission.add(propertyFissionSoundVolume.getName());
|
||||
|
||||
propertyOrderFission.add(propertyFissionModeratorExtraPower.getName());
|
||||
propertyOrderFission.add(propertyFissionModeratorExtraHeat.getName());
|
||||
|
@ -1038,8 +1042,8 @@ public class NCConfig {
|
|||
propertyOrderFusion.add(propertyFusionMaxSize.getName());
|
||||
propertyOrderFusion.add(propertyFusionComparatorMaxEfficiency.getName());
|
||||
propertyOrderFusion.add(propertyFusionElectromagnetPower.getName());
|
||||
propertyOrderFusion.add(propertyFusionEnableSound.getName());
|
||||
propertyOrderFusion.add(propertyFusionPlasmaCraziness.getName());
|
||||
propertyOrderFusion.add(propertyFusionSoundVolume.getName());
|
||||
|
||||
propertyOrderFusion.add(propertyFusionFuelTime.getName());
|
||||
propertyOrderFusion.add(propertyFusionPower.getName());
|
||||
|
@ -1078,7 +1082,7 @@ public class NCConfig {
|
|||
propertyOrderTurbine.add(propertyTurbinePowerPerMB.getName());
|
||||
propertyOrderTurbine.add(propertyTurbineExpansionLevel.getName());
|
||||
propertyOrderTurbine.add(propertyTurbineMBPerBlade.getName());
|
||||
propertyOrderTurbine.add(propertyTurbineEnableSound.getName());
|
||||
propertyOrderTurbine.add(propertyTurbineSoundVolume.getName());
|
||||
config.setCategoryPropertyOrder(CATEGORY_TURBINE, propertyOrderTurbine);
|
||||
|
||||
List<String> propertyOrderAccelerator = new ArrayList<String>();
|
||||
|
@ -1272,6 +1276,7 @@ public class NCConfig {
|
|||
fission_comparator_max_heat = propertyFissionComparatorMaxHeat.getInt();
|
||||
fission_force_heat_comparator = propertyFissionForceHeatComparator.getBoolean();
|
||||
active_cooler_max_rate = propertyFissionActiveCoolerMaxRate.getInt();
|
||||
fission_sound_volume = propertyFissionSoundVolume.getDouble();
|
||||
|
||||
fission_moderator_extra_power = propertyFissionModeratorExtraPower.getDouble();
|
||||
fission_moderator_extra_heat = propertyFissionModeratorExtraHeat.getDouble();
|
||||
|
@ -1334,8 +1339,8 @@ public class NCConfig {
|
|||
fusion_max_size = propertyFusionMaxSize.getInt();
|
||||
fusion_comparator_max_efficiency = propertyFusionComparatorMaxEfficiency.getInt();
|
||||
fusion_electromagnet_power = propertyFusionElectromagnetPower.getInt();
|
||||
fusion_enable_sound = propertyFusionEnableSound.getBoolean();
|
||||
fusion_plasma_craziness = propertyFusionPlasmaCraziness.getBoolean();
|
||||
fusion_sound_volume = propertyFusionSoundVolume.getDouble();
|
||||
|
||||
fusion_fuel_time = readDoubleArrayFromConfig(propertyFusionFuelTime);
|
||||
fusion_power = readDoubleArrayFromConfig(propertyFusionPower);
|
||||
|
@ -1368,7 +1373,7 @@ public class NCConfig {
|
|||
turbine_power_per_mb = readDoubleArrayFromConfig(propertyTurbinePowerPerMB);
|
||||
turbine_expansion_level = readDoubleArrayFromConfig(propertyTurbineExpansionLevel);
|
||||
turbine_mb_per_blade = propertyTurbineMBPerBlade.getInt();
|
||||
turbine_enable_sound = propertyTurbineEnableSound.getBoolean();
|
||||
turbine_sound_volume = propertyTurbineSoundVolume.getDouble();
|
||||
|
||||
accelerator_electromagnet_power = propertyAcceleratorElectromagnetPower.getInt();
|
||||
accelerator_supercooler_coolant = propertyAcceleratorSupercoolerCoolant.getInt();
|
||||
|
@ -1558,6 +1563,7 @@ public class NCConfig {
|
|||
propertyFissionComparatorMaxHeat.set(fission_comparator_max_heat);
|
||||
propertyFissionForceHeatComparator.set(fission_force_heat_comparator);
|
||||
propertyFissionActiveCoolerMaxRate.set(active_cooler_max_rate);
|
||||
propertyFissionSoundVolume.set(fission_sound_volume);
|
||||
|
||||
propertyFissionModeratorExtraPower.set(fission_moderator_extra_power);
|
||||
propertyFissionModeratorExtraHeat.set(fission_moderator_extra_heat);
|
||||
|
@ -1620,8 +1626,8 @@ public class NCConfig {
|
|||
propertyFusionMaxSize.set(fusion_max_size);
|
||||
propertyFusionComparatorMaxEfficiency.set(fusion_comparator_max_efficiency);
|
||||
propertyFusionElectromagnetPower.set(fusion_electromagnet_power);
|
||||
propertyFusionEnableSound.set(fusion_enable_sound);
|
||||
propertyFusionPlasmaCraziness.set(fusion_plasma_craziness);
|
||||
propertyFusionSoundVolume.set(fusion_sound_volume);
|
||||
|
||||
propertyFusionFuelTime.set(fusion_fuel_time);
|
||||
propertyFusionPower.set(fusion_power);
|
||||
|
@ -1654,7 +1660,7 @@ public class NCConfig {
|
|||
propertyTurbinePowerPerMB.set(turbine_power_per_mb);
|
||||
propertyTurbineExpansionLevel.set(turbine_expansion_level);
|
||||
propertyTurbineMBPerBlade.set(turbine_mb_per_blade);
|
||||
propertyTurbineEnableSound.set(turbine_enable_sound);
|
||||
propertyTurbineSoundVolume.set(turbine_sound_volume);
|
||||
|
||||
propertyAcceleratorElectromagnetPower.set(accelerator_electromagnet_power);
|
||||
propertyAcceleratorSupercoolerCoolant.set(accelerator_supercooler_coolant);
|
||||
|
|
|
@ -183,7 +183,8 @@ public class EntityFeralGhoul extends EntityZombie {
|
|||
|
||||
@Override
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ import gregtech.common.items.MetaItems;
|
|||
import nc.config.NCConfig;
|
||||
import nc.recipe.ProcessorRecipe;
|
||||
import nc.recipe.RecipeHelper;
|
||||
import nc.recipe.RecipeTupleGenerator;
|
||||
import nc.recipe.ingredient.IFluidIngredient;
|
||||
import nc.recipe.ingredient.IItemIngredient;
|
||||
import nc.recipe.ingredient.OreIngredient;
|
||||
|
@ -145,7 +146,7 @@ public class GTCERecipeHelper {
|
|||
|
||||
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) {
|
||||
if (findRecipe(recipeMap, materials.getLeft(), materials.getRight()) != null) {
|
||||
|
|
|
@ -737,6 +737,10 @@ public abstract class MultiblockBase<PACKET extends MultiblockUpdatePacket> impl
|
|||
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
|
||||
* @param data A fresh compound tag to write your multiblock data into
|
||||
|
|
|
@ -28,6 +28,7 @@ import nc.multiblock.saltFission.tile.TileSaltFissionVessel;
|
|||
import nc.multiblock.validation.IMultiblockValidator;
|
||||
import nc.tile.internal.fluid.Tank;
|
||||
import nc.tile.internal.heat.HeatBuffer;
|
||||
import nc.util.NCUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -379,6 +380,8 @@ public class SaltFissionReactor extends CuboidalMultiblockBase<SaltFissionUpdate
|
|||
}
|
||||
|
||||
protected void doMeltdown() {
|
||||
NCUtil.getLogger().info("Molten Salt Reactor meltdown at " + getMiddleCoord().toString() + "!");
|
||||
|
||||
Iterator<TileSaltFissionVessel> vesselIterator = vessels.iterator();
|
||||
while (vesselIterator.hasNext()) {
|
||||
TileSaltFissionVessel vessel = vesselIterator.next();
|
||||
|
@ -435,10 +438,10 @@ public class SaltFissionReactor extends CuboidalMultiblockBase<SaltFissionUpdate
|
|||
}
|
||||
|
||||
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());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -954,7 +954,12 @@ public class Turbine extends CuboidalMultiblockBase<TurbineUpdatePacket> impleme
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void updateSounds() {
|
||||
if (!NCConfig.turbine_enable_sound) {
|
||||
if (NCConfig.turbine_sound_volume == 0D) {
|
||||
if (activeSounds != null) {
|
||||
stopSounds();
|
||||
activeSounds.clear();
|
||||
activeSounds = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -999,8 +1004,7 @@ public class Turbine extends CuboidalMultiblockBase<TurbineUpdatePacket> impleme
|
|||
// If this machine isn't playing sounds, go ahead and play them
|
||||
for (SoundInfo activeSound : activeSounds) {
|
||||
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, 0.125F + angVel*0.5F, SoundHelper.getPitch(6F*angVel - 2F));
|
||||
activeSound.sound = SoundHandler.startTileSound(NCSounds.turbine_run, activeSound.pos, (float)((0.125F + angVel*0.5F)*NCConfig.turbine_sound_volume), SoundHelper.getPitch(6F*angVel - 2F));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import nc.config.NCConfig;
|
|||
import nc.handler.CapabilityHandler;
|
||||
import nc.handler.DropHandler;
|
||||
import nc.handler.DungeonLootHandler;
|
||||
import nc.handler.EntityHandler;
|
||||
import nc.handler.ItemUseHandler;
|
||||
import nc.handler.OreDictHandler;
|
||||
import nc.handler.PlayerRespawnHandler;
|
||||
|
@ -30,13 +31,13 @@ import nc.multiblock.IMultiblockRegistry;
|
|||
import nc.multiblock.MultiblockEventHandler;
|
||||
import nc.multiblock.MultiblockRegistry;
|
||||
import nc.network.PacketHandler;
|
||||
import nc.radiation.RadArmor;
|
||||
import nc.radiation.RadBiomes;
|
||||
import nc.radiation.RadBlockEffects;
|
||||
import nc.radiation.RadPotionEffects;
|
||||
import nc.radiation.RadSources;
|
||||
import nc.radiation.RadStructures;
|
||||
import nc.radiation.RadWorlds;
|
||||
import nc.radiation.RadArmor;
|
||||
import nc.radiation.RadiationHandler;
|
||||
import nc.radiation.environment.RadiationEnvironmentHandler;
|
||||
import nc.recipe.NCRecipes;
|
||||
|
@ -128,6 +129,7 @@ public class CommonProxy {
|
|||
//GameRegistry.registerWorldGenerator(new WastelandPortalGenerator(), 10);
|
||||
|
||||
NCEntities.register();
|
||||
MinecraftForge.EVENT_BUS.register(new EntityHandler());
|
||||
|
||||
if (ModCheck.tinkersLoaded()) {
|
||||
TConstructExtras.init();
|
||||
|
|
|
@ -155,7 +155,7 @@ public abstract class AbstractRecipeHandler<T extends IRecipe> {
|
|||
|
||||
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 (List<ItemStack> items : permutations(materials.getLeft())) {
|
||||
|
|
|
@ -6,8 +6,6 @@ import java.util.List;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import nc.ModCheck;
|
||||
|
@ -435,61 +433,6 @@ public class RecipeHelper {
|
|||
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) {
|
||||
return new FakeCrafting(width, height);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ import nc.util.EnergyHelper;
|
|||
import nc.util.Lang;
|
||||
import nc.util.MaterialHelper;
|
||||
import nc.util.NCMath;
|
||||
import nc.util.NCUtil;
|
||||
import nc.util.RegistryHelper;
|
||||
import net.minecraft.block.BlockFire;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -201,6 +202,8 @@ public class TileFissionController extends TileItemGenerator implements IGui<Fis
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
IRadiationSource chunkSource = RadiationHelper.getRadiationSource(world.getChunk(middle));
|
||||
|
|
|
@ -37,6 +37,7 @@ import nc.util.CommonCapsHelper;
|
|||
import nc.util.EnergyHelper;
|
||||
import nc.util.Lang;
|
||||
import nc.util.MaterialHelper;
|
||||
import nc.util.NCUtil;
|
||||
import nc.util.SoundHelper;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -183,6 +184,8 @@ public class TileFusionCore extends TileFluidGenerator implements IGui<FusionUpd
|
|||
}
|
||||
|
||||
public void meltdown() {
|
||||
NCUtil.getLogger().info("Fusion Reactor meltdown at " + pos.toString() + "!");
|
||||
|
||||
IRadiationSource chunkSource = RadiationHelper.getRadiationSource(world.getChunk(pos));
|
||||
if (chunkSource != null) {
|
||||
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)
|
||||
private void updateSounds() {
|
||||
if (!NCConfig.fusion_enable_sound) {
|
||||
if (NCConfig.fusion_sound_volume == 0D) {
|
||||
if (activeSounds != null) {
|
||||
stopSounds();
|
||||
activeSounds.clear();
|
||||
activeSounds = null;
|
||||
}
|
||||
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
|
||||
for (SoundInfo activeSound : activeSounds) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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_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_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.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_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_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.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.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_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_enable_sound=Enable Turbine Sound
|
||||
gui.config.turbine.turbine_enable_sound.comment=If true, turbine sound effects will play.
|
||||
gui.config.turbine.turbine_sound_volume=Turbine Sound Volume
|
||||
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.tooltip=Configure aspects of condensers.
|
||||
|
|
Loading…
Reference in New Issue