Llamarama

Llamarama

56k Downloads

Server Enchantment Trades crash the game when a certain mod is loaded.

TheButterbrotMan opened this issue · 79 comments

commented

I am convinced there is a mod in your pack that is providing invalid max level values for enchantments. This time I am going to look into it, in depth, because that is behavior most mods consider invalid. Some research needs to happen. Could you try to reduce your pack to all mods that add enchantments and send a list of those mods here. If you could, I would really appreciate it.

Thank you for reporting! I am looking into this personally.

commented

I will try. I also link my modpack here
Deathdusk (Client)-DEV.zip
.

commented

Is there any specific enchantment mod where i should begin? Some kind of enchantment or generally enchantment mods?

commented

Also could the enchantment be allready included here?

Entity NBT: {AbsorptionAmount:0.0f,Age:0,Air:300s,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Attributes:[{Base:0.5d,Name:"minecraft:generic.movement_speed"},{Base:48.0d,Modifiers:[{Amount:-0.04102265703986181d,Name:"Random spawn bonus",Operation:1,UUID:[I;-193497916,1551451467,-1660894393,-2024918408]}],Name:"minecraft:generic.follow_range"},{Base:0.0d,Name:"stepheightentityattribute:stepheight"}],BMLootBlock:0b,BalmData:{},Brain:{memories:{}},CanPickUpLoot:0b,DeathTime:0s,FallDistance:0.0f,FallFlying:0b,Fire:-1s,ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],Health:20.0f,HurtByTimestamp:0,HurtTime:0s,Inventory:[],Invulnerable:0b,IsCrimson:0b,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],Offers:{Recipes:[{Reputation:0,buy:{Count:1b,id:"llamarama:flight_of_the_bumble_llama"},buyB:{Count:1b,id:"minecraft:air"},demand:0,id:"minecraft:trade_offer",maxUses:4,priceMultiplier:1.0f,rewardExp:1b,sell:{Count:1b,id:"llamarama:llamajama_disc"},specialPrice:0,uses:0,xp:3},{Reputation:0,buy:{Count:24b,id:"minecraft:paper"},buyB:{Count:1b,id:"minecraft:air"},demand:0,id:"minecraft:trade_offer",maxUses:12,priceMultiplier:1.0f,rewardExp:1b,sell:{Count:1b,id:"minecraft:emerald"},specialPrice:0,uses:0,xp:2},{Reputation:0,buy:{Count:6b,id:"minecraft:emerald"},buyB:{Count:1b,id:"minecraft:air"},demand:0,id:"minecraft:trade_offer",maxUses:8,priceMultiplier:1.0f,rewardExp:1b,sell:{Count:6b,id:"llamarama:raw_llama_meat"},specialPrice:0,uses:0,xp:3}]},OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,Pos:[-79.5d,65.0d,-152.5d],Rotation:[89.20901f,-9.18134f],Tags:["collective-fabric.checked"],UUID:[I;-1971168943,-433306139,-2095539852,2073394574],arcanus:{DiscombobulatedTimer:0,IsDiscombobulated:0b},bm_IsStunted:0b,cardinal_components:{"bewitchment:additional_water_data":{Submerged:0b,WetTimer:0},"bewitchment:blood":{Blood:100},"bewitchment:curses":{Curses:[]},"bewitchment:fake_mob":{TargetUUID:""},"bewitchment:familiar":{Familiar:0b},"bewitchment:minion":{MasterUUID:""},"eldritch_mobs:eldritch_modifiers":{eldritch:0b,elite:0b,rank:0b,saved_mods:{},ultra:0b},"immortuoscalyx:infection":{infectionFollower:0b,infectionImpedement:0b,infectionProgression:0,infectionResistance:1.0d,infectionTimer:0},"pickyourpoison:numbnessdamage":{DamageAccumulated:0.0f},"the_aether:condition_manager":{"the_aether:venom":{chronic:0.0f,temporary:0.0f}}},checkedIfInLampChunk:0b,cpaCooldown:0,cpadidTP:0b}

commented

Is there any specific enchantment mod where i should begin? Some kind of enchantment or generally enchantment mods?

Not really. It can be any mod adding enchantments, since no specific info is provided on the log.

Also could the enchantment be allready included here?

That is actually all the data that was able to save. It wouldn't be there, since the issue came when encoding the extra NBT data on the entity.

commented

Are you able to tell me for what you did search in Github? Im guessing you did a search for a specific string on each mods git?

commented

Are you able to tell me for what you did search in Github?

Well simply put, I went to the curseforge page of the mods. Found their gh. Went there. Went through and found all classes that implement Enchantment and just looked for sus things like changable or default max levels.

commented

However I need to check what the default value for max level is so give me a sec.

commented

Hm, the value defaults to 1 actually. I may have to look through again. However that one is the only red flag I found.

