Skip to content

Commit

Permalink
Fix capabilities baking multiple times, #177
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Aug 3, 2023
1 parent 721b3af commit b5fba9f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ protected <K, V> void onLoad(Map<Class<? extends K>, List<ICapabilityConstructor
@Nullable Map<? extends K, List<ICapabilityConstructor<?, ? extends K, ? extends V>>> allInstanceConstructors,
K keyObject, V valueObject, AttachCapabilitiesEvent<?> event, Class<? extends K> baseClass) {
boolean initialized = baked || MinecraftHelpers.isMinecraftInitialized();
if (!baked && MinecraftHelpers.isMinecraftInitialized()) {
bake();
synchronized (this) {
if (!baked && MinecraftHelpers.isMinecraftInitialized()) {
bake();
}
}

// Normal constructors
Expand Down

0 comments on commit b5fba9f

Please sign in to comment.