The Lost Cities

The Lost Cities

60M Downloads

Minimal Asset DataPack causes crash?

e1y4s opened this issue · 1 comments

commented

I’m trying to use the asset datapack system, but it doesn’t seem to work on my end, even with a minimal working example. I don’t know if anyone could tell me where the problem might be?

  • Forge version : 1.20.1-47.2.0
  • LostCities version : 1.20-7.1.6

[update 1]

Actually, it seems the problem is that my data pack is not loaded by Forge because it does not appear in my list of mods. However, I did zip my folder, rename it to .jar, and place it in the mods folder.

  • Tree structure

addon
├── META-INF
│   └── mods.toml
├── data
│   └── addon
│       └── lostcities
│           ├── buildings
│           │   └── building1.json
│           ├── citystyles
│           │   └── citystyle1.json
│           ├── parts
│           │   ├── building1_floor.json
│           │   ├── building1_ground.json
│           │   └── building1_top.json
│           └── worldstyles
│               └── worldstyle1.json
└── pack.mcmeta

9 directories, 8 files
  • Crash report

---- Minecraft Crash Report ----
// Would you like a cupcake?

Time: 2024-05-18 20:17:51
Description: Exception initializing level

java.lang.RuntimeException: Error getting resource addon:worldstyle1!
	at mcjty.lostcities.worldgen.lost.cityassets.RegistryAssetRegistry.get(RegistryAssetRegistry.java:67) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.lost.cityassets.RegistryAssetRegistry.get(RegistryAssetRegistry.java:37) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.DefaultDimensionInfo.<init>(DefaultDimensionInfo.java:44) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityFeature.getDimensionInfo(LostCityFeature.java:89) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.setup.ForgeEventHandlers.onCreateSpawnPoint(ForgeEventHandlers.java:134) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.setup.__ForgeEventHandlers_onCreateSpawnPoint_CreateSpawnPosition.invoke(.dynamic) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading,pl:eventbus:B}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2381!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2381!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2381!/:?] {}
	at net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(ForgeEventFactory.java:566) ~[forge-1.20.1-47.2.0-universal.jar%23160!/:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.m_177896_(MinecraftServer.java:392) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_129815_(MinecraftServer.java:346) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_130006_(MinecraftServer.java:308) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:63) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:833) ~[?:?] {}
Caused by: java.lang.NullPointerException: Cannot invoke "mcjty.lostcities.worldgen.lost.regassets.WorldStyleRE.getRegistryName()" because "object" is null
	at mcjty.lostcities.worldgen.lost.cityassets.WorldStyle.<init>(WorldStyle.java:34) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.lost.cityassets.RegistryAssetRegistry.get(RegistryAssetRegistry.java:65) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	... 16 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at mcjty.lostcities.worldgen.lost.cityassets.RegistryAssetRegistry.get(RegistryAssetRegistry.java:67) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.lost.cityassets.RegistryAssetRegistry.get(RegistryAssetRegistry.java:37) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.DefaultDimensionInfo.<init>(DefaultDimensionInfo.java:44) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityFeature.getDimensionInfo(LostCityFeature.java:89) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.setup.ForgeEventHandlers.onCreateSpawnPoint(ForgeEventHandlers.java:134) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading}
	at mcjty.lostcities.setup.__ForgeEventHandlers_onCreateSpawnPoint_CreateSpawnPosition.invoke(.dynamic) ~[lostcities-1.20-7.1.6.jar%23154!/:1.20-7.1.6] {re:classloading,pl:eventbus:B}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2381!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2381!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2381!/:?] {}
	at net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(ForgeEventFactory.java:566) ~[forge-1.20.1-47.2.0-universal.jar%23160!/:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.m_177896_(MinecraftServer.java:392) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
-- Affected level --
Details:
	All players: 0 total; []
	Chunk stats: 0
	Level dimension: minecraft:overworld
	Level spawn location: World: (0,0,0), Section: (at 0,0,0 in 0,0,0; chunk contains blocks 0,-64,0 to 15,319,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
	Level time: 0 game time, 0 day time
	Level name: Nouveau monde
	Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Known server brands: forge
	Removed feature flags: 
	Level was modded: true
	Level storage version: 0x04ABD - Anvil
Stacktrace:
	at net.minecraft.server.MinecraftServer.m_129815_(MinecraftServer.java:346) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_130006_(MinecraftServer.java:308) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:63) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23155!/:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:833) ~[?:?] {}


