webbukkit / DynmapBlockScan

Tool to scan post-1.8 MC blocks and JSON model data to automatically generate Dynmap models
61 stars 30 forks source link

Add support for minecraft 1.16.4 #50

Closed Lumrenion closed 2 years ago

Lumrenion commented 3 years ago

I did the required changes to make DynmapBlockScan work with 1.16.4 (did not test with lower versions as Dynmap works on that version as well). Changes were:

Notice: I had to set max-tick-time to -1 for it to work. But as the mod only needs to run once and can be removed from the server afterwards, this should be fine.

Timboman commented 3 years ago

If you could get a release compiled for this it would be awesome, been waiting on proper 1.16 support for a while.

alexbilevskiy commented 3 years ago

Managed to compile snapshot of @Lumrenion's repo branch 1.16.4, works just fine. DynmapBlockScan-3.0-SNAPSHOT-forge-1.16.4.jar.zip

@Timboman try this

Terpo commented 3 years ago

I also compiled a version from that branch and it is working so far. Only one combination creates massive problems for me: forge-1.16.4-35.1.36.jar

bluepower-1.16.4-0.5.231-alpha-universal.jar Dynmap-3.1-SNAPSHOT-forge-1.16.4.jar DynmapBlockScan-3.0-SNAPSHOT-forge-1.16.4.jar

The server always stalls at [19:29:16] [Server thread/INFO] [DynmapBlockScan/]: minecraft:assets/minecraft/blockstates/quartz_bricks.json : Failed to open blockstate Thats before the loading models step. I set my ticktime to -1 and waited for a good time but nothing happens. Other mods like Quark will take a while but work in the end :)

ced455 commented 3 years ago

Thank you @alexbilevskiy ,

I'm a bit new in this, where i should put this folder ? it's obviously a folder so it cannot work in the mods folder.

Should i put the content in the dynmap folder ?

thank you.

Timboman commented 3 years ago

Thank you @alexbilevskiy ,

I'm a bit new in this, where i should put this folder ? it's obviously a folder so it cannot work in the mods folder.

Should i put the content in the dynmap folder ?

thank you.

Just remove the .zip extension and put the resulting .jar file in your mods folder

ced455 commented 3 years ago

@Timboman oh i feel dumb now 😄 thank you !

Lumrenion commented 3 years ago

I read, but did not try, that the modsupport folder will be cleared, when starting the server without blockscan mod activated.

When blockscan has done its job, the *-models.txt and *-tecture.txt files will be in dynmap/renderdata/modsupport. Stop your server, disable the blockscan mod (remove the jar file or, what I do, rename the file to filename.jar.bak, that way forge does not load the mod) and move all those files to dynmap/renderdata. Then start your server again.

ced455 commented 3 years ago

@Lumrenion It's what i am doing on my local then i will transfer the rendered data to the server, I am trying to run this in a All the mods 6 server (adventurous i know !).

atm the map launch is stuck in a sort of loop and the logs kee repeeting this :

[10:41:02] [Server thread/WARN]: rats:assets/rats/blockstates/rat_cage_decorated.json : JSON syntax error in block state file com.google.gson.JsonSyntaxException: java.lang.IllegalStateException at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) ~[gson-2.8.0.jar:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[gson-2.8.0.jar:?] at com.google.gson.Gson.fromJson(Gson.java:952) ~[gson-2.8.0.jar:?] at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[gson-2.8.0.jar:?] at org.dynmap.blockscan.blockstate.BlockState$Deserializer.deserialize(BlockState.java:188) ~[?:?] at org.dynmap.blockscan.blockstate.BlockState$Deserializer.deserialize(BlockState.java:151) ~[?:?] at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[gson-2.8.0.jar:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[gson-2.8.0.jar:?] at org.dynmap.blockscan.DynmapBlockScanPlugin.loadBlockStateFile(DynmapBlockScanPlugin.java:1157) [?:?] at org.dynmap.blockscan.DynmapBlockScanPlugin.loadBlockState(DynmapBlockScanPlugin.java:1117) [?:?] at org.dynmap.blockscan.DynmapBlockScanPlugin.serverStarting(DynmapBlockScanPlugin.java:363) [?:?] at org.dynmap.blockscan.DynmapBlockScanMod.onServerStarting(DynmapBlockScanMod.java:62) [?:?] at net.minecraftforge.eventbus.ASMEventHandler_412_DynmapBlockScanMod_onServerStarting_FMLServerStartingEvent.invoke(.dynamic) [?:?] at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) [eventbus-3.0.5-service.jar:?] at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) [eventbus-3.0.5-service.jar:?] at net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarting(ServerLifecycleHooks.java:102) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] at net.optifine.reflect.Reflector.callBoolean(Reflector.java:737) [?:?] at net.minecraft.server.integrated.IntegratedServer.func_71197_b(IntegratedServer.java:90) [?:?] at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:620) [?:?] at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232) [?:?] at net.minecraft.server.MinecraftServer$$Lambda$29687/892976229.run(Unknown Source) [?:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51] Caused by: java.lang.IllegalStateException at com.google.gson.JsonArray.getAsString(JsonArray.java:215) ~[gson-2.8.0.jar:?] at org.dynmap.blockscan.blockstate.Condition$Deserializer.parseBaseCondition(Condition.java:59) ~[?:?] at org.dynmap.blockscan.blockstate.Condition$Deserializer.deserialize(Condition.java:47) ~[?:?] at org.dynmap.blockscan.blockstate.Condition$Deserializer.deserialize(Condition.java:25) ~[?:?] at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[gson-2.8.0.jar:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) ~[gson-2.8.0.jar:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) ~[gson-2.8.0.jar:?] ... 25 more

