tttsaurus / Fluid-Interaction-Tweaker

This is a (1.12.2 Minecraft Forge) CraftTweaker/GroovyScript addon that enables you to add more fluid interactions
https://www.curseforge.com/minecraft/mc-mods/fluid-interaction-tweaker
MIT License
2 stars 0 forks source link

[Feature Request] Add `Fluid+Block` and `Fluid+Entity` events #5

Closed Krutoy242 closed 1 week ago

Krutoy242 commented 1 month ago

I believe, this features perfectly align with mod name "Fluid Interaction Tweaker" 😀

I like this features in other mods, like ExNihilo Witch Water that turns one mobs into others. Or ThermalExpansion fluids like Pyrotheum that melting blocks when flowing. It would be cool if this interactions could be tweaked with your mod!

image

https://github.com/user-attachments/assets/0dc6c483-300e-4093-ab6a-337bb70d0811

tttsaurus commented 1 month ago

ill try, but still the same sentence "im not sure how long it takes me to finish since currently busy with other things"

especially for the second feature, the fluid turns the surrounding blocks into sth currently, the mod only allows the fluid to turn into sth instead of changing its surrounding

From wiki image

i dont know whether you noticed that im only allowing fluid to be the initiator since it's flowing and notifying other things and blocks are never the initiator which means they never turn to sth else

i think you can just add the second feature by listening to the event it's quite conflicting with my design and code written

tttsaurus commented 1 month ago

second feature implemented by crt

image

#reloadable

import mods.fluidintetweaker.FITweaker;
import mods.fluidintetweaker.event.CustomFluidInteractionEvent;
import mods.zenutils.EventPriority;
import crafttweaker.world.IFacing;

var recipes as [string] = FITweaker.addRecipe(<liquid:cobalt>, false, <item:minecraft:gold_block>.asBlock(), <item:minecraft:diamond_block>.asBlock());

events.register(function(event as CustomFluidInteractionEvent)
{
    var thisRecipe = event.liquidInteractionRecipeKey;

    for recipe in recipes
    {
        if (recipe == thisRecipe)
        {
            event.cancel();
            var facings = 
            [
                IFacing.north(),
                IFacing.east(),
                IFacing.south(),
                IFacing.west(),
                IFacing.down(),
                IFacing.up()
            ] as IFacing[];

            for facing in facings
            {
                var neighborPos = event.position.getOffset(facing, 1);
                if (event.world.getBlockState(neighborPos).block.definition.id == <item:minecraft:gold_block>.asBlock().definition.id)
                    event.world.setBlockState(<blockstate:minecraft:diamond_block>, neighborPos);
            }
        }
    }

}, EventPriority.highest(), true);

it should be helpful

Krutoy242 commented 1 month ago

Looks good!

tttsaurus commented 1 month ago

then ill not consider the second feature.

todos:

  1. mobs in fluid
  2. ComplexOutput mentioned in another issue

is it ok for you?

Krutoy242 commented 1 month ago

Its ok!

tttsaurus commented 1 month ago

emm i just realized that i can add the second feature into ComplexOutput

but im currently refactoring so many things and nowhere near finishing

tttsaurus commented 2 weeks ago

v1.4.0-preview-2 has the features you requested but entity conversion jei compat is still in the todo list

and no docs yet, have a look at FBTweaker for crt methods

Krutoy242 commented 2 weeks ago

Thank you for info! I will try to utilize new functionality soon!

Could you write simplest example of CT script to add liquid interaction to start with?

tttsaurus commented 2 weeks ago

check out the release page, i attached an example. for other specific functionalities, please refer to the code

tttsaurus commented 1 week ago

fluid behavior (including entity conversion) jei compat done (v1.4.0)