Skip to content

Commit

Permalink
Adjust supplier interface injection to be from a defaulted interface …
Browse files Browse the repository at this point in the history
…variant instead of base supplier
  • Loading branch information
Dragon-Seeker committed Jul 20, 2024
1 parent 5a04533 commit 81ca0a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.wispforest.owo.mixin.registry;

import io.wispforest.owo.util.pond.OwoInjectedSupplier;
import net.minecraft.registry.entry.RegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

import java.util.function.Supplier;

@Mixin(RegistryEntry.class)
public interface RegistryEntryMixin<T> extends Supplier<T> {
public interface RegistryEntryMixin<T> extends OwoInjectedSupplier<T> {

@Shadow T value();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.wispforest.owo.util.pond;

import java.util.function.Supplier;

public interface OwoInjectedSupplier<T> extends Supplier<T> {
default T get() {
throw new IllegalStateException("Injected Supplier interface has yet to be override!");
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"io/wispforest/owo/serialization/OwoComponentTypeBuilder<TT;>"
],
"net/minecraft/class_6880": [
"java/util/function/Supplier<TT;>"
"java/util/function/OwoInjectedSupplier<TT;>"
]
}
}
Expand Down

0 comments on commit 81ca0a9

Please sign in to comment.