Skip to content

Commit

Permalink
Fix potentially copying empty set
Browse files Browse the repository at this point in the history
  • Loading branch information
ApexModder committed Sep 7, 2024
1 parent de4e095 commit b05e171
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@

private Properties() {
}
@@ -1020,6 +_,8 @@
@@ -1020,6 +_,12 @@
blockbehaviour$properties.offsetFunction = blockbehaviour$properties1.offsetFunction;
blockbehaviour$properties.spawnTerrainParticles = blockbehaviour$properties1.spawnTerrainParticles;
blockbehaviour$properties.requiredFeatures = blockbehaviour$properties1.requiredFeatures;
+ blockbehaviour$properties.requiredFlags = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>();
+ blockbehaviour$properties.requiredFlags.addAll(blockbehaviour$properties1.requiredFlags);
+
+ if(!blockbehaviour$properties1.requiredFlags.isEmpty()) {
+ blockbehaviour$properties.requiredFlags = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>();
+ blockbehaviour$properties.requiredFlags.addAll(blockbehaviour$properties1.requiredFlags);
+ }
+
blockbehaviour$properties.emissiveRendering = blockbehaviour$properties1.emissiveRendering;
blockbehaviour$properties.instrument = blockbehaviour$properties1.instrument;
blockbehaviour$properties.replaceable = blockbehaviour$properties1.replaceable;
Expand Down

0 comments on commit b05e171

Please sign in to comment.