-- System Details --
Details:
	Minecraft Version: 1.20.1
	Minecraft Version ID: 1.20.1
	Operating System: Mac OS X (aarch64) version 14.2.1
	Java Version: 17.0.8, Microsoft
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
	Memory: 1005438656 bytes (958 MiB) / 1409286144 bytes (1344 MiB) up to 85899345920 bytes (81920 MiB)
	CPUs: 12
	Processor Vendor: Apple Inc.
	Processor Name: Apple M2 Max
	Identifier: Apple Inc. Family 0xda33d83d Model 0 Stepping 0
	Microarchitecture: ARM64 SoC: Avalanche + Blizzard
	Frequency (GHz): 3.70
	Number of physical packages: 1
	Number of physical CPUs: 12
	Number of logical CPUs: 12
	Graphics card #0 name: Apple M2 Max
	Graphics card #0 vendor: Apple (0x106b)
	Graphics card #0 VRAM (MB): 0.00
	Graphics card #0 deviceId: unknown
	Graphics card #0 versionInfo: unknown
	Memory slot #0 capacity (MB): 0.00
	Memory slot #0 clockSpeed (GHz): 0.00
	Memory slot #0 type: unknown
	Virtual memory max (MB): 98304.00
	Virtual memory used (MB): 58458.56
	Swap memory total (MB): 0.00
	Swap memory used (MB): 0.00
	JVM Flags: 7 total; -Xmx80G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	Server Running: true
	Player Count: 0 / 8; []
	Data Packs: vanilla, mod:lostcities, mod:forge
	Enabled Feature Flags: minecraft:vanilla
	World Generation: Experimental
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'forge'; Server brand changed to 'forge'
	Launched Version: 1.20.1-forge-47.2.0
	ModLauncher: 10.0.9+10.0.9+main.dcd20f30
	ModLauncher launch target: forgeclient
	ModLauncher naming: srg
	ModLauncher services: 
		mixin-0.8.5.jar mixin PLUGINSERVICE 
		eventbus-6.0.5.jar eventbus PLUGINSERVICE 
		fmlloader-1.20.1-47.2.0.jar slf4jfixer PLUGINSERVICE 
		fmlloader-1.20.1-47.2.0.jar object_holder_definalize PLUGINSERVICE 
		fmlloader-1.20.1-47.2.0.jar runtime_enum_extender PLUGINSERVICE 
		fmlloader-1.20.1-47.2.0.jar capability_token_subclass PLUGINSERVICE 
		accesstransformers-8.0.4.jar accesstransformer PLUGINSERVICE 
		fmlloader-1.20.1-47.2.0.jar runtimedistcleaner PLUGINSERVICE 
		modlauncher-10.0.9.jar mixin TRANSFORMATIONSERVICE 
		modlauncher-10.0.9.jar fml TRANSFORMATIONSERVICE 
	FML Language Providers: 
		[email protected]
		lowcodefml@null
		javafml@null
	Mod List: 
		client-1.20.1-20230612.114412-srg.jar             |Minecraft                     |minecraft                     |1.20.1              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		lostcities-1.20-7.1.6.jar                         |LostCities                    |lostcities                    |1.20-7.1.6          |DONE      |Manifest: NOSIGNATURE
		forge-1.20.1-47.2.0-universal.jar                 |Forge                         |forge                         |47.2.0              |DONE      |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90
	Crash Report UUID: 113c9d1d-5766-4353-8140-24d9d83bb2bc
	FML: 47.2
	Forge: net.minecraftforge:47.2.0
  • addon/pack.mcmeta

{
	"pack": {
		"description": "Test Asset resources",
		"pack_format": 9
	}
}
  • addon/META-INF/mods.toml

modLoader="lowcodefml"
loaderVersion="[40,)"
license="None"

[[mods]]
modId="addon"
version="1.0"
displayName="Addon Assets"
description="Addon for Lost Cities"

[[dependencies.addon]]
modId="lostcities"
mandatory=true
versionRange="[1.18-5.3.6,)"
ordering="AFTER"
side="BOTH"
  • addon/data/addon/lostcities/building/building1.json

{
	"filler": " ",
	"rubber": " ",
	"allowDoors": false,
	"allowFillers": false,
	"minfloors": 1,
	"maxfloors": 1,
	"maxcellars": 0,
	"parts": [
	{
		"top": false,
		"cellar": false,
		"ground": true,
		"part": "addon:building1_ground"
	},
	{
		"top": false,
		"cellar": false,
		"ground": false,
		"part": "addon:building1_floor"
	},
	{
		"top": true,
		"cellar": false,
		"ground": false,
		"part": "addon:building1_top"
	}
	]
}
  • addon/data/addon/lostcities/building/building1_ground.json

{
	"xsize": 16,
	"zsize": 16,
	"slices": [
		[
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                "
		]
	]
}
  • addon/data/addon/lostcities/building/building1_floor.json

{
	"xsize": 16,
	"zsize": 16,
	"slices": [
		[
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                "
		]
	]
}
  • addon/data/addon/lostcities/building/building1_top.json

{
	"xsize": 16,
	"zsize": 16,
	"slices": [
		[
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                ",
			"                "
		]
	]
}
  • addon/data/addon/lostcities/citystyles/citystyle1.json

{
	"inherit": "citystyle_config",
	"selectors": {
		"buildings": [
			{
				"factor": 0.025,
				"value": "addon:building1"
			}
		],
		"bridges": [
			{
				"factor": 1.0,
				"value": "bridge_open"
			},
			{
				"factor": 1.0,
				"value": "bridge_covered"
			}
		],
		"fronts": [
			{
				"factor": 1.0,
				"value": "building_front1"
			},
			{
				"factor": 1.0,
				"value": "building_front2"
			},
			{
				"factor": 1.0,
				"value": "building_front3"
			}
		],
		"stairs": [
			{
				"factor": 1.0,
				"value": "stairs1"
			},
			{
				"factor": 1.0,
				"value": "stairs2"
			},
			{
				"factor": 1.0,
				"value": "stairsnormal"
			},
			{
				"factor": 1.0,
				"value": "stairsbig"
			}
		],
		"fountains": [
			{
				"factor": 1.0,
				"value": "fountain1"
			}
		],
		"parks": [
			{
				"factor": 1.0,
				"value": "park_plants"
			}
		],
		"raildungeons": [
			{
				"factor": 1.0,
				"value": "rail_dungeon1"
			}
		]
	}
}
  • addon/data/addon/lostcities/worldstyles/worldstyle1.json

{
	"outsidestyle": "outside",
	"citystyles": [
		{
			"factor": 99999.0,
			"citystyle": "addon:citystyle1"
		}
	]
}
commented

Issue resolved. The problem was not with forge or lostcities. What I was doing was zipping my folder and not the CONTENTS of my folder.