Skip to content

Commit 5695855

Browse files
committed
Add DeferredHolderCommon#getHolder
1 parent 23047cf commit 5695855

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

loader-common/src/main/java/org/cyclops/cyclopscore/config/DeferredHolderCommon.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,15 @@ public ResourceKey<R> getKey() {
175175
return this.key;
176176
}
177177

178+
// TODO: Added as workaround for not implementing Holder directly. Not sure yet if we want this permanently.
179+
public Holder<R> getHolder() {
180+
bind(true);
181+
if (holder == null) {
182+
throw new IllegalStateException("Trying to access unbound holder: " + this.key);
183+
}
184+
return holder;
185+
}
186+
178187
@Override
179188
public boolean equals(Object obj) {
180189
if (this == obj) return true;

0 commit comments

Comments
 (0)