way2muchnoise / JustEnoughResources

A rewrite of NotEnoughResources using JustEnoughItems
Other
120 stars 63 forks source link

Caught an error from mod plugin: class jeresources.jei.JEIConfig minecraft:jeresources #410

Open panda-lsy opened 1 year ago

panda-lsy commented 1 year ago

Minecraft Version:1.20.1 Forge Version:47.1.1 JEI Version:jei-1.20.1-forge-15.2.0.23 JER Version:JustEnoughResources-1.20.1-1.4.0.222 My minecraft had problems before this happened regarding the mod version:modernfix-forge-5.3.1+mc1.20.1, but I solved the problem on my own(IllegalArgumentException: Wrong filesystem) Other mods and versions are mentioned in the log files:Sniffer+-forge-1.20.1-0.2.0 How it happened: I followed the tutorial given by Region Scanner, scanned the server's Region file and got world-gen.json with no syntax problems and dragged it into the config folder. When I went into the single player world, the JER didn't take effect and the following error appeared in the latest.log file. (Translated into English using machines and AI, hopefully it's readable.) Here are the relevant passages from latest.log. code latest.log

panda-lsy commented 1 year ago

I removed the mod Sniffer+-forge-1.20.1-0.2.0, but JER still didn't take effect, generating different reports on the console. latest.log

way2muchnoise commented 1 year ago

First log - issue looks similar to #412 Second log, this a problem in the world-gen.json file. Error during loading of DIY data java.lang.ArrayIndexOutOfBoundsException: Index 320 out of bounds for length 320 means there is too much data in array.

oliverrook commented 7 months ago

I've discovered this error occurs with "source" from elemental craft, which has 363 when generated by Region Scanner

RubixDev commented 7 months ago

JER seems to only consider 320 different y-levels, but some mods add or edit dimensions to have more than that. As a temporary workaround I have made this small python script to trim all data with a y-level 320 and above from a world-gen.json, as no relevant blocks generate that high up with the mods I'm playing with anyway.

import json

with open('input.json', 'r') as input_file:
    data = json.load(input_file)

for block in data:
    print(block['block'])
    distrib = block['distrib']
    block['distrib'] = ';'.join(level for level in distrib.split(';') if level and int(level.split(',')[0]) < 320) + ';'

for block in data:
    distrib = [(int(level.split(',')[0]), level.split(',')[1]) for level in block['distrib'].split(';')[:-1]]
    min_y = min(level[0] for level in distrib)
    if min_y > 1:
        distrib.insert(0, (min_y - 1, '0'))
    block['distrib'] = ';'.join(f'{level[0]},{level[1]}' for level in distrib) + ';'

with open('output.json', 'w') as output_file:
    json.dump(data, output_file, indent=2)
way2muchnoise commented 7 months ago

Guess I need to check the bounds again on how "tall" a dimension can be. I thought 320 was the cap with the new negative Y-levels.

RubixDev commented 7 months ago

According to the wiki even the vanilla overworld reaches from -64 to 320, so 384 levels in total, although natural generation only occurs between -64 and 256, resulting in the 320 levels you're currently using. Custom worlds can allow levels anywhere between -2032 and 2032 though, giving a total of up to 4064 possible levels, quite a bit more than 320.