-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No more syncing and now properly trigger clinit on startup
- Loading branch information
Showing
5 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
src/main/java/dev/enjarai/trickster/spell/mana/ManaPoolType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
package dev.enjarai.trickster.spell.mana; | ||
|
||
import com.mojang.serialization.Lifecycle; | ||
import dev.enjarai.trickster.Trickster; | ||
import io.wispforest.endec.StructEndec; | ||
import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder; | ||
import net.fabricmc.fabric.api.event.registry.RegistryAttribute; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.SimpleRegistry; | ||
|
||
public record ManaPoolType<T extends ManaPool>(StructEndec<T> endec) { | ||
public static final RegistryKey<Registry<ManaPoolType<?>>> REGISTRY_KEY = RegistryKey.ofRegistry(Trickster.id("mana_pool_type")); | ||
public static final Registry<ManaPoolType<?>> REGISTRY = FabricRegistryBuilder.createSimple(REGISTRY_KEY).attribute(RegistryAttribute.SYNCED).buildAndRegister(); | ||
public static final Registry<ManaPoolType<?>> REGISTRY = FabricRegistryBuilder.createSimple(REGISTRY_KEY).buildAndRegister(); | ||
|
||
public static final ManaPoolType<SimpleManaPool> SIMPLE = register("simple", SimpleManaPool.ENDEC); | ||
|
||
private static <T extends ManaPool> ManaPoolType<T> register(String name, StructEndec<T> endec) { | ||
return Registry.register(REGISTRY, Trickster.id(name), new ManaPoolType<>(endec)); | ||
} | ||
|
||
public static void register() { | ||
// init the class :brombeere: | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters