diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index a0fe1e44d..ac128f123 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1660,7 +1660,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json f3231c27d43ff511b7d8532603111706ebcc155e assets/create/sounds.json -0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json +5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json 187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json 0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json 83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json @@ -3687,7 +3687,7 @@ d3fdb8ece6cb072a93ddb64a0baad5ac952117a4 data/create/recipes/weathered_limestone 11667414f73bc2d00bda7c5c1a7d2934bf6e9165 data/create/recipes/weathered_limestone_pillar_from_weathered_limestone_stonecutting.json 558c1052ca384f1c014f9b404d21268764a493ee data/create/tags/blocks/brittle.json 330bfb3850ba3964b10b1bccbc3cbb9b012cae54 data/create/tags/blocks/fan_heaters.json -3bc64e3a1e7980237435b1770a9ba2102d57fcd4 data/create/tags/blocks/fan_transparent.json +57b942386a15c874d1ca9cd6a8032c11a5599fc2 data/create/tags/blocks/fan_transparent.json c81ea194e808985847159b201140d4aa4cbcca65 data/create/tags/blocks/safe_nbt.json c9ac7e3e5ec18554e7184168d65e9b8e44ef5610 data/create/tags/blocks/sails.json 6cdeeac1689f7b5bfd9bc40b462143d8eaf3ad0b data/create/tags/blocks/seats.json diff --git a/src/generated/resources/data/create/advancements/aesthetics.json b/src/generated/resources/data/create/advancements/aesthetics.json index d723cbe38..59a86f429 100644 --- a/src/generated/resources/data/create/advancements/aesthetics.json +++ b/src/generated/resources/data/create/advancements/aesthetics.json @@ -28,8 +28,8 @@ "trigger": "create:bracket_apply", "conditions": { "accepted_entries": [ - "create:cogwheel", - "create:large_cogwheel" + "create:large_cogwheel", + "create:cogwheel" ] } }, diff --git a/src/generated/resources/data/create/tags/blocks/fan_transparent.json b/src/generated/resources/data/create/tags/blocks/fan_transparent.json index 5e6279801..6c8dfd4aa 100644 --- a/src/generated/resources/data/create/tags/blocks/fan_transparent.json +++ b/src/generated/resources/data/create/tags/blocks/fan_transparent.json @@ -5,6 +5,8 @@ "create:lit_blaze_burner", "create:sail_frame", "#minecraft:fences", - "minecraft:iron_bars" + "minecraft:iron_bars", + "minecraft:campfire", + "minecraft:soul_campfire" ] } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index fc6f202f2..2fa0b7294 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -215,7 +215,7 @@ public class AllTags { AllBlockTags.BRITTLE.add(Blocks.FLOWER_POT, Blocks.BELL, Blocks.COCOA); AllBlockTags.FAN_TRANSPARENT.includeAll(BlockTags.FENCES); - AllBlockTags.FAN_TRANSPARENT.add(Blocks.IRON_BARS); + AllBlockTags.FAN_TRANSPARENT.add(Blocks.IRON_BARS, Blocks.CAMPFIRE, Blocks.SOUL_CAMPFIRE); AllBlockTags.FAN_HEATERS.add(Blocks.MAGMA_BLOCK, Blocks.CAMPFIRE, Blocks.LAVA, Blocks.FIRE, Blocks.SOUL_FIRE, Blocks.SOUL_CAMPFIRE); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java index affb969e3..1aa0ecd7c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java @@ -16,6 +16,7 @@ import com.simibubi.create.foundation.utility.BlockFace; import net.minecraft.block.BlockState; import net.minecraft.block.FlowingFluidBlock; import net.minecraft.entity.LivingEntity; +import net.minecraft.fluid.Fluid; import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemStack; @@ -31,6 +32,7 @@ import net.minecraft.util.SoundEvents; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.common.Tags; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; @@ -74,7 +76,7 @@ public class OpenEndedPipe extends FlowSource { BlockState state = world.getBlockState(outputPos); FluidState fluidState = state.getFluidState(); boolean waterlog = state.contains(WATERLOGGED); - + if (state.contains(HONEY_LEVEL) && state.get(HONEY_LEVEL) >= 5) { if (!simulate) world.setBlockState(outputPos, state.with(HONEY_LEVEL, 0), 3); @@ -139,8 +141,10 @@ public class OpenEndedPipe extends FlowSource { if (simulate) return true; - if (world.getDimension().isUltrawarm() && fluid.getFluid() - .isIn(FluidTags.WATER)) { + if (world.getDimension() + .isUltrawarm() + && fluid.getFluid() + .isIn(FluidTags.WATER)) { int i = outputPos.getX(); int j = outputPos.getY(); int k = outputPos.getZ(); @@ -163,13 +167,33 @@ public class OpenEndedPipe extends FlowSource { return true; } - private void applyEffects(World world, FluidStack fluid) { - if (!fluid.getFluid() - .isEquivalentTo(AllFluids.POTION.get())) { - // other fx - return; - } + private boolean canApplyEffects(World world, FluidStack fluid) { + Fluid fluidType = fluid.getFluid(); + if (fluidType.isEquivalentTo(AllFluids.POTION.get())) + return true; + if (Tags.Fluids.MILK.contains(fluidType)) + return true; + return false; + } + private void applyEffects(World world, FluidStack fluid) { + Fluid fluidType = fluid.getFluid(); + + if (fluidType.isEquivalentTo(AllFluids.POTION.get())) + applyPotionEffects(world, fluid); + + if (Tags.Fluids.MILK.contains(fluidType)) { + if (world.getGameTime() % 5 != 0) + return; + List list = + world.getEntitiesWithinAABB(LivingEntity.class, aoe, LivingEntity::canBeHitWithPotion); + ItemStack curativeItem = new ItemStack(Items.MILK_BUCKET); + for (LivingEntity livingentity : list) + livingentity.curePotionEffects(curativeItem); + } + } + + private void applyPotionEffects(World world, FluidStack fluid) { if (cachedFluid == null || cachedEffects == null || !fluid.isFluidEqual(cachedFluid)) { FluidStack copy = fluid.copy(); copy.setAmount(250); @@ -181,7 +205,7 @@ public class OpenEndedPipe extends FlowSource { return; List list = - this.world.getEntitiesWithinAABB(LivingEntity.class, aoe, LivingEntity::canBeHitWithPotion); + world.getEntitiesWithinAABB(LivingEntity.class, aoe, LivingEntity::canBeHitWithPotion); for (LivingEntity livingentity : list) { for (EffectInstance effectinstance : cachedEffects) { Effect effect = effectinstance.getPotion(); @@ -192,7 +216,6 @@ public class OpenEndedPipe extends FlowSource { livingentity.addPotionEffect(new EffectInstance(effectinstance)); } } - } @Override @@ -234,15 +257,20 @@ public class OpenEndedPipe extends FlowSource { if (!provideFluidToSpace(resource, true)) return 0; - if (!getFluid().isEmpty() && !getFluid().isFluidEqual(resource)) + FluidStack containedFluidStack = getFluid(); + if (!containedFluidStack.isEmpty() && !containedFluidStack.isFluidEqual(resource)) setFluid(FluidStack.EMPTY); if (wasPulling) wasPulling = false; + if (canApplyEffects(world, resource)) + resource = FluidHelper.copyStackWithAmount(resource, 1); int fill = super.fill(resource, action); - if (action.execute() && (getFluidAmount() == 1000 || !FluidHelper.hasBlockState(getFluid().getFluid())) - && provideFluidToSpace(getFluid(), false)) - setFluid(FluidStack.EMPTY); + if (action.simulate()) + return fill; + if (getFluidAmount() == 1000 || !FluidHelper.hasBlockState(containedFluidStack.getFluid())) + if (provideFluidToSpace(containedFluidStack, false)) + setFluid(FluidStack.EMPTY); return fill; } diff --git a/src/main/java/com/simibubi/create/foundation/config/CClient.java b/src/main/java/com/simibubi/create/foundation/config/CClient.java index ebe8f1e31..5ec4fe323 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CClient.java +++ b/src/main/java/com/simibubi/create/foundation/config/CClient.java @@ -47,6 +47,10 @@ public class CClient extends ConfigBase { public ConfigGroup ponder = group(1, "ponder", "Ponder settings"); public ConfigBool comfyReading = b(false, "comfyReading", "Slow down a ponder scene whenever there is text on screen."); + + public ConfigGroup sound = group(1, "sound", "Sound settings"); + public ConfigBool enableAmbientSounds = b(true, "enableAmbientSounds", "Make cogs rumble and machines clatter."); + public ConfigFloat ambientVolumeCap = f(.1f, 0, 1, "ambientVolumeCap", "Maximum volume modifier of Ambient noise"); @Override public String getName() { diff --git a/src/main/java/com/simibubi/create/foundation/sound/SoundScape.java b/src/main/java/com/simibubi/create/foundation/sound/SoundScape.java index 96ea0b8d9..3b68a728b 100644 --- a/src/main/java/com/simibubi/create/foundation/sound/SoundScape.java +++ b/src/main/java/com/simibubi/create/foundation/sound/SoundScape.java @@ -3,6 +3,7 @@ package com.simibubi.create.foundation.sound; import java.util.ArrayList; import java.util.List; +import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.sound.SoundScapes.AmbienceGroup; import com.simibubi.create.foundation.sound.SoundScapes.PitchGroup; import com.simibubi.create.foundation.utility.AnimationTickHolder; @@ -89,8 +90,9 @@ class SoundScape { distanceMultiplier = (float) MathHelper.lerp(distanceTo / SoundScapes.MAX_AMBIENT_SOURCE_DISTANCE, 2, 0); } int soundCount = SoundScapes.getSoundCount(group, pitchGroup); + float max = AllConfigs.CLIENT.ambientVolumeCap.getF(); float argMax = (float) SoundScapes.SOUND_VOLUME_ARG_MAX; - return MathHelper.clamp(soundCount / (argMax * 10f), 0.025f, .15f) * distanceMultiplier; + return MathHelper.clamp(soundCount / (argMax * 10f), 0.025f, max) * distanceMultiplier; } } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/foundation/sound/SoundScapes.java b/src/main/java/com/simibubi/create/foundation/sound/SoundScapes.java index eec64b4e5..e83bef0a9 100644 --- a/src/main/java/com/simibubi/create/foundation/sound/SoundScapes.java +++ b/src/main/java/com/simibubi/create/foundation/sound/SoundScapes.java @@ -11,6 +11,7 @@ import java.util.Set; import java.util.function.BiFunction; import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.Pair; @@ -60,6 +61,8 @@ public class SoundScapes { private static Map, SoundScape> activeSounds = new HashMap<>(); public static void play(AmbienceGroup group, BlockPos pos, float pitch) { + if (!AllConfigs.CLIENT.enableAmbientSounds.get()) + return; if (!outOfRange(pos)) addSound(group, pos, pitch); } @@ -71,6 +74,7 @@ public class SoundScapes { if (AnimationTickHolder.getTicks() % UPDATE_INTERVAL != 0) return; + boolean disable = !AllConfigs.CLIENT.enableAmbientSounds.get(); for (Iterator, SoundScape>> iterator = activeSounds.entrySet() .iterator(); iterator.hasNext();) { @@ -78,7 +82,7 @@ public class SoundScapes { Pair key = entry.getKey(); SoundScape value = entry.getValue(); - if (getSoundCount(key.getFirst(), key.getSecond()) == 0) { + if (disable || getSoundCount(key.getFirst(), key.getSecond()) == 0) { value.remove(); iterator.remove(); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java index 2809bf0b6..7491d635c 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java @@ -62,8 +62,7 @@ public class VecHelper { public static boolean isVecPointingTowards(Vector3d vec, Direction direction) { return Vector3d.of(direction.getDirectionVec()) - .dotProduct(vec.normalize()) > 0; - // return new Vector3d(direction.getDirectionVec()).distanceTo(vec.normalize()) < .75; + .dotProduct(vec.normalize()) > 0.125; // slight tolerance to activate perpendicular movement actors } public static Vector3d getCenterOf(Vector3i pos) {