Skip to content

Commit

Permalink
Merge pull request #35 from way-zer/3.0
Browse files Browse the repository at this point in the history
ContentsPatch 后向兼容
  • Loading branch information
way-zer authored Nov 24, 2023
2 parents 3190e19 + 508bd94 commit 06f000a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/kotlin/cf/wayzer/contentsTweaker/ModMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class ModMain : Mod() {
Events.on(WorldLoadBeginEvent::class.java) {
if (ContentsTweaker.worldInReset) return@on
Call.serverPacketReliable("ContentsLoader|version", Vars.mods.getMod(javaClass).meta.version)
Vars.state.map.tags.get("ContentsPatch")?.split(";")?.forEach { name ->
val list = Vars.state.map.tags.get("ContentsPatch")?.split(";")
?: Vars.state.rules.tags.get("ContentsPatch")?.split(";")
?: return@on
list.forEach { name ->
if (name.isBlank()) return@forEach
val patch = Vars.state.map.tags.get("CT@$name")
?: return@forEach Call.serverPacketReliable("ContentsLoader|requestPatch", name)
Expand Down

0 comments on commit 06f000a

Please sign in to comment.