commented

So. Let's try this. I'll send you a mod that will detect invalid enchantment levels. Run the pack with it and send the log. Does that sound like a deal?

commented

Yes. - Deal!

commented

Yes, currently testing!

commented

does this link work?

commented

latest.log? Do i need to create a world? Or just start to menu and close?

commented
Incompatible mod set!
net.fabricmc.loader.impl.FormattedException: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod discovery failed!
	at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:192)
	at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Caused by: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod discovery failed!
	at net.fabricmc.loader.impl.discovery.ModDiscoverer.lambda$discoverMods$1(ModDiscoverer.java:137)
	at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
	at net.fabricmc.loader.impl.discovery.ModDiscoverer.discoverMods(ModDiscoverer.java:137)
	at net.fabricmc.loader.impl.FabricLoaderImpl.setup(FabricLoaderImpl.java:208)
	at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:187)
	... 3 more
Caused by: net.fabricmc.loader.impl.metadata.ParseMetadataException: Error reading fabric.mod.json file for mod at C:\Users\elias\curseforge\minecraft\Instances\Deathdusk\mods\InvalidEnchantDetector-1.0-SNAPSHOT.jar: Invalid mod id InvalidEnchantDetector:
	- It starts with an invalid character 'I' (it must be a lowercase a-z - uppercase isn't allowed anywhere in the ID)
	- It contains invalid characters: 'D', 'E'!
	at net.fabricmc.loader.impl.metadata.ModMetadataParser.checkModId(ModMetadataParser.java:233)
	at net.fabricmc.loader.impl.metadata.ModMetadataParser.parseMetadata(ModMetadataParser.java:54)
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.computeJarFile(ModDiscoverer.java:269)
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:232)
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:194)
	at java.base/java.util.concurrent.RecursiveTask.exec(RecursiveTask.java:100)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

FIX YOUR MOD!! Lol.

commented

oop
my bad
for some reason intellij picks up the id from the name of the project lol

commented

latest.log? Do i need to create a world? Or just start to menu and close?

Just start the game lol

commented
commented

Its deleted lol

You clicked at the wrong moment lol

commented

How about this one? https://www.dropbox.com/s/d9oh5sa9cwo4da0/InvalidEnchantDetector-1.0-SNAPSHOT.jar?dl=0

Cant download. Its deleted. Lol.

I changed the link man chill

commented

Ok. Starting now.

commented

Nah, was loaded since five minutes, but was getting food, at the door, from the pizzaman. Lol.

commented

On 1.18.1 i was at 650. Lol.

commented

Still loading ig

commented

I mean dang 400 mods is a lot even for fabric standards lol

commented

uhm
You didn't put the mod in the pack lol

commented

Or I got an older log

commented

Ehm. The mod is in. Its the actual log. I try again.

commented

I mean if you check the modid list, enchant-detect isn't present lol

commented

Yea, i try again. Maybe i did something wrong. Lol.

commented

Okay listen. I know what you are gonna say, but I made typo in the old code and the check it did was actually the opposite of what I wanted.

commented

Wait for a new version

commented

This should work

commented

Ok. Lol.

commented

I tested this one lol

commented

Could you go quicker please? It's really late here and I need to go to sleep.

commented
commented

https://bytebin.lucko.me/vp2DGJqS6m <- 2nd Version

Well the mod is present here. But its not the working version :(

commented

https://bytebin.lucko.me/vp2DGJqS6m <- 2nd Version

https://bytebin.lucko.me/LTflM1fWzK <- 3nd Version

Could you go quicker please? It's really late here and I need to go to sleep.

Im doing my bestest and fastest!

commented

Reference map 'InvalidEnchantDetector-refmap.json' for enchant-detector.mixin.json could not be read. If this is a development environment you can ignore this message is this bad?

commented

dw about that one

commented

https://bytebin.lucko.me/vp2DGJqS6m <- 2nd Version
https://bytebin.lucko.me/LTflM1fWzK <- 3nd Version

Could you go quicker please? It's really late here and I need to go to sleep.

Im doing my bestest and fastest!

thank you

commented

I am afraid I will have to go. We shall continue tomorrow.

commented

https://bytebin.lucko.me/WGX3Z4Dttp

Ok :( Have a good night.

commented

https://www.dropbox.com/s/ixm8eze926783g6/InvalidEnchantDetector-1.0-SNAPSHOT.jar?dl=0

@0xJoeMama could you share/elaborate what that helper mod does? Because I look at huge ass logs and don't know what's going on haha

Just prints any enchantment with a max level less than or equal to one lol

commented

https://www.dropbox.com/s/ixm8eze926783g6/InvalidEnchantDetector-1.0-SNAPSHOT.jar?dl=0

@0xJoeMama could you share/elaborate what that helper mod does? Because I look at huge ass logs and don't know what's going on haha

commented

Maybe we should just change this random.nextInt(Math.max(0, it.getMaxLevel())) + 1)) to random.nextInt(Math.max(1, it.getMaxLevel())) + 1)), since random.nextInt(0) fails too.

