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

Fix ticking entity with supllimentaries slingshot. #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JCoMcL
Copy link

@JCoMcL JCoMcL commented Nov 1, 2024

I was getting a ticking entity when firing the slingshot into the water. Stacktrace is as follows:

java.util.NoSuchElementException
	at java.base/java.util.LinkedList$ListItr.next(LinkedList.java:901)
	at java.base/java.util.Collections.max(Collections.java:698)
	at knot//net.minecraft.class_1297.handler$hkl000$particular$waterParticles(class_1297.java:25637)
	at knot//net.minecraft.class_1297.method_5746(class_1297.java:1427)
	at knot//net.minecraft.class_1297.method_5713(class_1297.java:1370)
	at knot//net.minecraft.class_1297.method_5876(class_1297.java:1359)
	at knot//net.minecraft.class_1297.method_5670(class_1297.java:503)
	at knot//net.mehvahdjukaar.moonlight.api.entity.ImprovedProjectileEntity.method_5773(ImprovedProjectileEntity.java:101)
	at knot//net.mehvahdjukaar.supplementaries.common.entities.SlingshotProjectileEntity.method_5773(SlingshotProjectileEntity.java:264)
	at knot//net.minecraft.class_638.method_18646(class_638.java:272)
	at knot//net.minecraft.class_1937.method_18472(class_1937.java:480)
	at knot//net.minecraft.class_638.method_32124(class_638.java:255)
	at knot//net.minecraft.class_5574.method_31791(class_5574.java:54)
	at knot//net.minecraft.class_638.method_18116(class_638.java:251)
	at knot//net.minecraft.class_310.method_1574(class_310.java:1901)
	at knot//net.minecraft.class_310.method_1523(class_310.java:1181)
	at knot//net.minecraft.class_310.method_1514(class_310.java:802)
	at knot//net.minecraft.client.main.Main.main(Main.java:250)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

It is possible (nay, likely) that our good friend MehVahdJukaar has done something a bit silly on his end but the stacktrace brought me here so here is where my fix goes.

I also had to modify the build.gradle because it would fail if I didn't give it the modrinth token. Oh yeah and my editor wanted you to have some newlines at the end of your files as a gift.

jcomcl added 2 commits November 1, 2024 12:21
…fect and use a fallback default value. This occurs with the Supplimentaries slingshot and probably some other places too.
@MehVahdJukaar
Copy link

relying on a tick super method (or even baseTick) to be call can be brittle as nothing stops mods from not calling super. thats how inheritance works. A better way of doing this would be to use forge/fabric entity tick events, whose whole purpose is to offer a non mixin way to do this and a way that will be executed all the times for all entities.

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

Successfully merging this pull request may close these issues.

2 participants