DevBobcorn / CornCraft

A Minecraft Client Implementation Made with Unity
68 stars 6 forks source link

Data not available #8

Closed benda95280 closed 3 months ago

benda95280 commented 3 months ago

Hello,

I've been able build it, and when trying to join it show : Data not available.

How can i fix it ? Thanks.

DevBobcorn commented 3 months ago

The data loader is still under development and will be available soon, but before that it will require some manual set up to properly load the resource and data files(including translation files). I'll leave a reply here when I complete this.

DevBobcorn commented 3 months ago

If you want to try it right now, you can do the data preparation manually. Just copy the whole Extra Data folder to C:\Users\<Your Name>\AppData\LocalLow\DevBobcorn\CornCraft\Extra Data, and the data should load.

benda95280 commented 3 months ago

Just done what you said earlier, and notification are in chinese. It seems it's not by default in english. How can i switch it ?

image

DevBobcorn commented 3 months ago

Oh, yes, it is currently hard-coded, you can change it here: https://github.com/DevBobcorn/CornCraft/blob/master/Packages/com.devbobcorn.craftsharp-protocol/Runtime/Scripts/CornGlobal.cs#L26 For English it is en_us.

benda95280 commented 3 months ago

I'm stuck at : Loading blocks models.

Log:

Mono path[0] = 'C:/Users/Benjamin/Downloads/CornCraft-master/Build/CornCraft_Data/Managed'
Mono config path = 'C:/Users/Benjamin/Downloads/CornCraft-master/Build/MonoBleedingEdge/etc'
[Physics::Module] Initialized MultithreadedJobDispatcher with 7 workers.
Initialize engine version: 2022.3.28f1 (6bae5ce6b222)
[Subsystems] Discovering subsystems at path C:/Users/Benjamin/Downloads/CornCraft-master/Build/CornCraft_Data/UnitySubsystems
GfxDevice: creating device client; threaded=1; jobified=1
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce GTX 1660 Ti (ID=0x2191)
    Vendor:   NVIDIA
    VRAM:     5966 MB
    Driver:   31.0.15.5222
Begin MonoManager ReloadAssembly
- Loaded All Assemblies, in  0.248 seconds
- Finished resetting the current domain, in  0.003 seconds
<RI> Initializing input.
New input system (experimental) initialized
Using Windows.Gaming.Input
<RI> Initialized touch support.
UnloadTime: 1.149000 ms
Retrieving Server Info...
[vanilla-1.18.2] format: 4, description: Meow~
No resource pack found at C:/Users/Benjamin/AppData/LocalLow/DevBobcorn/CornCraft\Resource Packs\vanilla_fix
Trying to load resources from an invalid resource pack!
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
Cannot convert to float3x3: Input string was not in a correct format.
DevBobcorn commented 3 months ago

So I checked the resource loader and found a bug when trying to download default translation file(en_us.json) and fixed it, and then I tried removing all files from Resource Packs folder and everything still works, the resource files get downloaded and load properly. I did not, however, successfully reproduce this Cannot convert to float3x3: Input string was not in a correct format. error, can you share a screenshot of the console to show me the stacktrace?

DevBobcorn commented 3 months ago

And by the way, vanilla_fix is not mandatory, so you can safely ignore these two lines:

No resource pack found at C:/Users/Benjamin/AppData/LocalLow/DevBobcorn/CornCraft\Resource Packs\vanilla_fix Trying to load resources from an invalid resource pack!

benda95280 commented 3 months ago

I did not, however, successfully reproduce this Cannot convert to float3x3: Input string was not in a correct format. error, can you share a screenshot of the console to show me the stacktrace?

How can i generate / gather this ? Not very familiar with Unity IDE. Regards,

DevBobcorn commented 3 months ago

You don't have to build it to run, you can run it in Editor by pressing the play button in Login scene, and then you will see log info being printed into the Console tab.

DevBobcorn commented 3 months ago

Or you can check the Development Build option when building the game, and then it will connect to Unity Editor when you run it. In this way you can also see runtime log info in Unity Editor's console.

benda95280 commented 3 months ago

Player.log Editor.log

Is it what you need ?

DevBobcorn commented 3 months ago

Actually I want a screenshot of the console in Editor showing this error message, like this: Console The stacktrace shown in the lower panel helps me to locate the problem.

DevBobcorn commented 3 months ago

After checking my code I found that this message is printed from here, which is called by BlockModelLoader or ItemModelLoader in resource pack parser. However this should raise warnings instead of errors, and shouldn't stop the game from running.

DevBobcorn commented 3 months ago

Oh I finally realized what's wrong here, it's the different number format in different CultureInfos. If your system locale is French, C# uses French number format, which uses comma as the decimal separator, to parse the float value from string, and that leads to the problem here. Float Parse

DevBobcorn commented 3 months ago

I'll patch this soon.

benda95280 commented 3 months ago

Thanks !