commented

@TheButterbrotMan your logs show your computer user name. I don't know if you want that.

commented

@TheButterbrotMan your logs show your computer user name. I don't know if you want that.

Yea, I know. But it is no matter for me. But thank you.

commented

I reviewed the files you send, there is no indication of an enchantment that has a non-positive (-inf,0] max value.

Maybe @0xJoeMama|s mod is missing some, but I would assume his mod hooks in at the correct time.

Did you check the llama mod with only one of the others to find out with what mod that happened?

Edit: Maybe I missed it, but did you make this pack yourself or is this a pack you can download somewhere?

commented

In reality, that should never happen.

commented

Im a modpack author, so you can download it but yes, it's also mine. Lol. Do you want the .zip?

Haven't checked it with only enchantments mods, because I don't really know how to reproduce.

Maybe it's hook to early, change it maybe to doing at after everything is loaded. If possible.

commented

Maybe we should just change this random.nextInt(Math.max(0, it.getMaxLevel())) + 1)) to random.nextInt(Math.max(1, it.getMaxLevel())) + 1)), since random.nextInt(0) fails too.

I am aware that this is the fix. However we still need to figure out what the mod causing this issue is, since max returning 0 means some mod is either giving 0 or <0 for the max level.

commented

Hello again! I have changed the mod because I realised that my 11 pm self doesn't realise mods don't get loaded at the same time. Try this version of the mod: https://www.dropbox.com/s/kfoqllcwcwa8bp8/InvalidEnchantDetector-1.0-SNAPSHOT.jar?dl=0

commented

Maybe it's hook to early, change it maybe to doing at after everything is loaded. If possible.

That was literally the issue. 11pm me doesn't function lol

commented

In reality, that should never happen.

Yes I agree.

commented

Hello again! I have changed the mod because I realised that my 11 pm self doesn't realise mods don't get loaded at the same time. Try this version of the mod: https://www.dropbox.com/s/kfoqllcwcwa8bp8/InvalidEnchantDetector-1.0-SNAPSHOT.jar?dl=0

Ill do.

commented
commented

Thank you. I’ll look through it in a bit!

commented

It's not logging anything.

@0xJoeMama could you share the helper mod with me so I can make adjustments too?

commented

It's not logging anything.

@0xJoeMama could you share the helper mod with me so I can make adjustments too?

You need to join a world

commented

Ok sir

22:17 - Still generating.

commented

Huh, I looked through it twice. They are all non-negative -- meaning [0,inf). Maybe I am missing something and the nextInt gets called on a 0 value somewhere...?

commented

Huh, I looked through it twice. They are all non-negative -- meaning [0,inf). Maybe I am missing something and the nextInt gets called on a 0 value somewhere...?

What are you talking about vanillatweaks posts like 20 enchantments with 0 as their max level lol.

So... VanillaTweaks is the cause?

commented

Huh, I looked through it twice. They are all non-negative -- meaning [0,inf). Maybe I am missing something and the nextInt gets called on a 0 value somewhere...?

What are you talking about vanillatweaks posts like 20 enchantments with 0 as their max level lol.

commented

Huh, I looked through it twice. They are all non-negative -- meaning [0,inf). Maybe I am missing something and the nextInt gets called on a 0 value somewhere...?

Also you need a positive bound for nextInt not 0

commented

Maybe we should just change this random.nextInt(Math.max(0, it.getMaxLevel())) + 1)) to random.nextInt(Math.max(1, it.getMaxLevel())) + 1)), since random.nextInt(0) fails too.

I just saw that we add the 1 after the max is calculated. My bad.

commented

Huh, I looked through it twice. They are all non-negative -- meaning [0,inf). Maybe I am missing something and the nextInt gets called on a 0 value somewhere...?

What are you talking about vanillatweaks posts like 20 enchantments with 0 as their max level lol.

So... VanillaTweaks is the cause?

Yes. I will have to research whether we need to modify our balues or not and/or make an issue in vanillatweaks

commented

Yes but even if this IS chosen we add 1 to the max bound and it gets 1 again, and 1 > 0. I don’t see how this would crash the game.

The crash is because we are using 0 as a max bound

commented

Yes but even if this IS chosen we add 1 to the max bound and it gets 1 again, and 1 > 0. I don’t see how this would crash the game.

commented

I just saw that we add the 1 after the max is calculated. My bad.

Well your change still works but we should notify vanillatweaks. This behavior is kind of unsuspected by most mods unless setting the max level to 0 is a common practice.