Skip to content

Commit 8dc05b3

Browse files
SnaveSutitgitbutler-client
authored andcommitted
🐛 Fix data garbage collection deleting the data of unloaded entities
1 parent da2c9d0 commit 8dc05b3

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/systems/datapackCompiler/1.20.4/global.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ dir global {
228228
execute store result storage <%temp_storage%> args.id int 1 run scoreboard players get #aj.data_manager.index <%OBJECTIVES.I()%>
229229
block { with storage <%temp_storage%> args
230230
$data modify storage <%temp_storage%> args.uuid set from storage <%data_storage%> "$(id)".uuid
231+
scoreboard players set #success <%OBJECTIVES.I()%> 0
231232
block { with storage <%temp_storage%> args
232-
scoreboard players set #success <%OBJECTIVES.I()%> 0
233-
$execute store result score #success <%OBJECTIVES.I()%> if entity $(uuid)
233+
$execute store success score #success <%OBJECTIVES.I()%> if score $(uuid) matches 1..
234234
$execute if score #success <%OBJECTIVES.I()%> matches 0 run data remove storage <%data_storage%> "$(id)"
235235
}
236236
}

src/systems/datapackCompiler/1.21.0/global.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ dir global {
230230
execute store result storage <%temp_storage%> args.id int 1 run scoreboard players get #aj.data_manager.index <%OBJECTIVES.I()%>
231231
block { with storage <%temp_storage%> args
232232
$data modify storage <%temp_storage%> args.uuid set from storage <%data_storage%> "$(id)".uuid
233+
scoreboard players set #success <%OBJECTIVES.I()%> 0
233234
block { with storage <%temp_storage%> args
234-
scoreboard players set #success <%OBJECTIVES.I()%> 0
235-
$execute store result score #success <%OBJECTIVES.I()%> if entity $(uuid)
235+
$execute store success score #success <%OBJECTIVES.I()%> if score $(uuid) matches 1..
236236
$execute if score #success <%OBJECTIVES.I()%> matches 0 run data remove storage <%data_storage%> "$(id)"
237237
}
238238
}

src/systems/datapackCompiler/1.21.5/global.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ dir global {
231231
execute store result storage <%temp_storage%> args.id int 1 run scoreboard players get #aj.data_manager.index <%OBJECTIVES.I()%>
232232
block { with storage <%temp_storage%> args
233233
$data modify storage <%temp_storage%> args.uuid set from storage <%data_storage%> "$(id)".uuid
234+
scoreboard players set #success <%OBJECTIVES.I()%> 0
234235
block { with storage <%temp_storage%> args
235-
scoreboard players set #success <%OBJECTIVES.I()%> 0
236-
$execute store result score #success <%OBJECTIVES.I()%> if entity $(uuid)
236+
$execute store success score #success <%OBJECTIVES.I()%> if score $(uuid) matches 1..
237237
$execute if score #success <%OBJECTIVES.I()%> matches 0 run data remove storage <%data_storage%> "$(id)"
238238
}
239239
}

0 commit comments

Comments
 (0)