Lumrenion commented 3 years ago

As I understand this correctly, the error message says, that one of your mods (rats) has a JSON file with an invalid syntax: assets/rats/blockstates/rat_cage_decorated.json

What you can do is, unpack the mod jar file (should work with windows unzip) and take a look at that file. As I only patched what was necessary in the blockscan mod, I am not too aware of how it is working internally.

ced455 commented 3 years ago

Can't find any obvious error or syntax in the json but don't worry i'll launch the modpack without this mod, if it can generate everything for the other 244 mods i'll be fine !

Attached the jar if you are curious for future issues

rats-7.0.3-1.16.3.jar.zip

ced455 commented 3 years ago

@Lumrenion , well no luck without the "rats" mod I have hundreds of line saying :

Failed to open blockstate, it have been 30 minutes without any new message and i cannot access the map (running all of that from solo not multiplayer).

do you want me to raise an issue ?

Lumrenion commented 3 years ago

This PR seems to do the necessary work for blockscan to do its job for multiple mods. I guess, the problems you state here lie somewhere else than in the changes of the PR itself. So they should be handled separately. Or did you try all your mods (in a previous version) with blockscan in MC 1.15.2 and it works?

ced455 commented 3 years ago

Let me explain what I did so far.

it look like most of my black box on dynmap come from this mod :

https://www.curseforge.com/minecraft/mc-mods/oh-the-biomes-youll-go

Created my own modpack with :

forge-35.1.29 byg-1.1.5 Dynmap-3.1-SNAPSHOT-forge-1.16.4 DynmapBlockScan-3.0-SNAPSHOT-forge-1.16.4

launched a solo map. close minecraft

I have now twofiles in dynmap\renderdata\modsupport

Copied them in the dynmap folder in my server. restarted the server

purged the map with : /dynmap purgeworld world

launched a full render

The dynmap still display black block and the two files disapeared from the dynmap\renderdata\modsupport folder

TL DR: once you remove most of the mods to avoid issues and just put the mods that are not displaying in dynmap it make it easier and files are generated, however dynmap does not pick them up and delete the files previously generated .

Terpo commented 3 years ago

I have the same problem @ced455 . Over the last days I generated files for a lot of mods of my pack. Now everytime the server starts the renderdata order gets cleared.

ced455 commented 3 years ago

@Terpo just put the files in dynmap\renderdata don't put them in the modsupport folder once generated ;)

Terpo commented 3 years ago

Well, that works :D

LiskoSlayer63 commented 3 years ago

@ced455

Failed to open blockstate, it have been 30 minutes without any new message and i cannot access the map (running all of that from solo not multiplayer).

I'm having this same issue on my server, did you manage to fix it somehow? It seems to hang with vanilla blocks and doesn't output anything to the renderdata folder.

EDIT: It works fine, just took about one hour to complete, but it did complete.

beeProta commented 3 years ago

I'm having a similar issue. I'm trying to run blockscan on Crucial 2, and it repeats the same output about "Block mixes model and nonmodel state handling". There's a lot here that I just don't quite understand in terms of what's happening, so I will just upload my log. Sorry/thanks. latest.log

EDIT: Removing Supplementaries solved the issue, but the mod itself seems to be incompatible? Everything but it generates, including isolating Supp. and running blockscan. (Not really sure what to do about it, but hoping my findings helps someone else, if anything.)

71vl17 commented 3 years ago

Hello, sorry for posting here, but issues seem to be closed in Lumrenion's fork. So, how can I compile it? There's no instructions, I tried default ./gradlew build on macOS & Ubuntu and got this:

1

Where to get this missing file? Also dynmap.us is unavailable, can it cause this problem?