Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmod problem - Spawner Agitator not working #290

Closed
xenoflot opened this issue Dec 6, 2018 · 13 comments
Closed

xmod problem - Spawner Agitator not working #290

xenoflot opened this issue Dec 6, 2018 · 13 comments

Comments

@xenoflot
Copy link

xenoflot commented Dec 6, 2018

For feature requests, just erase this template and clearly describe the feature you'd like to see

Minecraft Version

1.12.2

Forge Version

1.12.2-14.23.5.2768

Mod Version

1.12.2-0.8.3-299

Describe your problem, including steps to reproduce it

Spawner Agitators aren't working in my SSP. Seems to be a cross-mod conflict as I did a test with just JEI and PNC-Re and they're working fine there. Not too many mods to check, I hope. XU2's Resturbed Spawner is the only similar item in my mod set. Details in the linked gist. https://gist.github.com/xenoflot/1f080198c19998ec0e4422ceacebc00e

Any other comments?

If you have any debug configs I can add that might help track it down, please let me know.

@desht
Copy link
Member

desht commented Dec 6, 2018

When you say "not working", do you mean they just don't do anything? No stacktraces or other messages in the log?

@xenoflot
Copy link
Author

xenoflot commented Dec 6, 2018

Sorry, I should've been clearer. They appear to apply correctly; the frame appears around the spawner, and shift-right-clicking removed them again. However, there appears to be no changes to the spawning behaviour. That is, if I'm not within 16 blocks, no spawning occurred. I didn't notice anything obvious from a quick scan of the log. I've linked the log from today's session which includes my testing.

@desht
Copy link
Member

desht commented Dec 7, 2018

Could prove tricky to track down, but I'll go through your mod list and see if anything stands out. Resturbed spawners are a separate block, so shouldn't break anything, but you never know...

@xenoflot
Copy link
Author

xenoflot commented Dec 7, 2018

Found it. Foamfix is the culprit.

@desht
Copy link
Member

desht commented Dec 7, 2018

Ah, interesting, and thanks for tracking it down! Almost certainly related to this log entry:

[12:18:51] [main/INFO] [STDOUT]: [pl.asie.foamfix.coremod.FoamFixTransformer:spliceClasses:125]: Spliced in METHOD: net.minecraft.tileentity.MobSpawnerBaseLogic.func_98279_f

As for whether there's anything I can do about it... probably not. But, looks like there's a foamfix config setting that might help:

    # The amount of ticks per player presence check for mob spawners. Set to 1 to disable the patch and match vanilla behaviour. [default: 10, range: 1-200]
    I:mobSpawnerCheckSpeed=10

Worth trying out.

@xenoflot
Copy link
Author

xenoflot commented Dec 7, 2018

No worries. I use MultiMC and have a test instance set up. It doesn't take long to track down conflicts using a "remove half and see if that fixed it, rinse, repeat" technique :)

Just tested that setting and it does fix the problem. Perhaps you could have a chat with Asie and see if he can offer any insight. https://github.com/asiekierka/FoamFix/issues

Lemme know if you put in a fix. I'll test with the new version.

@desht
Copy link
Member

desht commented Dec 7, 2018

Yeah. It's almost certainly because Foamfix injects its own optimised TileEntityMobSpawner#isActivated() method, and PNC's SemiBlockSpawnerAgitator#update() method calls the vanilla version of that via reflection (it's not a public method by default). I suspect there isn't much to be done here, but I'll mention it in the Foamfix issues anyway.

@desht
Copy link
Member

desht commented Dec 20, 2018

Not much else I can do here - Foamfix issue created & there's a workaround (foamfix settings to disable mob spawner checking). Closing this issue.

@desht desht closed this as completed Dec 20, 2018
@asiekierka
Copy link

asiekierka commented Mar 30, 2019

Yes. The issue is that FoamFix's isActivated() will only return true the first time in a given tick - so if you call updateSpawner(), that will fail to execute. no that's wrong I implemented it right why does PCR not work...

@asiekierka
Copy link

Ah, I see.

                //Only tick the logic if it wasn't ticked already by the TE itself, to prevent double ticking.
if(!Reflections.isActivated(spawnerLogic)){

isActivated only tells you if the spawner is within range for activation, which FoamFix caches as the lookup call involved is fairly expensive. As such, adding a fake player would be completely ineffective, as the check had already executed.

@asiekierka
Copy link

asiekierka commented Mar 30, 2019

Here's my proposal: https://git.asie.pl/asie-minecraft/FoamFix/src/branch/0.9.x-1.12.2/src/main/java/pl/asie/foamfix/api/IFoamFixMobSpawnerLogic.java

This should also let you get rid of the FakePlayer, if FoamFix is detected. ;-)

@desht
Copy link
Member

desht commented Mar 30, 2019

Yeah, I think that would do the trick, thanks. I'll try & get round to testing that out soon, will let you know.

@asiekierka
Copy link

I've also found a way to fix your particular case of the bug regardless - I just cache the size of playerEntities in addition to the world time, now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants