#(hedwy) Both location tags in Block Spread events returns the same location

37 messages · Page 1 of 1 (latest)

strong pike
#

Hello! I need to get a location of block that spreads in on block spread event, but both of the context tags <context.source_location> and <context.location> returns location of the new block, not the original one.

debug:
https://paste.denizenscript.com/View/116075
script:
https://paste.denizenscript.com/View/116076

ivory prismBOT
#

(hedwy) Both location tags in Block Spread events returns the same location

ivory prismBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

strong pike
#

am I doing something wrong here? oO can't get the proper location in any way

keen epoch
#

!e block spread

viscid condorBOT
# keen epoch !e block spread
Group

Block

Event Lines

block spreads

Switches

type:<block> to only run if the block spreading matches the material input.

Triggers

when a block spreads based on world conditions, EG, when fire spreads, or when mushrooms spread, or when vines grow.

Context

<context.source_location> returns the LocationTag of the block that spread.
<context.location> returns the LocationTag of the new block.
<context.material> returns the MaterialTag of the block that spread.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

keen epoch
#

eh

strong pike
keen epoch
#

could you try on instead of after please

strong pike
#

Oh yeah, sure. It was on, I switched to after while testing, one sec

#

It's 1.20.2 server but I've faced the same thing earlier when I was playing around vines, I just thought that it's me who does something wrong huh pikasurprise

keen epoch
#

can you add a wait 1t after your script and run the narrates again

strong pike
#
        - announce to_console "<context.source_location> --- <context.location>"
        - announce to_console <context.source_location.equals[<context.location>]>
        - wait 1t
        - announce to_console "<context.source_location> --- <context.location>"
        - announce to_console <context.source_location.equals[<context.location>]>```
#

like that?

keen epoch
#

yes

strong pike
keen epoch
#

no idea then, trying to understand old denizen code but makes no sense to me SCgrin

thick grove
# keen epoch no idea then, trying to understand old denizen code but makes no sense to me <:S...
            case "location": return location;
            case "material": return material;
            case "source_location": return new LocationTag(event.getBlock().getLocation());
        }
        return super.getContext(name);
    }

    @EventHandler
    public void onBlockSpreads(BlockSpreadEvent event) {
        location = new LocationTag(event.getBlock().getLocation());

Seems both location (which is returned in context.location) and context.source_location return the same thing

#

event.getBlock().getLocation()

keen epoch
#

yeah i know, that's the thing I don't understand

thick grove
#

There is a method to get the source, so it's probably just a typo

strong pike
#

Oo would be cool if that's gonna be fixed. I will simplify a few of my scritps then where I used this event

keen epoch
open mountainBOT
#
Changed to Bug

Thread is now a Bug thread. This indicates a core code bug that a developer must resolved, not an error message or other support topic. Please do not misuse the Bug label. Use </helpthread:1028674284870180883> to switch the thread back to a normal help thread if you are not 100% confident it is a code bug.

thick grove
keen epoch
#

yee

keen epoch
#

20 fucking 15

strong pike
#

it feels like I dig up something ancient that is dangerous and can curse me

austere musk
#

would this be something that'd get bundled up and pushed in like a cleanup pr or

strong pike
#

Sorry, if that's an easy fix can I ask for, ehm, a quick fix? 👉 👈
I have cool idea that I want to try asap, would be really glad, thanks

thick grove
#

Working on this, can't do proper testing rn so will probably PR tomorrow

thick grove
#

Fixed ref #commit-log message

open mountainBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@strong pike