diff --git a/Common/src/main/java/at/petrak/hexcasting/api/advancements/HexAdvancementTriggers.java b/Common/src/main/java/at/petrak/hexcasting/api/advancements/HexAdvancementTriggers.java index b8d6f37715..e2f5867cdc 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/advancements/HexAdvancementTriggers.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/advancements/HexAdvancementTriggers.java @@ -1,26 +1,20 @@ package at.petrak.hexcasting.api.advancements; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.advancements.CriterionTrigger; import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceLocation; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - public class HexAdvancementTriggers { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.TRIGGER_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.TRIGGER_TYPE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier OVERCAST_TRIGGER = REGISTER.register("overcast", OvercastTrigger::new); - public static final Supplier SPEND_MEDIA_TRIGGER = REGISTER.register("spend_media", SpendMediaTrigger::new); - public static final Supplier FAIL_GREAT_SPELL_TRIGGER = REGISTER.register("fail_to_cast_great_spell", FailToCastGreatSpellTrigger::new); + public static final Supplier OVERCAST_TRIGGER = REGISTRAR.register("overcast", OvercastTrigger::new); + public static final Supplier SPEND_MEDIA_TRIGGER = REGISTRAR.register("spend_media", SpendMediaTrigger::new); + public static final Supplier FAIL_GREAT_SPELL_TRIGGER = REGISTRAR.register("fail_to_cast_great_spell", FailToCastGreatSpellTrigger::new); } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/IotaType.java b/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/IotaType.java index a1a1c12160..6baec8ace1 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/IotaType.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/IotaType.java @@ -28,7 +28,7 @@ public abstract class IotaType { /** * Get a {@link StreamCodec} associated with this datum. - * Is used for Client <-> Server communication. + * Is used for communication between Client and Server. *

* It can be used with {@code TYPED_STREAM_CODEC} to deserde said datum with {@link RegistryFriendlyByteBuf} * @return {@link StreamCodec} of {@link IotaType} diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapEntityNotFound.kt b/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapEntityNotFound.kt index 43e6781370..46b450a3bf 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapEntityNotFound.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapEntityNotFound.kt @@ -12,7 +12,7 @@ import net.minecraft.world.item.DyeColor import java.util.* class MishapEntityNotFound(val entityId: UUID, val entityName: Component?) : Mishap() { - override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment = + override fun accentColor(env: CastingEnvironment, errorCtx: Context): FrozenPigment = dyeColor(DyeColor.BROWN) override fun execute(env: CastingEnvironment, errorCtx: Context, stack: TreeList): TreeList { @@ -20,7 +20,7 @@ class MishapEntityNotFound(val entityId: UUID, val entityName: Component?) : Mis return stack } - override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context) = + override fun errorMessage(env: CastingEnvironment, errorCtx: Context) = error("entity_not_found", (entityName?.plainCopy() ?: Component.literal(entityId.toString())).aqua) companion object { diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapInternalException.kt b/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapInternalException.kt index 05d52982da..322c12882b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapInternalException.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapInternalException.kt @@ -21,7 +21,7 @@ class MishapInternalException(val exception: Exception) : Mishap() { return stack } - override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context): Component { + override fun errorMessage(env: CastingEnvironment, errorCtx: Context): Component { var message = Component.literal("$exception") // dump stack trace diff --git a/Common/src/main/java/at/petrak/hexcasting/common/entities/HexEntities.java b/Common/src/main/java/at/petrak/hexcasting/common/entities/HexEntities.java index 055755b7ab..bfe451bf76 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/entities/HexEntities.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/entities/HexEntities.java @@ -2,28 +2,21 @@ import at.petrak.hexcasting.api.HexAPI; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - public class HexEntities { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.ENTITY_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.ENTITY_TYPE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier> WALL_SCROLL = REGISTER.register("wall_scroll", () -> + public static final Supplier> WALL_SCROLL = REGISTRAR.register("wall_scroll", () -> EntityType.Builder.of(EntityWallScroll::new, MobCategory.MISC) .sized(0.5f, 0.5f).clientTrackingRange(10).updateInterval(Integer.MAX_VALUE) .build(HexAPI.MOD_ID + ":wall_scroll")); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexAttributes.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexAttributes.java index 707ec6544c..3dbbfecca7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexAttributes.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexAttributes.java @@ -2,7 +2,7 @@ import at.petrak.hexcasting.api.casting.eval.env.PlayerBasedCastEnv; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.world.entity.ai.attributes.Attribute; @@ -11,33 +11,33 @@ import static at.petrak.hexcasting.api.HexAPI.MOD_ID; public class HexAttributes { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE - .createRegistar(Registries.ATTRIBUTE); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE + .createRegistrar(Registries.ATTRIBUTE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Holder GRID_ZOOM = REGISTER.registerHolder("grid_zoom", () -> new RangedAttribute( + public static final Holder GRID_ZOOM = REGISTRAR.registerHolder("grid_zoom", () -> new RangedAttribute( MOD_ID + ".attributes.grid_zoom", 1.0, 0.5, 4.0).setSyncable(true)); /** * Whether you have the lens overlay when looking at something. 0 = no, > 0 = yes. */ - public static final Holder SCRY_SIGHT = REGISTER.registerHolder("scry_sight", () -> new RangedAttribute( + public static final Holder SCRY_SIGHT = REGISTRAR.registerHolder("scry_sight", () -> new RangedAttribute( MOD_ID + ".attributes.scry_sight", 0.0, 0.0, 1.0).setSyncable(true)); //whether the player is allowed to use staffcasting and scrying lenses - public static final Holder FEEBLE_MIND = REGISTER.registerHolder("feeble_mind", () -> new RangedAttribute( + public static final Holder FEEBLE_MIND = REGISTRAR.registerHolder("feeble_mind", () -> new RangedAttribute( MOD_ID + ".attributes.feeble_mind", 0.0, 0.0, 1.0).setSyncable(true)); //a multiplier to adjust media consumption across the board - public static final Holder MEDIA_CONSUMPTION_MODIFIER = REGISTER.registerHolder("media_consumption", () -> new RangedAttribute( + public static final Holder MEDIA_CONSUMPTION_MODIFIER = REGISTRAR.registerHolder("media_consumption", () -> new RangedAttribute( MOD_ID + ".attributes.media_consumption", 1.0, 0.0, Double.MAX_VALUE).setSyncable(true)); - public static final Holder AMBIT_RADIUS = REGISTER.registerHolder("ambit_radius", () -> new RangedAttribute( + public static final Holder AMBIT_RADIUS = REGISTRAR.registerHolder("ambit_radius", () -> new RangedAttribute( MOD_ID + ".attributes.ambit_radius", PlayerBasedCastEnv.DEFAULT_AMBIT_RADIUS, 0.0, Double.MAX_VALUE).setSyncable(true)); - public static final Holder SENTINEL_RADIUS = REGISTER.registerHolder("sentinel_radius", () -> new RangedAttribute( + public static final Holder SENTINEL_RADIUS = REGISTRAR.registerHolder("sentinel_radius", () -> new RangedAttribute( MOD_ID + ".attributes.sentinel_radius", PlayerBasedCastEnv.DEFAULT_SENTINEL_RADIUS, 0.0, Double.MAX_VALUE).setSyncable(true)); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlockEntities.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlockEntities.java index 988af09b34..de6776a915 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlockEntities.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlockEntities.java @@ -9,62 +9,62 @@ import at.petrak.hexcasting.common.blocks.entity.BlockEntityConjured; import at.petrak.hexcasting.common.blocks.entity.BlockEntityQuenchedAllay; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.registries.Registries; import net.minecraft.world.level.block.entity.BlockEntityType; import java.util.function.Supplier; public class HexBlockEntities { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.BLOCK_ENTITY_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.BLOCK_ENTITY_TYPE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier> CONJURED_TILE = REGISTER.register("conjured", () -> + public static final Supplier> CONJURED_TILE = REGISTRAR.register("conjured", () -> IXplatAbstractions.INSTANCE.createBlockEntityType(BlockEntityConjured::new, HexBlocks.CONJURED_LIGHT.get(), HexBlocks.CONJURED_BLOCK.get())); - public static final Supplier> AKASHIC_BOOKSHELF_TILE = REGISTER.register( + public static final Supplier> AKASHIC_BOOKSHELF_TILE = REGISTRAR.register( "akashic_bookshelf", () -> IXplatAbstractions.INSTANCE.createBlockEntityType(BlockEntityAkashicBookshelf::new, HexBlocks.AKASHIC_BOOKSHELF.get())); - public static final Supplier> IMPETUS_REDSTONE_TILE = REGISTER.register( + public static final Supplier> IMPETUS_REDSTONE_TILE = REGISTRAR.register( "impetus/redstone", () -> IXplatAbstractions.INSTANCE.createBlockEntityType(BlockEntityRedstoneImpetus::new, HexBlocks.IMPETUS_REDSTONE.get())); - public static final Supplier> IMPETUS_LOOK_TILE = REGISTER.register( + public static final Supplier> IMPETUS_LOOK_TILE = REGISTRAR.register( "impetus/look", () -> IXplatAbstractions.INSTANCE.createBlockEntityType(BlockEntityLookingImpetus::new, HexBlocks.IMPETUS_LOOK.get())); - public static final Supplier> IMPETUS_RIGHTCLICK_TILE = REGISTER.register( + public static final Supplier> IMPETUS_RIGHTCLICK_TILE = REGISTRAR.register( "impetus/rightclick", () -> IXplatAbstractions.INSTANCE.createBlockEntityType(BlockEntityRightClickImpetus::new, HexBlocks.IMPETUS_RIGHTCLICK.get())); - public static final Supplier> SLATE_TILE = REGISTER.register( + public static final Supplier> SLATE_TILE = REGISTRAR.register( "slate", () -> IXplatAbstractions.INSTANCE.createBlockEntityType(BlockEntitySlate::new, HexBlocks.SLATE.get())); - public static final Supplier> QUENCHED_ALLAY_TILE = REGISTER.register( + public static final Supplier> QUENCHED_ALLAY_TILE = REGISTRAR.register( "quenched_allay", () -> IXplatAbstractions.INSTANCE.createBlockEntityType( BlockEntityQuenchedAllay.fromKnownBlock(HexBlocks.QUENCHED_ALLAY.get()), HexBlocks.QUENCHED_ALLAY.get())); - public static final Supplier> QUENCHED_ALLAY_TILES_TILE = REGISTER.register( + public static final Supplier> QUENCHED_ALLAY_TILES_TILE = REGISTRAR.register( "quenched_allay_tiles", () -> IXplatAbstractions.INSTANCE.createBlockEntityType( BlockEntityQuenchedAllay.fromKnownBlock(HexBlocks.QUENCHED_ALLAY_TILES.get()), HexBlocks.QUENCHED_ALLAY_TILES.get())); - public static final Supplier> QUENCHED_ALLAY_BRICKS_TILE = REGISTER.register( + public static final Supplier> QUENCHED_ALLAY_BRICKS_TILE = REGISTRAR.register( "quenched_allay_bricks", () -> IXplatAbstractions.INSTANCE.createBlockEntityType( BlockEntityQuenchedAllay.fromKnownBlock(HexBlocks.QUENCHED_ALLAY_BRICKS.get()), HexBlocks.QUENCHED_ALLAY_BRICKS.get())); - public static final Supplier> QUENCHED_ALLAY_BRICKS_SMALL_TILE = REGISTER.register( + public static final Supplier> QUENCHED_ALLAY_BRICKS_SMALL_TILE = REGISTRAR.register( "quenched_allay_bricks_small", () -> IXplatAbstractions.INSTANCE.createBlockEntityType( BlockEntityQuenchedAllay.fromKnownBlock(HexBlocks.QUENCHED_ALLAY_BRICKS_SMALL.get()), HexBlocks.QUENCHED_ALLAY_BRICKS_SMALL.get())); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java index 4f9fd2f54e..edfbfb95a7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java @@ -18,7 +18,7 @@ import at.petrak.hexcasting.common.blocks.circles.impetuses.BlockRightClickImpetus; import at.petrak.hexcasting.common.blocks.decoration.*; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; import net.minecraft.util.ColorRGBA; @@ -40,13 +40,13 @@ import java.util.function.Supplier; public class HexBlocks { - private static final IXplatRegister REGISTER_BLOCKS = IXplatAbstractions.INSTANCE.createRegistar(Registries.BLOCK); - private static final IXplatRegister REGISTER_BLOCK_ITEMS = IXplatAbstractions.INSTANCE.createRegistar(Registries.ITEM); + private static final IXplatRegistrar REGISTRAR_BLOCKS = IXplatAbstractions.INSTANCE.createRegistrar(Registries.BLOCK); + private static final IXplatRegistrar REGISTRAR_BLOCK_ITEMS = IXplatAbstractions.INSTANCE.createRegistrar(Registries.ITEM); private static final Map, List>> BLOCK_TABS = new LinkedHashMap<>(); public static void register() { - REGISTER_BLOCKS.registerAll(); - REGISTER_BLOCK_ITEMS.registerAll(); + REGISTRAR_BLOCKS.registerAll(); + REGISTRAR_BLOCK_ITEMS.registerAll(); } public static void registerBlocksForCreativeTab(ResourceKey tabKey, CreativeModeTab.Output r) { @@ -291,7 +291,7 @@ private static boolean never(Object... args) { } private static Supplier blockNoItem(String name, Supplier blockSupplier) { - return REGISTER_BLOCKS.register(name, blockSupplier); + return REGISTRAR_BLOCKS.register(name, blockSupplier); } private static Supplier blockItem(String name, Supplier blockSupplier) { return blockItem(name, blockSupplier, HexItems.props(), HexCreativeTabs.HEX_KEY); @@ -306,7 +306,7 @@ private static Supplier blockItem(String name, Supplier private static Supplier blockItem(String name, Supplier blockSupplier, Item.Properties props, @Nullable ResourceKey tabKey) { Supplier supplier = blockNoItem(name, blockSupplier); - REGISTER_BLOCK_ITEMS.register(name, () -> new BlockItem(supplier.get(), props)); + REGISTRAR_BLOCK_ITEMS.register(name, () -> new BlockItem(supplier.get(), props)); if (tabKey != null) { BLOCK_TABS.computeIfAbsent(tabKey, t -> new ArrayList<>()).add(supplier::get); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBrainsweepeeIngredients.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBrainsweepeeIngredients.java index d5cc9ede3c..843cf03f98 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBrainsweepeeIngredients.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBrainsweepeeIngredients.java @@ -2,7 +2,7 @@ import at.petrak.hexcasting.common.recipe.ingredient.brainsweep.*; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; @@ -22,10 +22,10 @@ import java.util.function.Supplier; public class HexBrainsweepeeIngredients { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.BRAINSWEEPEE_INGREDIENT); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.BRAINSWEEPEE_INGREDIENT); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } public static final Codec TYPED_CODEC = Codec.lazyInitialized(() -> IXplatAbstractions.INSTANCE @@ -36,11 +36,11 @@ public static void register() { .registry(HexRegistries.BRAINSWEEPEE_INGREDIENT) .dispatch(BrainsweepeeIngredient::getType, BrainsweepeeIngredientType::streamCodec); - public static final Supplier> ENTITY_TYPE = REGISTER.register("entity_type", EntityTypeIngredient.Type::new); - public static final Supplier> TAG = REGISTER.register("entity_tag", EntityTagIngredient.Type::new); - public static final Supplier> VILLAGER = REGISTER.register("villager", VillagerIngredient.Type::new); + public static final Supplier> ENTITY_TYPE = REGISTRAR.register("entity_type", EntityTypeIngredient.Type::new); + public static final Supplier> TAG = REGISTRAR.register("entity_tag", EntityTagIngredient.Type::new); + public static final Supplier> VILLAGER = REGISTRAR.register("villager", VillagerIngredient.Type::new); - public static final Supplier> NONE_TYPE = REGISTER.register("none", () -> new BrainsweepeeIngredientType<>() { + public static final Supplier> NONE_TYPE = REGISTRAR.register("none", () -> new BrainsweepeeIngredientType<>() { @Override public MapCodec codec() { return MapCodec.unit(NONE); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexCreativeTabs.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexCreativeTabs.java index 007374ec81..bec8ae4918 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexCreativeTabs.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexCreativeTabs.java @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.lib; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; @@ -13,13 +13,13 @@ import static at.petrak.hexcasting.api.HexAPI.modLoc; public class HexCreativeTabs { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.CREATIVE_MODE_TAB); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.CREATIVE_MODE_TAB); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Holder HEX = REGISTER.registerHolder("hexcasting", () -> + public static final Holder HEX = REGISTRAR.registerHolder("hexcasting", () -> CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) .icon(() -> new ItemStack(HexItems.SPELLBOOK.get())) .title(Component.translatable("itemGroup.hexcasting.hexcasting")) @@ -27,7 +27,7 @@ public static void register() { public static final ResourceKey HEX_KEY = ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), modLoc("hexcasting")); - public static final Holder SCROLLS = REGISTER.registerHolder("scrolls", () -> + public static final Holder SCROLLS = REGISTRAR.registerHolder("scrolls", () -> CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) .icon(() -> new ItemStack(HexItems.SCROLL_LARGE.get())) .title(Component.translatable("itemGroup.hexcasting.scrolls")) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java index 133430cae2..8cd92eb847 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.casting.math.HexPattern; import at.petrak.hexcasting.api.pigment.FrozenPigment; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import com.mojang.serialization.Codec; import net.minecraft.core.component.DataComponentType; import net.minecraft.core.registries.Registries; @@ -21,37 +21,37 @@ import java.util.function.Supplier; public class HexDataComponents { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.DATA_COMPONENT_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.DATA_COMPONENT_TYPE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } // ==== SCROLLS ==== - public static final Supplier> PATTERN = REGISTER.register("pattern", () -> + public static final Supplier> PATTERN = REGISTRAR.register("pattern", () -> DataComponentType.builder() .persistent(HexPattern.CODEC) .networkSynchronized(HexPattern.STREAM_CODEC) .build()); - public static final Supplier>> ACTION = REGISTER.register("op_id", () -> + public static final Supplier>> ACTION = REGISTRAR.register("op_id", () -> DataComponentType.>builder() .persistent(ResourceKey.codec(HexRegistries.ACTION)) .networkSynchronized(ResourceKey.streamCodec(HexRegistries.ACTION)) .build()); - public static final Supplier>> RECALC_WARNING = REGISTER.register("recalc_warning", () -> + public static final Supplier>> RECALC_WARNING = REGISTRAR.register("recalc_warning", () -> DataComponentType.>builder() .persistent(ResourceKey.codec(HexRegistries.ACTION)) .networkSynchronized(ResourceKey.streamCodec(HexRegistries.ACTION)) .build()); - public static final Supplier> NEEDS_PURCHASE = REGISTER.register("needs_purchase", () -> + public static final Supplier> NEEDS_PURCHASE = REGISTRAR.register("needs_purchase", () -> DataComponentType.builder() .networkSynchronized(StreamCodec.unit(Unit.INSTANCE)) .build()); // ==== ANYTHING WITH TEXTURE VARIANTS ==== - public static final Supplier> ITEM_VARIANT = REGISTER.register("variant", () -> + public static final Supplier> ITEM_VARIANT = REGISTRAR.register("variant", () -> DataComponentType.builder() .persistent(Codec.intRange(0, Integer.MAX_VALUE)) .networkSynchronized(ByteBufCodecs.VAR_INT) @@ -59,12 +59,12 @@ public static void register() { // ==== IOTA HOLDERS ==== - public static final Supplier> SEALED_IOTA_HOLDER = REGISTER.register("sealed", () -> + public static final Supplier> SEALED_IOTA_HOLDER = REGISTRAR.register("sealed", () -> DataComponentType.builder() .persistent(Codec.unit(Unit.INSTANCE)) .networkSynchronized(StreamCodec.unit(Unit.INSTANCE)) .build()); - public static final Supplier> IOTA_HOLDER_IOTA = REGISTER.register("iota", () -> + public static final Supplier> IOTA_HOLDER_IOTA = REGISTRAR.register("iota", () -> DataComponentType.builder() .persistent(IotaType.TYPED_CODEC) .networkSynchronized(IotaType.TYPED_STREAM_CODEC) @@ -75,19 +75,19 @@ public static void register() { *

* This is not useful to the player at all. */ - public static final Supplier>>> VISUAL_OVERRIDE = REGISTER.register("visual_override", () -> + public static final Supplier>>> VISUAL_OVERRIDE = REGISTRAR.register("visual_override", () -> DataComponentType.>>builder() .networkSynchronized(ByteBufCodecs.optional(ByteBufCodecs.registry(HexRegistries.IOTA_TYPE))) .build()); // ==== MEDIA HOLDERS ==== - public static final Supplier> MEDIA = REGISTER.register("media", () -> + public static final Supplier> MEDIA = REGISTRAR.register("media", () -> DataComponentType.builder() .persistent(Codec.LONG) .networkSynchronized(ByteBufCodecs.VAR_LONG) .build()); - public static final Supplier> MEDIA_MAX = REGISTER.register("start_media", () -> + public static final Supplier> MEDIA_MAX = REGISTRAR.register("start_media", () -> DataComponentType.builder() .persistent(Codec.LONG) .networkSynchronized(ByteBufCodecs.VAR_LONG) @@ -95,12 +95,12 @@ public static void register() { // ==== CASTING ITEMS ==== - public static final Supplier>> HEX_HOLDER_PATTERNS = REGISTER.register("patterns", () -> + public static final Supplier>> HEX_HOLDER_PATTERNS = REGISTRAR.register("patterns", () -> DataComponentType.>builder() .persistent(IotaType.TYPED_CODEC.listOf()) .networkSynchronized(IotaType.TYPED_STREAM_CODEC.apply(ByteBufCodecs.list())) .build()); - public static final Supplier> PIGMENT = REGISTER.register("pigment", () -> + public static final Supplier> PIGMENT = REGISTRAR.register("pigment", () -> DataComponentType.builder() .persistent(FrozenPigment.CODEC) .networkSynchronized(FrozenPigment.STREAM_CODEC) @@ -108,7 +108,7 @@ public static void register() { // ==== ANCIENT CYPHERS ==== - public static final Supplier> HEX_NAME = REGISTER.register("hex_name", () -> + public static final Supplier> HEX_NAME = REGISTRAR.register("hex_name", () -> DataComponentType.builder() .persistent(Codec.STRING) .networkSynchronized(ByteBufCodecs.STRING_UTF8) @@ -116,7 +116,7 @@ public static void register() { // ==== ABACUS ==== - public static final Supplier> ABACUS_VALUE = REGISTER.register("abacus_value", () -> + public static final Supplier> ABACUS_VALUE = REGISTRAR.register("abacus_value", () -> DataComponentType.builder() .persistent(Codec.DOUBLE) .networkSynchronized(ByteBufCodecs.DOUBLE) @@ -130,12 +130,12 @@ public static void register() { * Applying this component will enable shift-scrolling, though it won't do much without the other * components and a way to read/write the iota. */ - public static final Supplier> SELECTED_SPELLBOOK_PAGE = REGISTER.register("page_idx", () -> + public static final Supplier> SELECTED_SPELLBOOK_PAGE = REGISTRAR.register("page_idx", () -> DataComponentType.builder() .persistent(Codec.INT) .networkSynchronized(ByteBufCodecs.INT) .build()); - public static final Supplier>> SPELLBOOK_PAGES = REGISTER.register("pages", () -> + public static final Supplier>> SPELLBOOK_PAGES = REGISTRAR.register("pages", () -> DataComponentType.>builder() .persistent(Codec.unboundedMap(Codec.STRING, IotaType.TYPED_CODEC)) .networkSynchronized(ByteBufCodecs.map( @@ -144,7 +144,7 @@ public static void register() { IotaType.TYPED_STREAM_CODEC )) .build()); - public static final Supplier>> SPELLBOOK_PAGE_NAMES = REGISTER.register("page_names", () -> + public static final Supplier>> SPELLBOOK_PAGE_NAMES = REGISTRAR.register("page_names", () -> DataComponentType.>builder() .persistent(Codec.unboundedMap(Codec.STRING, ComponentSerialization.CODEC)) .networkSynchronized(ByteBufCodecs.map( @@ -153,7 +153,7 @@ public static void register() { ComponentSerialization.STREAM_CODEC )) .build()); - public static final Supplier>> SPELLBOOK_PAGE_SEALS = REGISTER.register("sealed_pages", () -> + public static final Supplier>> SPELLBOOK_PAGE_SEALS = REGISTRAR.register("sealed_pages", () -> DataComponentType.>builder() .persistent(Codec.unboundedMap(Codec.STRING, Codec.BOOL)) .networkSynchronized(ByteBufCodecs.map( @@ -165,12 +165,12 @@ public static void register() { // ==== MEDIA CUBE ==== - public static final Supplier>> MEDIA_EXTRACTIONS = REGISTER.register("media_extractions", () -> + public static final Supplier>> MEDIA_EXTRACTIONS = REGISTRAR.register("media_extractions", () -> DataComponentType.>builder() .persistent(Codec.LONG.listOf()) .networkSynchronized(ByteBufCodecs.VAR_LONG.apply(ByteBufCodecs.list())) .build()); - public static final Supplier>> MEDIA_INSERTIONS = REGISTER.register("media_insertions", () -> + public static final Supplier>> MEDIA_INSERTIONS = REGISTRAR.register("media_insertions", () -> DataComponentType.>builder() .persistent(Codec.LONG.listOf()) .networkSynchronized(ByteBufCodecs.VAR_LONG.apply(ByteBufCodecs.list())) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java index e54537b9c7..50208a4cc4 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java @@ -12,7 +12,7 @@ import at.petrak.hexcasting.common.items.pigment.*; import at.petrak.hexcasting.common.items.storage.*; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import com.google.common.base.Suppliers; import net.minecraft.Util; import net.minecraft.core.Registry; @@ -34,10 +34,10 @@ // https://github.com/VazkiiMods/Botania/blob/2c4f7fdf9ebf0c0afa1406dfe1322841133d75fa/Common/src/main/java/vazkii/botania/common/item/ModItems.java public class HexItems { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.ITEM); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.ITEM); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } public static void registerItemsForCreativeTab(ResourceKey tabKey, CreativeModeTab.Output r) { @@ -191,7 +191,7 @@ private static void generateScrollEntries(CreativeModeTab.Output r) { } private static Supplier make(String id, Supplier itemSupplier, @Nullable ResourceKey tabKey) { - Supplier supplier = REGISTER.register(id, itemSupplier); + Supplier supplier = REGISTRAR.register(id, itemSupplier); if (tabKey != null) { ITEM_TABS.computeIfAbsent(tabKey, t -> new ArrayList<>()).add(new TabEntry.ItemEntry(supplier::get)); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexLootFunctions.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexLootFunctions.java index be1e5d6ed4..d302965f68 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexLootFunctions.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexLootFunctions.java @@ -4,7 +4,7 @@ import at.petrak.hexcasting.common.loot.AddPerWorldPatternToScrollFunc; import at.petrak.hexcasting.common.loot.AmethystReducerFunc; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.registries.Registries; import net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction; import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; @@ -12,16 +12,16 @@ import java.util.function.Supplier; public class HexLootFunctions { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.LOOT_FUNCTION_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.LOOT_FUNCTION_TYPE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier> PATTERN_SCROLL = REGISTER.register("pattern_scroll", + public static final Supplier> PATTERN_SCROLL = REGISTRAR.register("pattern_scroll", () -> new LootItemFunctionType<>(AddPerWorldPatternToScrollFunc.CODEC)); - public static final Supplier> HEX_CYPHER = REGISTER.register("hex_cypher", + public static final Supplier> HEX_CYPHER = REGISTRAR.register("hex_cypher", () -> new LootItemFunctionType<>(AddHexToAncientCypherFunc.CODEC)); - public static final Supplier> AMETHYST_SHARD_REDUCER = REGISTER.register("amethyst_shard_reducer", + public static final Supplier> AMETHYST_SHARD_REDUCER = REGISTRAR.register("amethyst_shard_reducer", () -> new LootItemFunctionType<>(AmethystReducerFunc.CODEC)); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexMobEffects.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexMobEffects.java index 9f03197eaf..273169fd0b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexMobEffects.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexMobEffects.java @@ -3,7 +3,7 @@ import at.petrak.hexcasting.api.HexAPI; import at.petrak.hexcasting.common.misc.HexMobEffect; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.world.effect.MobEffect; @@ -12,17 +12,17 @@ public class HexMobEffects { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE - .createRegistar(Registries.MOB_EFFECT); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE + .createRegistrar(Registries.MOB_EFFECT); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Holder ENLARGE_GRID = REGISTER.registerHolder("enlarge_grid", + public static final Holder ENLARGE_GRID = REGISTRAR.registerHolder("enlarge_grid", () -> new HexMobEffect(MobEffectCategory.BENEFICIAL, 0xc875ff).addAttributeModifier(HexAttributes.GRID_ZOOM, HexAPI.modLoc("enlarge_grid"), 0.25, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)); - public static final Holder SHRINK_GRID = REGISTER.registerHolder("shrink_grid", + public static final Holder SHRINK_GRID = REGISTRAR.registerHolder("shrink_grid", () -> new HexMobEffect(MobEffectCategory.HARMFUL, 0xc0e660).addAttributeModifier(HexAttributes.GRID_ZOOM, HexAPI.modLoc("shrink_grid"), -0.2, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexParticles.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexParticles.java index d5428d8b91..f320bff27b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexParticles.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexParticles.java @@ -3,7 +3,7 @@ import at.petrak.hexcasting.client.particles.ConjureParticle; import at.petrak.hexcasting.common.particles.ConjureParticleOptions; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.client.particle.ParticleProvider; import net.minecraft.client.particle.SpriteSet; import net.minecraft.core.particles.ParticleOptions; @@ -14,13 +14,13 @@ import java.util.function.Supplier; public class HexParticles { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.PARTICLE_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.PARTICLE_TYPE); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier CONJURE_PARTICLE = REGISTER.register( + public static final Supplier CONJURE_PARTICLE = REGISTRAR.register( "conjure_particle", () -> new ConjureParticleOptions.Type(false)); public static class FactoryHandler { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexPotions.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexPotions.java index 10bbe7f552..b1f937bc59 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexPotions.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexPotions.java @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.lib; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.world.effect.MobEffectInstance; @@ -11,24 +11,24 @@ import net.minecraft.world.item.alchemy.Potions; public class HexPotions { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.POTION); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.POTION); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Holder ENLARGE_GRID = REGISTER.registerHolder("enlarge_grid", () -> + public static final Holder ENLARGE_GRID = REGISTRAR.registerHolder("enlarge_grid", () -> new Potion("enlarge_grid", new MobEffectInstance(HexMobEffects.ENLARGE_GRID, 3600))); - public static final Holder ENLARGE_GRID_LONG = REGISTER.registerHolder("enlarge_grid_long", () -> + public static final Holder ENLARGE_GRID_LONG = REGISTRAR.registerHolder("enlarge_grid_long", () -> new Potion("enlarge_grid_long", new MobEffectInstance(HexMobEffects.ENLARGE_GRID, 9600))); - public static final Holder ENLARGE_GRID_STRONG = REGISTER.registerHolder("enlarge_grid_strong", () -> + public static final Holder ENLARGE_GRID_STRONG = REGISTRAR.registerHolder("enlarge_grid_strong", () -> new Potion("enlarge_grid_strong", new MobEffectInstance(HexMobEffects.ENLARGE_GRID, 1800, 1))); - public static final Holder SHRINK_GRID = REGISTER.registerHolder("shrink_grid", () -> + public static final Holder SHRINK_GRID = REGISTRAR.registerHolder("shrink_grid", () -> new Potion("shrink_grid", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 3600))); - public static final Holder SHRINK_GRID_LONG = REGISTER.registerHolder("shrink_grid_long", () -> + public static final Holder SHRINK_GRID_LONG = REGISTRAR.registerHolder("shrink_grid_long", () -> new Potion("shrink_grid_long", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 9600))); - public static final Holder SHRINK_GRID_STRONG = REGISTER.registerHolder("shrink_grid_strong", () -> + public static final Holder SHRINK_GRID_STRONG = REGISTRAR.registerHolder("shrink_grid_strong", () -> new Potion("shrink_grid_strong", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 1800, 1))); public static void addRecipes(PotionBrewing.Builder builder) { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java index 7383360e24..b594310258 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.lib; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.sounds.SoundEvent; @@ -9,61 +9,61 @@ import static at.petrak.hexcasting.api.HexAPI.modLoc; public class HexSounds { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(Registries.SOUND_EVENT); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(Registries.SOUND_EVENT); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Holder START_PATTERN = REGISTER.registerHolder("casting.pattern.start", () -> + public static final Holder START_PATTERN = REGISTRAR.registerHolder("casting.pattern.start", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.pattern.start"))); - public static final Holder ADD_TO_PATTERN = REGISTER.registerHolder("casting.pattern.add_segment", () -> + public static final Holder ADD_TO_PATTERN = REGISTRAR.registerHolder("casting.pattern.add_segment", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.pattern.add_segment"))); - public static final Holder CASTING_AMBIANCE = REGISTER.registerHolder("casting.ambiance", () -> + public static final Holder CASTING_AMBIANCE = REGISTRAR.registerHolder("casting.ambiance", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.ambiance"))); - public static final Holder CAST_NORMAL = REGISTER.registerHolder("casting.cast.normal", () -> + public static final Holder CAST_NORMAL = REGISTRAR.registerHolder("casting.cast.normal", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.cast.normal"))); - public static final Holder CAST_SPELL = REGISTER.registerHolder("casting.cast.spell", () -> + public static final Holder CAST_SPELL = REGISTRAR.registerHolder("casting.cast.spell", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.cast.spell"))); - public static final Holder CAST_HERMES = REGISTER.registerHolder("casting.cast.hermes", () -> + public static final Holder CAST_HERMES = REGISTRAR.registerHolder("casting.cast.hermes", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.cast.hermes"))); - public static final Holder CAST_THOTH = REGISTER.registerHolder("casting.cast.thoth", () -> + public static final Holder CAST_THOTH = REGISTRAR.registerHolder("casting.cast.thoth", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.cast.thoth"))); - public static final Holder CAST_FAILURE = REGISTER.registerHolder("casting.cast.fail", () -> + public static final Holder CAST_FAILURE = REGISTRAR.registerHolder("casting.cast.fail", () -> SoundEvent.createVariableRangeEvent(modLoc("casting.cast.fail"))); - public static final Holder ABACUS = REGISTER.registerHolder("abacus", () -> + public static final Holder ABACUS = REGISTRAR.registerHolder("abacus", () -> SoundEvent.createVariableRangeEvent(modLoc("abacus"))); - public static final Holder ABACUS_SHAKE = REGISTER.registerHolder("abacus.shake", () -> + public static final Holder ABACUS_SHAKE = REGISTRAR.registerHolder("abacus.shake", () -> SoundEvent.createVariableRangeEvent(modLoc("abacus.shake"))); - public static final Holder STAFF_RESET = REGISTER.registerHolder("staff.reset", () -> + public static final Holder STAFF_RESET = REGISTRAR.registerHolder("staff.reset", () -> SoundEvent.createVariableRangeEvent(modLoc("staff.reset"))); - public static final Holder SPELL_CIRCLE_FIND_BLOCK = REGISTER.registerHolder("spellcircle.find_block", () -> + public static final Holder SPELL_CIRCLE_FIND_BLOCK = REGISTRAR.registerHolder("spellcircle.find_block", () -> SoundEvent.createVariableRangeEvent(modLoc("spellcircle.find_block"))); - public static final Holder SPELL_CIRCLE_FAIL = REGISTER.registerHolder("spellcircle.fail", () -> + public static final Holder SPELL_CIRCLE_FAIL = REGISTRAR.registerHolder("spellcircle.fail", () -> SoundEvent.createVariableRangeEvent(modLoc("spellcircle.fail"))); - public static final Holder SCROLL_DUST = REGISTER.registerHolder("scroll.dust", () -> + public static final Holder SCROLL_DUST = REGISTRAR.registerHolder("scroll.dust", () -> SoundEvent.createVariableRangeEvent(modLoc("scroll.dust"))); - public static final Holder SCROLL_SCRIBBLE = REGISTER.registerHolder("scroll.scribble", () -> + public static final Holder SCROLL_SCRIBBLE = REGISTRAR.registerHolder("scroll.scribble", () -> SoundEvent.createVariableRangeEvent(modLoc("scroll.scribble"))); - public static final Holder IMPETUS_LOOK_TICK = REGISTER.registerHolder("impetus.fletcher.tick", () -> + public static final Holder IMPETUS_LOOK_TICK = REGISTRAR.registerHolder("impetus.fletcher.tick", () -> SoundEvent.createVariableRangeEvent(modLoc("impetus.fletcher.tick"))); - public static final Holder IMPETUS_REDSTONE_DING = REGISTER.registerHolder("impetus.redstone.register", () -> + public static final Holder IMPETUS_REDSTONE_DING = REGISTRAR.registerHolder("impetus.redstone.register", () -> SoundEvent.createVariableRangeEvent(modLoc("impetus.redstone.register"))); - public static final Holder IMPETUS_REDSTONE_CLEAR = REGISTER.registerHolder("impetus.redstone.clear", () -> + public static final Holder IMPETUS_REDSTONE_CLEAR = REGISTRAR.registerHolder("impetus.redstone.clear", () -> SoundEvent.createVariableRangeEvent(modLoc("impetus.redstone.clear"))); - public static final Holder READ_LORE_FRAGMENT = REGISTER.registerHolder("lore_fragment.read", () -> + public static final Holder READ_LORE_FRAGMENT = REGISTRAR.registerHolder("lore_fragment.read", () -> SoundEvent.createVariableRangeEvent(modLoc("lore_fragment.read"))); - public static final Holder FLIGHT_AMBIENCE = REGISTER.registerHolder("flight.ambience", () -> + public static final Holder FLIGHT_AMBIENCE = REGISTRAR.registerHolder("flight.ambience", () -> SoundEvent.createVariableRangeEvent(modLoc("flight.ambience"))); - public static final Holder FLIGHT_FINISH = REGISTER.registerHolder("flight.finish", () -> + public static final Holder FLIGHT_FINISH = REGISTRAR.registerHolder("flight.finish", () -> SoundEvent.createVariableRangeEvent(modLoc("flight.finish"))); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexStateIngredients.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexStateIngredients.java index 27a48423be..0e69adc31d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexStateIngredients.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexStateIngredients.java @@ -2,7 +2,7 @@ import at.petrak.hexcasting.common.recipe.ingredient.state.*; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; @@ -18,10 +18,10 @@ import java.util.function.Supplier; public class HexStateIngredients { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.STATE_INGREDIENT); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.STATE_INGREDIENT); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } public static final Codec TYPED_CODEC = Codec.lazyInitialized(() -> IXplatAbstractions.INSTANCE @@ -32,13 +32,13 @@ public static void register() { .registry(HexRegistries.STATE_INGREDIENT) .dispatch(StateIngredient::getType, StateIngredientType::streamCodec); - public static final Supplier> BLOCK_TYPE = REGISTER.register("block", StateIngredientBlock.Type::new); - public static final Supplier> BLOCK_STATE = REGISTER.register("state", StateIngredientBlockState.Type::new); - public static final Supplier> BLOCKS = REGISTER.register("blocks", StateIngredientBlocks.Type::new); - public static final Supplier> TAG = REGISTER.register("tag", StateIngredientTag.Type::new); - public static final Supplier> TAG_EXCLUDING = REGISTER.register("tag_excluding", StateIngredientTagExcluding.Type::new); + public static final Supplier> BLOCK_TYPE = REGISTRAR.register("block", StateIngredientBlock.Type::new); + public static final Supplier> BLOCK_STATE = REGISTRAR.register("state", StateIngredientBlockState.Type::new); + public static final Supplier> BLOCKS = REGISTRAR.register("blocks", StateIngredientBlocks.Type::new); + public static final Supplier> TAG = REGISTRAR.register("tag", StateIngredientTag.Type::new); + public static final Supplier> TAG_EXCLUDING = REGISTRAR.register("tag_excluding", StateIngredientTagExcluding.Type::new); - public static final Supplier> NONE_TYPE = REGISTER.register("none", () -> new StateIngredientType<>() { + public static final Supplier> NONE_TYPE = REGISTRAR.register("none", () -> new StateIngredientType<>() { @Override public MapCodec codec() { return MapCodec.unit(NONE); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexActions.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexActions.java index 0d18c19df1..0aff77be1c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexActions.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexActions.java @@ -53,7 +53,7 @@ import at.petrak.hexcasting.interop.pehkui.OpSetScale; import at.petrak.hexcasting.interop.pehkui.PehkuiInterop; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.world.effect.MobEffects; @@ -65,81 +65,81 @@ @SuppressWarnings("unused") public class HexActions { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.ACTION); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.ACTION); public static final Registry REGISTRY = IXplatAbstractions.INSTANCE.getActionRegistry(); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } // In general: // - CCW is the normal or construction version // - CW is the special or destruction version - public static final Holder GET_CASTER = REGISTER.registerHolder("get_caster", () -> + public static final Holder GET_CASTER = REGISTRAR.registerHolder("get_caster", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qaq", HexDir.NORTH_EAST), OpGetCaster.INSTANCE)); - public static final Holder ENTITY_POS$EYE = REGISTER.registerHolder("entity_pos/eye", () -> + public static final Holder ENTITY_POS$EYE = REGISTRAR.registerHolder("entity_pos/eye", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aa", HexDir.EAST), new OpEntityPos(false))); - public static final Holder ENTITY_POS$FOOT = REGISTER.registerHolder("entity_pos/foot", () -> + public static final Holder ENTITY_POS$FOOT = REGISTRAR.registerHolder("entity_pos/foot", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dd", HexDir.NORTH_EAST), new OpEntityPos(true))); - public static final Holder ENTITY_LOOK = REGISTER.registerHolder("get_entity_look", () -> + public static final Holder ENTITY_LOOK = REGISTRAR.registerHolder("get_entity_look", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wa", HexDir.EAST), OpEntityLook.INSTANCE)); - public static final Holder ENTITY_HEIGHT = REGISTER.registerHolder("get_entity_height", () -> + public static final Holder ENTITY_HEIGHT = REGISTRAR.registerHolder("get_entity_height", () -> new ActionRegistryEntry(HexPattern.fromAngleString("awq", HexDir.NORTH_EAST), OpEntityHeight.INSTANCE)); - public static final Holder ENTITY_VELOCITY = REGISTER.registerHolder("get_entity_velocity", () -> + public static final Holder ENTITY_VELOCITY = REGISTRAR.registerHolder("get_entity_velocity", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wq", HexDir.EAST), OpEntityVelocity.INSTANCE)); // == Getters == - public static final Holder RAYCAST = REGISTER.registerHolder("raycast", () -> + public static final Holder RAYCAST = REGISTRAR.registerHolder("raycast", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wqaawdd", HexDir.EAST), OpBlockRaycast.INSTANCE)); - public static final Holder RAYCAST_AXIS = REGISTER.registerHolder("raycast/axis", () -> + public static final Holder RAYCAST_AXIS = REGISTRAR.registerHolder("raycast/axis", () -> new ActionRegistryEntry(HexPattern.fromAngleString("weddwaa", HexDir.EAST), OpBlockAxisRaycast.INSTANCE)); - public static final Holder RAYCAST_ENTITY = REGISTER.registerHolder("raycast/entity", () -> + public static final Holder RAYCAST_ENTITY = REGISTRAR.registerHolder("raycast/entity", () -> new ActionRegistryEntry(HexPattern.fromAngleString("weaqa", HexDir.EAST), OpEntityRaycast.INSTANCE)); - public static final Holder GET_MEDIA = REGISTER.registerHolder("get_media", () -> + public static final Holder GET_MEDIA = REGISTRAR.registerHolder("get_media", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dde", HexDir.WEST), OpGetMedia.INSTANCE)); // == spell circle getters == - public static final Holder CIRCLE$IMPETUS_POST = REGISTER.registerHolder("circle/impetus_pos", () -> + public static final Holder CIRCLE$IMPETUS_POST = REGISTRAR.registerHolder("circle/impetus_pos", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eaqwqae", HexDir.SOUTH_WEST), OpImpetusPos.INSTANCE)); - public static final Holder CIRCLE$IMPETUS_DIR = REGISTER.registerHolder("circle/impetus_dir", () -> + public static final Holder CIRCLE$IMPETUS_DIR = REGISTRAR.registerHolder("circle/impetus_dir", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eaqwqaewede", HexDir.SOUTH_WEST), OpImpetusDir.INSTANCE)); - public static final Holder CIRCLE$BOUNDS$MIN = REGISTER.registerHolder("circle/bounds/min", () -> + public static final Holder CIRCLE$BOUNDS$MIN = REGISTRAR.registerHolder("circle/bounds/min", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eaqwqaewdd", HexDir.SOUTH_WEST), new OpCircleBounds(false))); - public static final Holder CIRCLE$BOUNDS$MAX = REGISTER.registerHolder("circle/bounds/max", () -> + public static final Holder CIRCLE$BOUNDS$MAX = REGISTRAR.registerHolder("circle/bounds/max", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aqwqawaaqa", HexDir.WEST), new OpCircleBounds(true))); // == Modify Stack == - public static final Holder SWAP = REGISTER.registerHolder("swap", () -> + public static final Holder SWAP = REGISTRAR.registerHolder("swap", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aawdd", HexDir.EAST), new OpTwiddling(2, new int[]{1, 0}))); - public static final Holder ROTATE = REGISTER.registerHolder("rotate", () -> + public static final Holder ROTATE = REGISTRAR.registerHolder("rotate", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aaeaa", HexDir.EAST), new OpTwiddling(3, new int[]{1, 2, 0}))); - public static final Holder ROTATE_REVERSE = REGISTER.registerHolder("rotate_reverse", () -> + public static final Holder ROTATE_REVERSE = REGISTRAR.registerHolder("rotate_reverse", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ddqdd", HexDir.NORTH_EAST), new OpTwiddling(3, new int[]{2, 0, 1}))); - public static final Holder DUPLICATE = REGISTER.registerHolder("duplicate", () -> + public static final Holder DUPLICATE = REGISTRAR.registerHolder("duplicate", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aadaa", HexDir.EAST), new OpTwiddling(1, new int[]{0, 0}))); - public static final Holder OVER = REGISTER.registerHolder("over", () -> + public static final Holder OVER = REGISTRAR.registerHolder("over", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aaedd", HexDir.EAST), new OpTwiddling(2, new int[]{0, 1, 0}))); - public static final Holder TUCK = REGISTER.registerHolder("tuck", () -> + public static final Holder TUCK = REGISTRAR.registerHolder("tuck", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ddqaa", HexDir.EAST), new OpTwiddling(2, new int[]{1, 0, 1}))); - public static final Holder TWO_DUP = REGISTER.registerHolder("2dup", () -> + public static final Holder TWO_DUP = REGISTRAR.registerHolder("2dup", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aadadaaw", HexDir.EAST), new OpTwiddling(2, new int[]{0, 1, 0, 1}))); - public static final Holder STACK_LEN = REGISTER.registerHolder("stack_len", () -> + public static final Holder STACK_LEN = REGISTRAR.registerHolder("stack_len", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qwaeawqaeaqa", HexDir.NORTH_WEST), OpStackSize.INSTANCE)); - public static final Holder DUPLICATE_N = REGISTER.registerHolder("duplicate_n", () -> + public static final Holder DUPLICATE_N = REGISTRAR.registerHolder("duplicate_n", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aadaadaa", HexDir.EAST), OpDuplicateN.INSTANCE)); - public static final Holder FISHERMAN = REGISTER.registerHolder("fisherman", () -> + public static final Holder FISHERMAN = REGISTRAR.registerHolder("fisherman", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ddad", HexDir.WEST), OpFisherman.INSTANCE)); - public static final Holder FISHERMAN$COPY = REGISTER.registerHolder("fisherman/copy", () -> + public static final Holder FISHERMAN$COPY = REGISTRAR.registerHolder("fisherman/copy", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aada", HexDir.EAST), OpFishermanButItCopies.INSTANCE)); - public static final Holder SWIZZLE = REGISTER.registerHolder("swizzle", () -> + public static final Holder SWIZZLE = REGISTRAR.registerHolder("swizzle", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qaawdde", HexDir.SOUTH_EAST), OpAlwinfyHasAscendedToABeingOfPureMath.INSTANCE)); @@ -166,7 +166,7 @@ public static void register() { new OperationAction(HexPattern.fromAngleString("eqqqqq", HexDir.EAST))); public static final Holder DECONSTRUCT_VEC = make("deconstruct_vec", new OperationAction(HexPattern.fromAngleString("qeeeee", HexDir.EAST))); - public static final Holder COERCE_AXIAL = REGISTER.registerHolder("coerce_axial", () -> + public static final Holder COERCE_AXIAL = REGISTRAR.registerHolder("coerce_axial", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqaww", HexDir.NORTH_WEST), OpCoerceToAxial.INSTANCE)); // == Logic == @@ -191,22 +191,22 @@ public static void register() { public static final Holder LESS_EQ = make("less_eq", new OperationAction( HexPattern.fromAngleString("qq", HexDir.SOUTH_WEST)) ); - public static final Holder EQUALS = REGISTER.registerHolder("equals", () -> + public static final Holder EQUALS = REGISTRAR.registerHolder("equals", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ad", HexDir.EAST), new OpEquality(false))); - public static final Holder NOT_EQUALS = REGISTER.registerHolder("not_equals", () -> + public static final Holder NOT_EQUALS = REGISTRAR.registerHolder("not_equals", () -> new ActionRegistryEntry(HexPattern.fromAngleString("da", HexDir.EAST), new OpEquality(true))); - public static final Holder TYPE_EQUALS = REGISTER.registerHolder("type_equals", () -> + public static final Holder TYPE_EQUALS = REGISTRAR.registerHolder("type_equals", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wawdw", HexDir.EAST), new OpTypeEquality(false))); - public static final Holder TYPE_NOT_EQUALS = REGISTER.registerHolder("type_not_equals", () -> + public static final Holder TYPE_NOT_EQUALS = REGISTRAR.registerHolder("type_not_equals", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wdwaw", HexDir.EAST), new OpTypeEquality(true))); - public static final Holder BOOL_COERCE = REGISTER.registerHolder("bool_coerce", () -> + public static final Holder BOOL_COERCE = REGISTRAR.registerHolder("bool_coerce", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aw", HexDir.NORTH_EAST), OpCoerceToBool.INSTANCE)); - public static final Holder IF = REGISTER.registerHolder("if", () -> + public static final Holder IF = REGISTRAR.registerHolder("if", () -> new ActionRegistryEntry(HexPattern.fromAngleString("awdd", HexDir.SOUTH_EAST), OpBoolIf.INSTANCE)); - public static final Holder NULL_COALESCE = REGISTER.registerHolder("null_coalesce", () -> + public static final Holder NULL_COALESCE = REGISTRAR.registerHolder("null_coalesce", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wawaa", HexDir.SOUTH_EAST), OpNullCoalesce.INSTANCE)); - public static final Holder RANDOM = REGISTER.registerHolder("random", () -> + public static final Holder RANDOM = REGISTRAR.registerHolder("random", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eqqq", HexDir.NORTH_WEST), OpRandom.INSTANCE)); // == Advanced Math == @@ -237,333 +237,333 @@ public static void register() { // == Spells == - public static final Holder PRINT = REGISTER.registerHolder("print", () -> + public static final Holder PRINT = REGISTRAR.registerHolder("print", () -> new ActionRegistryEntry(HexPattern.fromAngleString("de", HexDir.NORTH_EAST), OpPrint.INSTANCE)); - public static final Holder EXPLODE = REGISTER.registerHolder("explode", () -> + public static final Holder EXPLODE = REGISTRAR.registerHolder("explode", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aawaawaa", HexDir.EAST), new OpExplode(false))); - public static final Holder EXPLODE$FIRE = REGISTER.registerHolder("explode/fire", () -> + public static final Holder EXPLODE$FIRE = REGISTRAR.registerHolder("explode/fire", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ddwddwdd", HexDir.EAST), new OpExplode(true))); - public static final Holder ADD_MOTION = REGISTER.registerHolder("add_motion", () -> + public static final Holder ADD_MOTION = REGISTRAR.registerHolder("add_motion", () -> new ActionRegistryEntry(HexPattern.fromAngleString("awqqqwaqw", HexDir.SOUTH_WEST), OpAddMotion.INSTANCE)); - public static final Holder BLINK = REGISTER.registerHolder("blink", () -> + public static final Holder BLINK = REGISTRAR.registerHolder("blink", () -> new ActionRegistryEntry(HexPattern.fromAngleString("awqqqwaq", HexDir.SOUTH_WEST), OpBlink.INSTANCE)); - public static final Holder BREAK_BLOCK = REGISTER.registerHolder("break_block", () -> + public static final Holder BREAK_BLOCK = REGISTRAR.registerHolder("break_block", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qaqqqqq", HexDir.EAST), OpBreakBlock.INSTANCE)); - public static final Holder PLACE_BLOCK = REGISTER.registerHolder("place_block", () -> + public static final Holder PLACE_BLOCK = REGISTRAR.registerHolder("place_block", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eeeeede", HexDir.SOUTH_WEST), OpPlaceBlock.INSTANCE)); - public static final Holder COLORIZE = REGISTER.registerHolder("colorize", () -> + public static final Holder COLORIZE = REGISTRAR.registerHolder("colorize", () -> new ActionRegistryEntry(HexPattern.fromAngleString("awddwqawqwawq", HexDir.EAST), OpColorize.INSTANCE)); - public static final Holder CYCLE_VARIANT = REGISTER.registerHolder("cycle_variant", () -> + public static final Holder CYCLE_VARIANT = REGISTRAR.registerHolder("cycle_variant", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dwaawedwewdwe", HexDir.WEST), OpCycleVariant.INSTANCE)); - public static final Holder CREATE_WATER = REGISTER.registerHolder("create_water", () -> + public static final Holder CREATE_WATER = REGISTRAR.registerHolder("create_water", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aqawqadaq", HexDir.SOUTH_EAST), new OpCreateFluid( MediaConstants.DUST_UNIT, Items.WATER_BUCKET, Blocks.WATER_CAULDRON.defaultBlockState() .setValue(LayeredCauldronBlock.LEVEL, LayeredCauldronBlock.MAX_FILL_LEVEL), Fluids.WATER))); - public static final Holder DESTROY_WATER = REGISTER.registerHolder("destroy_water", () -> + public static final Holder DESTROY_WATER = REGISTRAR.registerHolder("destroy_water", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dedwedade", HexDir.SOUTH_WEST), OpDestroyFluid.INSTANCE)); - public static final Holder IGNITE = REGISTER.registerHolder("ignite", () -> + public static final Holder IGNITE = REGISTRAR.registerHolder("ignite", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aaqawawa", HexDir.SOUTH_EAST), OpIgnite.INSTANCE)); - public static final Holder EXTINGUISH = REGISTER.registerHolder("extinguish", () -> + public static final Holder EXTINGUISH = REGISTRAR.registerHolder("extinguish", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ddedwdwd", HexDir.SOUTH_WEST), OpExtinguish.INSTANCE)); - public static final Holder CONJURE_BLOCK = REGISTER.registerHolder("conjure_block", () -> + public static final Holder CONJURE_BLOCK = REGISTRAR.registerHolder("conjure_block", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqa", HexDir.NORTH_EAST), new OpConjureBlock(false))); - public static final Holder CONJURE_LIGHT = REGISTER.registerHolder("conjure_light", () -> + public static final Holder CONJURE_LIGHT = REGISTRAR.registerHolder("conjure_light", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqd", HexDir.NORTH_EAST), new OpConjureBlock(true))); - public static final Holder BONEMEAL = REGISTER.registerHolder("bonemeal", () -> + public static final Holder BONEMEAL = REGISTRAR.registerHolder("bonemeal", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wqaqwawqaqw", HexDir.NORTH_EAST), OpTheOnlyReasonAnyoneDownloadedPsi.INSTANCE)); - public static final Holder RECHARGE = REGISTER.registerHolder("recharge", () -> + public static final Holder RECHARGE = REGISTRAR.registerHolder("recharge", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqwaeaeaeaeaea", HexDir.NORTH_WEST), OpRecharge.INSTANCE)); - public static final Holder ERASE = REGISTER.registerHolder("erase", () -> + public static final Holder ERASE = REGISTRAR.registerHolder("erase", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qdqawwaww", HexDir.EAST), OpErase.INSTANCE)); - public static final Holder EDIFY = REGISTER.registerHolder("edify", () -> + public static final Holder EDIFY = REGISTRAR.registerHolder("edify", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wqaqwd", HexDir.NORTH_EAST), OpEdifySapling.INSTANCE)); - public static final Holder BEEP = REGISTER.registerHolder("beep", () -> + public static final Holder BEEP = REGISTRAR.registerHolder("beep", () -> new ActionRegistryEntry(HexPattern.fromAngleString("adaa", HexDir.WEST), OpBeep.INSTANCE)); - public static final Holder CRAFT$CYPHER = REGISTER.registerHolder("craft/cypher", () -> new ActionRegistryEntry( + public static final Holder CRAFT$CYPHER = REGISTRAR.registerHolder("craft/cypher", () -> new ActionRegistryEntry( HexPattern.fromAngleString("waqqqqq", HexDir.EAST), new OpMakePackagedSpell(s -> (s.is(HexItems.CYPHER.get())||s.is(HexItems.ANCIENT_CYPHER.get())), HexItems.CYPHER.get()::getDescription, MediaConstants.CRYSTAL_UNIT) )); - public static final Holder CRAFT$TRINKET = REGISTER.registerHolder("craft/trinket", () -> new ActionRegistryEntry( + public static final Holder CRAFT$TRINKET = REGISTRAR.registerHolder("craft/trinket", () -> new ActionRegistryEntry( HexPattern.fromAngleString("wwaqqqqqeaqeaeqqqeaeq", HexDir.EAST), new OpMakePackagedSpell(HexItems.TRINKET.get(), 5 * MediaConstants.CRYSTAL_UNIT) )); - public static final Holder CRAFT$ARTIFACT = REGISTER.registerHolder("craft/artifact", () -> new ActionRegistryEntry( + public static final Holder CRAFT$ARTIFACT = REGISTRAR.registerHolder("craft/artifact", () -> new ActionRegistryEntry( HexPattern.fromAngleString("wwaqqqqqeawqwqwqwqwqwwqqeadaeqqeqqeadaeqq", HexDir.EAST), new OpMakePackagedSpell(HexItems.ARTIFACT.get(), 10 * MediaConstants.CRYSTAL_UNIT) )); - public static final Holder CRAFT$BATTERY = REGISTER.registerHolder("craft/battery", () -> new ActionRegistryEntry( + public static final Holder CRAFT$BATTERY = REGISTRAR.registerHolder("craft/battery", () -> new ActionRegistryEntry( HexPattern.fromAngleString("aqqqaqwwaqqqqqeqaqqqawwqwqwqwqwqw", HexDir.SOUTH_WEST), OpMakeBattery.INSTANCE)); - public static final Holder POTION$WEAKNESS = REGISTER.registerHolder("potion/weakness", () -> new ActionRegistryEntry( + public static final Holder POTION$WEAKNESS = REGISTRAR.registerHolder("potion/weakness", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqaqwawaw", HexDir.NORTH_WEST), new OpPotionEffect(MobEffects.WEAKNESS, MediaConstants.DUST_UNIT / 10, true, false) )); - public static final Holder POTION$LEVITATION = REGISTER.registerHolder("potion/levitation", () -> new ActionRegistryEntry( + public static final Holder POTION$LEVITATION = REGISTRAR.registerHolder("potion/levitation", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqawwawawd", HexDir.WEST), new OpPotionEffect(MobEffects.LEVITATION, MediaConstants.DUST_UNIT / 5, false, false) )); - public static final Holder POTION$WITHER = REGISTER.registerHolder("potion/wither", () -> new ActionRegistryEntry( + public static final Holder POTION$WITHER = REGISTRAR.registerHolder("potion/wither", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqaewawawe", HexDir.SOUTH_WEST), new OpPotionEffect(MobEffects.WITHER, MediaConstants.DUST_UNIT, true, false) )); - public static final Holder POTION$POISON = REGISTER.registerHolder("potion/poison", () -> new ActionRegistryEntry( + public static final Holder POTION$POISON = REGISTRAR.registerHolder("potion/poison", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqadwawaww", HexDir.SOUTH_EAST), new OpPotionEffect(MobEffects.POISON, MediaConstants.DUST_UNIT / 3, true, false) )); - public static final Holder POTION$SLOWNESS = REGISTER.registerHolder("potion/slowness", () -> new ActionRegistryEntry( + public static final Holder POTION$SLOWNESS = REGISTRAR.registerHolder("potion/slowness", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqadwawaw", HexDir.SOUTH_EAST), new OpPotionEffect(MobEffects.MOVEMENT_SLOWDOWN, MediaConstants.DUST_UNIT / 3, true, false) )); - public static final Holder POTION$REGENERATION = REGISTER.registerHolder("potion/regeneration", () -> new ActionRegistryEntry( + public static final Holder POTION$REGENERATION = REGISTRAR.registerHolder("potion/regeneration", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqaawawaedd", HexDir.NORTH_WEST), new OpPotionEffect(MobEffects.REGENERATION, MediaConstants.DUST_UNIT, true, true) )); - public static final Holder POTION$NIGHT_VISION = REGISTER.registerHolder("potion/night_vision", () -> new ActionRegistryEntry( + public static final Holder POTION$NIGHT_VISION = REGISTRAR.registerHolder("potion/night_vision", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqaawawaeqdd", HexDir.WEST), new OpPotionEffect(MobEffects.NIGHT_VISION, MediaConstants.DUST_UNIT / 5, false, true) )); - public static final Holder POTION$ABSORPTION = REGISTER.registerHolder("potion/absorption", () -> new ActionRegistryEntry( + public static final Holder POTION$ABSORPTION = REGISTRAR.registerHolder("potion/absorption", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqaawawaeqqdd", HexDir.SOUTH_WEST), new OpPotionEffect(MobEffects.ABSORPTION, MediaConstants.DUST_UNIT, true, true) )); - public static final Holder POTION$HASTE = REGISTER.registerHolder("potion/haste", () -> new ActionRegistryEntry( + public static final Holder POTION$HASTE = REGISTRAR.registerHolder("potion/haste", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qaawawaeqqqdd", HexDir.SOUTH_EAST), new OpPotionEffect(MobEffects.DIG_SPEED, MediaConstants.DUST_UNIT / 3, true, true) )); - public static final Holder POTION$STRENGTH = REGISTER.registerHolder("potion/strength", () -> new ActionRegistryEntry( + public static final Holder POTION$STRENGTH = REGISTRAR.registerHolder("potion/strength", () -> new ActionRegistryEntry( HexPattern.fromAngleString("aawawaeqqqqdd", HexDir.EAST), new OpPotionEffect(MobEffects.DAMAGE_BOOST, MediaConstants.DUST_UNIT / 3, true, true) )); - public static final Holder FLIGHT$RANGE = REGISTER.registerHolder("flight/range", () -> + public static final Holder FLIGHT$RANGE = REGISTRAR.registerHolder("flight/range", () -> new ActionRegistryEntry(HexPattern.fromAngleString("awawaawq", HexDir.SOUTH_WEST), new OpFlight(OpFlight.Type.LimitRange))); - public static final Holder FLIGHT$TIME = REGISTER.registerHolder("flight/time", () -> + public static final Holder FLIGHT$TIME = REGISTRAR.registerHolder("flight/time", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dwdwdewq", HexDir.NORTH_EAST), new OpFlight(OpFlight.Type.LimitTime))); - public static final Holder FLIGHT$CAN_FLY = REGISTER.registerHolder("flight/can_fly", () -> + public static final Holder FLIGHT$CAN_FLY = REGISTRAR.registerHolder("flight/can_fly", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dwdwdeweaqa", HexDir.NORTH_EAST), OpCanEntityHexFly.INSTANCE)); - public static final Holder SENTINEL$CREATE = REGISTER.registerHolder("sentinel/create", () -> + public static final Holder SENTINEL$CREATE = REGISTRAR.registerHolder("sentinel/create", () -> new ActionRegistryEntry(HexPattern.fromAngleString("waeawae", HexDir.EAST), new OpCreateSentinel(false))); - public static final Holder SENTINEL$DESTROY = REGISTER.registerHolder("sentinel/destroy", () -> + public static final Holder SENTINEL$DESTROY = REGISTRAR.registerHolder("sentinel/destroy", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qdwdqdw", HexDir.NORTH_EAST), OpDestroySentinel.INSTANCE)); - public static final Holder SENTINEL$GET_POS = REGISTER.registerHolder("sentinel/get_pos", () -> + public static final Holder SENTINEL$GET_POS = REGISTRAR.registerHolder("sentinel/get_pos", () -> new ActionRegistryEntry(HexPattern.fromAngleString("waeawaede", HexDir.EAST), OpGetSentinelPos.INSTANCE)); - public static final Holder SENTINEL$WAYFIND = REGISTER.registerHolder("sentinel/wayfind", () -> + public static final Holder SENTINEL$WAYFIND = REGISTRAR.registerHolder("sentinel/wayfind", () -> new ActionRegistryEntry(HexPattern.fromAngleString("waeawaedwa", HexDir.EAST), OpGetSentinelWayfind.INSTANCE)); - public static final Holder LIGHTNING = REGISTER.registerHolder("lightning", () -> + public static final Holder LIGHTNING = REGISTRAR.registerHolder("lightning", () -> new ActionRegistryEntry(HexPattern.fromAngleString("waadwawdaaweewq", HexDir.EAST), OpLightning.INSTANCE)); - public static final Holder ALTIORA = REGISTER.registerHolder("flight", () -> + public static final Holder ALTIORA = REGISTRAR.registerHolder("flight", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eawwaeawawaa", HexDir.NORTH_WEST), OpAltiora.INSTANCE)); - public static final Holder CREATE_LAVA = REGISTER.registerHolder("create_lava", () -> + public static final Holder CREATE_LAVA = REGISTRAR.registerHolder("create_lava", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eaqawqadaqd", HexDir.EAST), new OpCreateFluid( MediaConstants.CRYSTAL_UNIT, Items.LAVA_BUCKET, Blocks.LAVA_CAULDRON.defaultBlockState(), Fluids.LAVA))); - public static final Holder TELEPORT = REGISTER.registerHolder("teleport/great", () -> + public static final Holder TELEPORT = REGISTRAR.registerHolder("teleport/great", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wwwqqqwwwqqeqqwwwqqwqqdqqqqqdqq", HexDir.EAST), OpTeleport.INSTANCE)); - public static final Holder SENTINEL$GREAT = REGISTER.registerHolder("sentinel/create/great", () -> + public static final Holder SENTINEL$GREAT = REGISTRAR.registerHolder("sentinel/create/great", () -> new ActionRegistryEntry(HexPattern.fromAngleString("waeawaeqqqwqwqqwq", HexDir.EAST), new OpCreateSentinel(true))); - public static final Holder DISPEL_RAIN = REGISTER.registerHolder("dispel_rain", () -> + public static final Holder DISPEL_RAIN = REGISTRAR.registerHolder("dispel_rain", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eeewwweeewwaqqddqdqd", HexDir.EAST), new OpWeather(false))); - public static final Holder SUMMON_RAIN = REGISTER.registerHolder("summon_rain", () -> + public static final Holder SUMMON_RAIN = REGISTRAR.registerHolder("summon_rain", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wwweeewwweewdawdwad", HexDir.WEST), new OpWeather(true))); - public static final Holder BRAINSWEEP = REGISTER.registerHolder("brainsweep", () -> + public static final Holder BRAINSWEEP = REGISTRAR.registerHolder("brainsweep", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qeqwqwqwqwqeqaeqeaqeqaeqaqded", HexDir.NORTH_EAST), OpBrainsweep.INSTANCE)); - public static final Holder AKASHIC$READ = REGISTER.registerHolder("akashic/read", () -> + public static final Holder AKASHIC$READ = REGISTRAR.registerHolder("akashic/read", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqwqqqqqaq", HexDir.WEST), OpAkashicRead.INSTANCE)); - public static final Holder AKASHIC$WRITE = REGISTER.registerHolder("akashic/write", () -> + public static final Holder AKASHIC$WRITE = REGISTRAR.registerHolder("akashic/write", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eeeweeeeede", HexDir.EAST), OpAkashicWrite.INSTANCE)); // == Meta stuff == - public static final Holder ESCAPE = REGISTER.registerHolder("escape", () -> + public static final Holder ESCAPE = REGISTRAR.registerHolder("escape", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqaw", HexDir.WEST), OpEscape.INSTANCE)); - public static final Holder RUNTIME_ESCAPE = REGISTER.registerHolder("runtime_escape", () -> + public static final Holder RUNTIME_ESCAPE = REGISTRAR.registerHolder("runtime_escape", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wdeee", HexDir.SOUTH_EAST), OpRuntimeEscape.INSTANCE)); - public static final Holder OPEN_PAREN = REGISTER.registerHolder("open_paren", () -> + public static final Holder OPEN_PAREN = REGISTRAR.registerHolder("open_paren", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqq", HexDir.WEST), OpOpenParen.INSTANCE)); - public static final Holder CLOSE_PAREN = REGISTER.registerHolder("close_paren", () -> + public static final Holder CLOSE_PAREN = REGISTRAR.registerHolder("close_paren", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eee", HexDir.EAST), OpCloseParen.INSTANCE)); - public static final Holder OPEN_N_PARENS = REGISTER.registerHolder("open_n_parens", () -> + public static final Holder OPEN_N_PARENS = REGISTRAR.registerHolder("open_n_parens", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qdaqadq", HexDir.WEST), OpOpenNParens.INSTANCE)); - public static final Holder CLOSE_ALL_PARENS = REGISTER.registerHolder("close_all_parens", () -> + public static final Holder CLOSE_ALL_PARENS = REGISTRAR.registerHolder("close_all_parens", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eadedae", HexDir.EAST), OpCloseAllParens.INSTANCE)); - public static final Holder READ_INTO_PARENS = REGISTER.registerHolder("read_into_parens", () -> + public static final Holder READ_INTO_PARENS = REGISTRAR.registerHolder("read_into_parens", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aqqqqqwded", HexDir.EAST), OpReadIntoParens.INSTANCE)); - public static final Holder UNDO = REGISTER.registerHolder("undo", () -> + public static final Holder UNDO = REGISTRAR.registerHolder("undo", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eeedw", HexDir.EAST), OpUndo.INSTANCE)); - public static final Holder SIMULATE = REGISTER.registerHolder("simulate", () -> + public static final Holder SIMULATE = REGISTRAR.registerHolder("simulate", () -> new ActionRegistryEntry(HexPattern.fromAngleString("deaq", HexDir.EAST), OpSimulate.INSTANCE)); // http://www.toroidalsnark.net/mkss3-pix/CalderheadJMM2014.pdf // eval being a space filling curve feels apt doesn't it - public static final Holder EVAL = REGISTER.registerHolder("eval", () -> + public static final Holder EVAL = REGISTRAR.registerHolder("eval", () -> new ActionRegistryEntry(HexPattern.fromAngleString("deaqq", HexDir.SOUTH_EAST), OpEval.INSTANCE)); - public static final Holder EVAL$CC = REGISTER.registerHolder("eval/cc", () -> + public static final Holder EVAL$CC = REGISTRAR.registerHolder("eval/cc", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qwaqde", HexDir.NORTH_WEST), OpEvalBreakable.INSTANCE)); - public static final Holder HALT = REGISTER.registerHolder("halt", () -> + public static final Holder HALT = REGISTRAR.registerHolder("halt", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aqdee", HexDir.SOUTH_WEST), OpHalt.INSTANCE)); - public static final Holder READ = REGISTER.registerHolder("read", () -> + public static final Holder READ = REGISTRAR.registerHolder("read", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aqqqqq", HexDir.EAST), OpRead.INSTANCE)); - public static final Holder READ$ENTITY = REGISTER.registerHolder("read/entity", () -> + public static final Holder READ$ENTITY = REGISTRAR.registerHolder("read/entity", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wawqwqwqwqwqw", HexDir.EAST), OpTheCoolerRead.INSTANCE)); - public static final Holder WRITE = REGISTER.registerHolder("write", () -> + public static final Holder WRITE = REGISTRAR.registerHolder("write", () -> new ActionRegistryEntry(HexPattern.fromAngleString("deeeee", HexDir.EAST), OpWrite.INSTANCE)); - public static final Holder WRITE$ENTITY = REGISTER.registerHolder("write/entity", () -> + public static final Holder WRITE$ENTITY = REGISTRAR.registerHolder("write/entity", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wdwewewewewew", HexDir.EAST), OpTheCoolerWrite.INSTANCE)); - public static final Holder READ$LOCAL = REGISTER.registerHolder("read/local", () -> + public static final Holder READ$LOCAL = REGISTRAR.registerHolder("read/local", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qeewdweddw", HexDir.NORTH_EAST), OpPeekLocal.INSTANCE)); - public static final Holder WRITE$LOCAL = REGISTER.registerHolder("write/local", () -> + public static final Holder WRITE$LOCAL = REGISTRAR.registerHolder("write/local", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eqqwawqaaw", HexDir.NORTH_WEST), OpPushLocal.INSTANCE)); - public static final Holder THANATOS = REGISTER.registerHolder("thanatos", () -> + public static final Holder THANATOS = REGISTRAR.registerHolder("thanatos", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqaed", HexDir.SOUTH_EAST), OpThanos.INSTANCE)); // == Consts == - public static final Holder CONST$NULL = REGISTER.registerHolder("const/null", () -> + public static final Holder CONST$NULL = REGISTRAR.registerHolder("const/null", () -> new ActionRegistryEntry(HexPattern.fromAngleString("d", HexDir.EAST), Action.makeConstantOp(new NullIota()))); - public static final Holder CONST$TRUE = REGISTER.registerHolder("const/true", () -> + public static final Holder CONST$TRUE = REGISTRAR.registerHolder("const/true", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aqae", HexDir.SOUTH_EAST), Action.makeConstantOp(new BooleanIota(true)))); - public static final Holder CONST$FALSE = REGISTER.registerHolder("const/false", () -> + public static final Holder CONST$FALSE = REGISTRAR.registerHolder("const/false", () -> new ActionRegistryEntry(HexPattern.fromAngleString("dedq", HexDir.NORTH_EAST), Action.makeConstantOp(new BooleanIota(false)))); - public static final Holder CONST$VEC$PX = REGISTER.registerHolder("const/vec/px", () -> + public static final Holder CONST$VEC$PX = REGISTRAR.registerHolder("const/vec/px", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "qqqqqea", HexDir.NORTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(1.0, 0.0, 0.0))))); - public static final Holder CONST$VEC$PY = REGISTER.registerHolder("const/vec/py", () -> + public static final Holder CONST$VEC$PY = REGISTRAR.registerHolder("const/vec/py", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "qqqqqew", HexDir.NORTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(0.0, 1.0, 0.0))))); - public static final Holder CONST$VEC$PZ = REGISTER.registerHolder("const/vec/pz", () -> + public static final Holder CONST$VEC$PZ = REGISTRAR.registerHolder("const/vec/pz", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "qqqqqed", HexDir.NORTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(0.0, 0.0, 1.0))))); - public static final Holder CONST$VEC$NX = REGISTER.registerHolder("const/vec/nx", () -> + public static final Holder CONST$VEC$NX = REGISTRAR.registerHolder("const/vec/nx", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "eeeeeqa", HexDir.SOUTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(-1.0, 0.0, 0.0))))); - public static final Holder CONST$VEC$NY = REGISTER.registerHolder("const/vec/ny", () -> + public static final Holder CONST$VEC$NY = REGISTRAR.registerHolder("const/vec/ny", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "eeeeeqw", HexDir.SOUTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(0.0, -1.0, 0.0))))); - public static final Holder CONST$VEC$NZ = REGISTER.registerHolder("const/vec/nz", () -> + public static final Holder CONST$VEC$NZ = REGISTRAR.registerHolder("const/vec/nz", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "eeeeeqd", HexDir.SOUTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(0.0, 0.0, -1.0))))); // Yep, this is what I spend the "plain hexagon" pattern on. - public static final Holder CONST$VEC$0 = REGISTER.registerHolder("const/vec/0", () -> + public static final Holder CONST$VEC$0 = REGISTRAR.registerHolder("const/vec/0", () -> new ActionRegistryEntry(HexPattern.fromAngleString( "qqqqq", HexDir.NORTH_WEST), Action.makeConstantOp(new Vec3Iota(new Vec3(0.0, 0.0, 0.0))))); - public static final Holder CONST$DOUBLE$PI = REGISTER.registerHolder("const/double/pi", () -> + public static final Holder CONST$DOUBLE$PI = REGISTRAR.registerHolder("const/double/pi", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qdwdq", HexDir.NORTH_EAST), Action.makeConstantOp(new DoubleIota(Math.PI)))); - public static final Holder CONST$DOUBLE$TAU = REGISTER.registerHolder("const/double/tau", () -> + public static final Holder CONST$DOUBLE$TAU = REGISTRAR.registerHolder("const/double/tau", () -> new ActionRegistryEntry(HexPattern.fromAngleString("eawae", HexDir.NORTH_WEST), Action.makeConstantOp(new DoubleIota(HexUtils.TAU)))); - public static final Holder CONST$E = REGISTER.registerHolder("const/double/e", () -> + public static final Holder CONST$E = REGISTRAR.registerHolder("const/double/e", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aaq", HexDir.EAST), Action.makeConstantOp(new DoubleIota(Math.E)))); - public static final Holder CONST$PHI = REGISTER.registerHolder("const/double/phi", () -> + public static final Holder CONST$PHI = REGISTRAR.registerHolder("const/double/phi", () -> new ActionRegistryEntry(HexPattern.fromAngleString("wdded", HexDir.NORTH_EAST), Action.makeConstantOp(new DoubleIota(1.618033988749895)))); // == Entities == - public static final Holder GET_ENTITY = REGISTER.registerHolder("get_entity", () -> + public static final Holder GET_ENTITY = REGISTRAR.registerHolder("get_entity", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqdaqa", HexDir.SOUTH_EAST), new OpGetEntityAt(e -> true))); - public static final Holder GET_ENTITY$ANIMAL = REGISTER.registerHolder("get_entity/animal", () -> + public static final Holder GET_ENTITY$ANIMAL = REGISTRAR.registerHolder("get_entity/animal", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqdaqaawa", HexDir.SOUTH_EAST), new OpGetEntityAt(OpGetEntitiesBy::isAnimal))); - public static final Holder GET_ENTITY$MONSTER = REGISTER.registerHolder("get_entity/monster", () -> + public static final Holder GET_ENTITY$MONSTER = REGISTRAR.registerHolder("get_entity/monster", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqdaqaawq", HexDir.SOUTH_EAST), new OpGetEntityAt(OpGetEntitiesBy::isMonster))); - public static final Holder GET_ENTITY$ITEM = REGISTER.registerHolder("get_entity/item", () -> + public static final Holder GET_ENTITY$ITEM = REGISTRAR.registerHolder("get_entity/item", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqdaqaaww", HexDir.SOUTH_EAST), new OpGetEntityAt(OpGetEntitiesBy::isItem))); - public static final Holder GET_ENTITY$PLAYER = REGISTER.registerHolder("get_entity/player", () -> + public static final Holder GET_ENTITY$PLAYER = REGISTRAR.registerHolder("get_entity/player", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqdaqaawe", HexDir.SOUTH_EAST), new OpGetEntityAt(OpGetEntitiesBy::isPlayer))); - public static final Holder GET_ENTITY$LIVING = REGISTER.registerHolder("get_entity/living", () -> + public static final Holder GET_ENTITY$LIVING = REGISTRAR.registerHolder("get_entity/living", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqqqqdaqaawd", HexDir.SOUTH_EAST), new OpGetEntityAt(OpGetEntitiesBy::isLiving))); - public static final Holder ZONE_ENTITY = REGISTER.registerHolder("zone_entity", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY = REGISTRAR.registerHolder("zone_entity", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqwded", HexDir.SOUTH_EAST), new OpGetEntitiesBy(e -> true, false) )); - public static final Holder ZONE_ENTITY$ANIMAL = REGISTER.registerHolder("zone_entity/animal", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY$ANIMAL = REGISTRAR.registerHolder("zone_entity/animal", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqwdeddwa", HexDir.SOUTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isAnimal, false) )); - public static final Holder ZONE_ENTITY$NOT_ANIMAL = REGISTER.registerHolder("zone_entity/not_animal", () -> + public static final Holder ZONE_ENTITY$NOT_ANIMAL = REGISTRAR.registerHolder("zone_entity/not_animal", () -> new ActionRegistryEntry( HexPattern.fromAngleString("eeeeewaqaawa", HexDir.NORTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isAnimal, true) )); - public static final Holder ZONE_ENTITY$MONSTER = REGISTER.registerHolder("zone_entity/monster", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY$MONSTER = REGISTRAR.registerHolder("zone_entity/monster", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqwdeddwq", HexDir.SOUTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isMonster, false) )); - public static final Holder ZONE_ENTITY$NOT_MONSTER = REGISTER.registerHolder("zone_entity/not_monster", () -> + public static final Holder ZONE_ENTITY$NOT_MONSTER = REGISTRAR.registerHolder("zone_entity/not_monster", () -> new ActionRegistryEntry( HexPattern.fromAngleString("eeeeewaqaawq", HexDir.NORTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isMonster, true) )); - public static final Holder ZONE_ENTITY$ITEM = REGISTER.registerHolder("zone_entity/item", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY$ITEM = REGISTRAR.registerHolder("zone_entity/item", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqwdeddww", HexDir.SOUTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isItem, false) )); - public static final Holder ZONE_ENTITY$NOT_ITEM = REGISTER.registerHolder("zone_entity/not_item", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY$NOT_ITEM = REGISTRAR.registerHolder("zone_entity/not_item", () -> new ActionRegistryEntry( HexPattern.fromAngleString("eeeeewaqaaww", HexDir.NORTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isItem, true) )); - public static final Holder ZONE_ENTITY$PLAYER = REGISTER.registerHolder("zone_entity/player", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY$PLAYER = REGISTRAR.registerHolder("zone_entity/player", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqwdeddwe", HexDir.SOUTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isPlayer, false) )); - public static final Holder ZONE_ENTITY$NOT_PLAYER = REGISTER.registerHolder("zone_entity/not_player", () -> + public static final Holder ZONE_ENTITY$NOT_PLAYER = REGISTRAR.registerHolder("zone_entity/not_player", () -> new ActionRegistryEntry( HexPattern.fromAngleString("eeeeewaqaawe", HexDir.NORTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isPlayer, true) )); - public static final Holder ZONE_ENTITY$LIVING = REGISTER.registerHolder("zone_entity/living", () -> new ActionRegistryEntry( + public static final Holder ZONE_ENTITY$LIVING = REGISTRAR.registerHolder("zone_entity/living", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqwdeddwd", HexDir.SOUTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isLiving, false) )); - public static final Holder ZONE_ENTITY$NOT_LIVING = REGISTER.registerHolder("zone_entity/not_living", () -> + public static final Holder ZONE_ENTITY$NOT_LIVING = REGISTRAR.registerHolder("zone_entity/not_living", () -> new ActionRegistryEntry( HexPattern.fromAngleString("eeeeewaqaawd", HexDir.NORTH_EAST), new OpGetEntitiesBy(OpGetEntitiesBy::isLiving, true) )); // == Types == - public static final Holder COMPARE_BLOCK = REGISTER.registerHolder("compare_block/lenient", () -> new ActionRegistryEntry( + public static final Holder COMPARE_BLOCK = REGISTRAR.registerHolder("compare_block/lenient", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qqqqqeqeeeee", HexDir.NORTH_WEST), new OpBlockEquality(false) )); - public static final Holder COMPARE_BLOCK_STRICT = REGISTER.registerHolder("compare_block/strict", () -> new ActionRegistryEntry( + public static final Holder COMPARE_BLOCK_STRICT = REGISTRAR.registerHolder("compare_block/strict", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qwawqwadadwewdwe", HexDir.NORTH_WEST), new OpBlockEquality(true) )); - public static final Holder COMPARE_ENTITY = REGISTER.registerHolder("compare_entity", () -> new ActionRegistryEntry( + public static final Holder COMPARE_ENTITY = REGISTRAR.registerHolder("compare_entity", () -> new ActionRegistryEntry( HexPattern.fromAngleString("aqaeqded", HexDir.NORTH_WEST), OpEntityEquality.INSTANCE )); - public static final Holder COMPARE_ITEM = REGISTER.registerHolder("compare_item/lenient", () -> new ActionRegistryEntry( + public static final Holder COMPARE_ITEM = REGISTRAR.registerHolder("compare_item/lenient", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qaeaqeqedqde", HexDir.NORTH_WEST), new OpItemEquality(false) )); - public static final Holder COMPARE_ITEM_STRICT = REGISTER.registerHolder("compare_item/strict", () -> new ActionRegistryEntry( + public static final Holder COMPARE_ITEM_STRICT = REGISTRAR.registerHolder("compare_item/strict", () -> new ActionRegistryEntry( HexPattern.fromAngleString("qaeaqewqedqde", HexDir.NORTH_WEST), new OpItemEquality(true) )); @@ -573,21 +573,21 @@ public static void register() { new OperationAction(HexPattern.fromAngleString("edqde", HexDir.SOUTH_WEST))); public static final Holder UNAPPEND = make("unappend", new OperationAction(HexPattern.fromAngleString("qaeaq", HexDir.NORTH_WEST))); - // public static final Holder CONCAT = REGISTER.registerHolder("concat", () -> + // public static final Holder CONCAT = REGISTRAR.registerHolder("concat", () -> // new ActionRegistryEntry(HexPattern.fromAngles("qaeaq", HexDir.NORTH_WEST), OpConcat.INSTANCE)); public static final Holder INDEX = make("index", new OperationAction(HexPattern.fromAngleString("deeed", HexDir.NORTH_WEST))); - // public static final Holder LIST_SIZE = REGISTER.registerHolder("list_size", () -> + // public static final Holder LIST_SIZE = REGISTRAR.registerHolder("list_size", () -> // new ActionRegistryEntry(HexPattern.fromAngles("aqaeaq", HexDir.EAST), OpListSize.INSTANCE)); - public static final Holder SINGLETON = REGISTER.registerHolder("singleton", () -> + public static final Holder SINGLETON = REGISTRAR.registerHolder("singleton", () -> new ActionRegistryEntry(HexPattern.fromAngleString("adeeed", HexDir.EAST), OpSingleton.INSTANCE)); - public static final Holder EMPTY_LIST = REGISTER.registerHolder("empty_list", () -> + public static final Holder EMPTY_LIST = REGISTRAR.registerHolder("empty_list", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qqaeaae", HexDir.NORTH_EAST), OpEmptyList.INSTANCE)); public static final Holder REVERSE = make("reverse", new OperationAction(HexPattern.fromAngleString("qqqaede", HexDir.EAST))); - public static final Holder LAST_N_LIST = REGISTER.registerHolder("last_n_list", () -> + public static final Holder LAST_N_LIST = REGISTRAR.registerHolder("last_n_list", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ewdqdwe", HexDir.SOUTH_WEST), OpLastNToList.INSTANCE)); - public static final Holder SPLAT = REGISTER.registerHolder("splat", () -> + public static final Holder SPLAT = REGISTRAR.registerHolder("splat", () -> new ActionRegistryEntry(HexPattern.fromAngleString("qwaeawq", HexDir.NORTH_WEST), OpSplat.INSTANCE)); public static final Holder INDEX_OF = make("index_of", new OperationAction(HexPattern.fromAngleString("dedqde", HexDir.EAST))); @@ -605,14 +605,14 @@ public static void register() { // Xplat interops static { if (PehkuiInterop.isActive()) { - REGISTER.registerHolder("interop/pehkui/get", () -> + REGISTRAR.registerHolder("interop/pehkui/get", () -> new ActionRegistryEntry(HexPattern.fromAngleString("aawawwawwa", HexDir.NORTH_WEST), OpGetScale.INSTANCE)); - REGISTER.registerHolder("interop/pehkui/set", () -> + REGISTRAR.registerHolder("interop/pehkui/set", () -> new ActionRegistryEntry(HexPattern.fromAngleString("ddwdwwdwwd", HexDir.NORTH_EAST), OpSetScale.INSTANCE)); } } public static Holder make(String name, OperationAction oa) { - return REGISTER.registerHolder(name, () -> new ActionRegistryEntry(oa.getPattern(), oa)); + return REGISTRAR.registerHolder(name, () -> new ActionRegistryEntry(oa.getPattern(), oa)); } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexArithmetics.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexArithmetics.java index 81c5938fde..91ec196185 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexArithmetics.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexArithmetics.java @@ -5,26 +5,20 @@ import at.petrak.hexcasting.common.casting.arithmetic.*; import at.petrak.hexcasting.common.lib.HexRegistries; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; import java.util.stream.Collectors; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - public class HexArithmetics { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.ARITHMETIC); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.ARITHMETIC); private static ArithmeticEngine ENGINE; public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } public static ArithmeticEngine getEngine() { @@ -36,10 +30,10 @@ public static ArithmeticEngine getEngine() { public static final Registry REGISTRY = IXplatAbstractions.INSTANCE.getArithmeticRegistry(); - public static Supplier DOUBLE = REGISTER.register("double", () -> DoubleArithmetic.INSTANCE); - public static Supplier VEC3 = REGISTER.register("vec3", () -> Vec3Arithmetic.INSTANCE); - public static Supplier LIST = REGISTER.register("list", () -> ListArithmetic.INSTANCE); - public static Supplier BOOL = REGISTER.register("bool", () -> BoolArithmetic.INSTANCE); - public static Supplier LIST_SET = REGISTER.register("list_set", () -> ListSetArithmetic.INSTANCE); - public static Supplier BITWISE_SET = REGISTER.register("bitwise_set", () -> BitwiseSetArithmetic.INSTANCE); + public static Supplier DOUBLE = REGISTRAR.register("double", () -> DoubleArithmetic.INSTANCE); + public static Supplier VEC3 = REGISTRAR.register("vec3", () -> Vec3Arithmetic.INSTANCE); + public static Supplier LIST = REGISTRAR.register("list", () -> ListArithmetic.INSTANCE); + public static Supplier BOOL = REGISTRAR.register("bool", () -> BoolArithmetic.INSTANCE); + public static Supplier LIST_SET = REGISTRAR.register("list_set", () -> ListSetArithmetic.INSTANCE); + public static Supplier BITWISE_SET = REGISTRAR.register("bitwise_set", () -> BitwiseSetArithmetic.INSTANCE); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexContinuationTypes.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexContinuationTypes.java index b8f1a339c2..6d5aadd79f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexContinuationTypes.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexContinuationTypes.java @@ -7,36 +7,30 @@ import at.petrak.hexcasting.api.casting.eval.vm.FrameForEach; import at.petrak.hexcasting.common.lib.HexRegistries; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; import javax.annotation.ParametersAreNonnullByDefault; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - /** * Stores the registry for continuation frame types, some utility methods, and all the types Hexcasting itself defines. */ @ParametersAreNonnullByDefault public class HexContinuationTypes { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.CONTINUATION_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.CONTINUATION_TYPE); public static final Registry> REGISTRY = IXplatAbstractions.INSTANCE.getContinuationTypeRegistry(); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } public static final String KEY_TYPE = HexAPI.MOD_ID + ":type", KEY_DATA = HexAPI.MOD_ID + ":data"; - public static final Supplier> EVALUATE = REGISTER.register("evaluate", () -> FrameEvaluate.TYPE); - public static final Supplier> FOREACH = REGISTER.register("foreach", () -> FrameForEach.TYPE); - public static final Supplier> END = REGISTER.register("end", () -> FrameFinishEval.TYPE); + public static final Supplier> EVALUATE = REGISTRAR.register("evaluate", () -> FrameEvaluate.TYPE); + public static final Supplier> FOREACH = REGISTRAR.register("foreach", () -> FrameForEach.TYPE); + public static final Supplier> END = REGISTRAR.register("end", () -> FrameFinishEval.TYPE); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexEvalSounds.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexEvalSounds.java index 85ae4c2419..434419e306 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexEvalSounds.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexEvalSounds.java @@ -4,38 +4,32 @@ import at.petrak.hexcasting.common.lib.HexRegistries; import at.petrak.hexcasting.common.lib.HexSounds; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; -import net.minecraft.resources.ResourceLocation; +import at.petrak.hexcasting.xplat.IXplatRegistrar; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - // TODO: we REALLY need a cleanup of how sounds work. again. public class HexEvalSounds { - private static final IXplatRegister REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.EVAL_SOUND); + private static final IXplatRegistrar REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.EVAL_SOUND); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier NOTHING = REGISTER.register("nothing", () -> + public static final Supplier NOTHING = REGISTRAR.register("nothing", () -> new EvalSound(null, Integer.MIN_VALUE)); - public static final Supplier NORMAL_EXECUTE = REGISTER.register("operator", () -> + public static final Supplier NORMAL_EXECUTE = REGISTRAR.register("operator", () -> new EvalSound(HexSounds.CAST_NORMAL.value(), 0)); - public static final Supplier SPELL = REGISTER.register("spell", () -> + public static final Supplier SPELL = REGISTRAR.register("spell", () -> new EvalSound(HexSounds.CAST_SPELL.value(), 1000)); - public static final Supplier HERMES = REGISTER.register("hermes", () -> + public static final Supplier HERMES = REGISTRAR.register("hermes", () -> new EvalSound(HexSounds.CAST_HERMES.value(), 2000)); - public static final Supplier THOTH = REGISTER.register("thoth", () -> + public static final Supplier THOTH = REGISTRAR.register("thoth", () -> new EvalSound(HexSounds.CAST_THOTH.value(), 2500)); - public static final Supplier MUTE = REGISTER.register("mute", () -> + public static final Supplier MUTE = REGISTRAR.register("mute", () -> new EvalSound(null, 3000)); - public static final Supplier MISHAP = REGISTER.register("mishap", () -> + public static final Supplier MISHAP = REGISTRAR.register("mishap", () -> new EvalSound(HexSounds.CAST_FAILURE.value(), 4000)); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexImageComponents.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexImageComponents.java index 1822d11c7c..4d1e5d68a8 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexImageComponents.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexImageComponents.java @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.casting.iota.IotaType; import at.petrak.hexcasting.common.lib.HexRegistries; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Registry; import java.util.function.Supplier; @@ -14,13 +14,13 @@ * Stores the registry for casting image components, and all the component types Hexcasting itself defines. */ public class HexImageComponents { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.IMAGE_COMPONENT); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.IMAGE_COMPONENT); public static final Registry> REGISTRY = IXplatAbstractions.INSTANCE.getImageComponentRegistry(); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier> RAVENMIND = REGISTER.register("ravenmind", () -> + public static final Supplier> RAVENMIND = REGISTRAR.register("ravenmind", () -> new ImageComponentType<>(IotaType.TYPED_CODEC, IotaType.TYPED_STREAM_CODEC, false)); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexIotaTypes.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexIotaTypes.java index 1d72eb8298..a9ff5440bd 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexIotaTypes.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexIotaTypes.java @@ -3,40 +3,34 @@ import at.petrak.hexcasting.api.casting.iota.*; import at.petrak.hexcasting.common.lib.HexRegistries; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; import javax.annotation.ParametersAreNonnullByDefault; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - /** * Stores the registry for iota types, some utility methods, and all the types Hexcasting itself defines. */ @ParametersAreNonnullByDefault public class HexIotaTypes { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.IOTA_TYPE); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.IOTA_TYPE); public static final Registry> REGISTRY = IXplatAbstractions.INSTANCE.getIotaTypeRegistry(); public static final int MAX_SERIALIZATION_DEPTH = 256; public static final int MAX_SERIALIZATION_TOTAL = 1024; public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier> NULL = REGISTER.register("null", () -> NullIota.TYPE); - public static final Supplier> DOUBLE = REGISTER.register("double", () -> DoubleIota.TYPE); - public static final Supplier> BOOLEAN = REGISTER.register("boolean", () -> BooleanIota.TYPE); - public static final Supplier> ENTITY = REGISTER.register("entity", () -> EntityIota.TYPE); - public static final Supplier> LIST = REGISTER.register("list", () -> ListIota.TYPE); - public static final Supplier> PATTERN = REGISTER.register("pattern", () -> PatternIota.TYPE); - public static final Supplier> GARBAGE = REGISTER.register("garbage", () -> GarbageIota.TYPE); - public static final Supplier> VEC3 = REGISTER.register("vec3", () -> Vec3Iota.TYPE); - public static final Supplier> CONTINUATION = REGISTER.register("continuation", () -> ContinuationIota.TYPE); + public static final Supplier> NULL = REGISTRAR.register("null", () -> NullIota.TYPE); + public static final Supplier> DOUBLE = REGISTRAR.register("double", () -> DoubleIota.TYPE); + public static final Supplier> BOOLEAN = REGISTRAR.register("boolean", () -> BooleanIota.TYPE); + public static final Supplier> ENTITY = REGISTRAR.register("entity", () -> EntityIota.TYPE); + public static final Supplier> LIST = REGISTRAR.register("list", () -> ListIota.TYPE); + public static final Supplier> PATTERN = REGISTRAR.register("pattern", () -> PatternIota.TYPE); + public static final Supplier> GARBAGE = REGISTRAR.register("garbage", () -> GarbageIota.TYPE); + public static final Supplier> VEC3 = REGISTRAR.register("vec3", () -> Vec3Iota.TYPE); + public static final Supplier> CONTINUATION = REGISTRAR.register("continuation", () -> ContinuationIota.TYPE); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexSpecialHandlers.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexSpecialHandlers.java index 06cb745dc3..ae53b16599 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexSpecialHandlers.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/hex/HexSpecialHandlers.java @@ -6,27 +6,21 @@ import at.petrak.hexcasting.common.casting.actions.stack.SpecialHandlerMask; import at.petrak.hexcasting.common.lib.HexRegistries; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; -import net.minecraft.resources.ResourceLocation; +import at.petrak.hexcasting.xplat.IXplatRegistrar; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - public class HexSpecialHandlers { - private static final IXplatRegister> REGISTER = IXplatAbstractions.INSTANCE.createRegistar(HexRegistries.SPECIAL_HANDLER); + private static final IXplatRegistrar> REGISTRAR = IXplatAbstractions.INSTANCE.createRegistrar(HexRegistries.SPECIAL_HANDLER); public static void register() { - REGISTER.registerAll(); + REGISTRAR.registerAll(); } - public static final Supplier> NUMBER = REGISTER.register("number", + public static final Supplier> NUMBER = REGISTRAR.register("number", SpecialHandlerNumberLiteral.Factory::new); - public static final Supplier> MASK = REGISTER.register("mask", + public static final Supplier> MASK = REGISTRAR.register("mask", SpecialHandlerMask.Factory::new); - public static final Supplier> FOR_EACH = REGISTER.register("for_each", + public static final Supplier> FOR_EACH = REGISTRAR.register("for_each", SpecialHandlerForEach.Factory::new); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/recipe/HexRecipeStuffRegistry.java b/Common/src/main/java/at/petrak/hexcasting/common/recipe/HexRecipeStuffRegistry.java index 1e1c26aa86..e5fe9047d0 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/recipe/HexRecipeStuffRegistry.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/recipe/HexRecipeStuffRegistry.java @@ -2,36 +2,29 @@ import at.petrak.hexcasting.api.HexAPI; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.BiConsumer; import java.util.function.Supplier; -import static at.petrak.hexcasting.api.HexAPI.modLoc; - public class HexRecipeStuffRegistry { - private static final IXplatRegister> REGISTER_SERIALIZER = IXplatAbstractions.INSTANCE.createRegistar(Registries.RECIPE_SERIALIZER); - private static final IXplatRegister> REGISTER_RECIPE_TYPE = IXplatAbstractions.INSTANCE.createRegistar(Registries.RECIPE_TYPE); + private static final IXplatRegistrar> REGISTRAR_SERIALIZER = IXplatAbstractions.INSTANCE.createRegistrar(Registries.RECIPE_SERIALIZER); + private static final IXplatRegistrar> REGISTRAR_RECIPE_TYPE = IXplatAbstractions.INSTANCE.createRegistrar(Registries.RECIPE_TYPE); public static void register() { - REGISTER_SERIALIZER.registerAll(); - REGISTER_RECIPE_TYPE.registerAll(); + REGISTRAR_SERIALIZER.registerAll(); + REGISTRAR_RECIPE_TYPE.registerAll(); } - public static final Supplier> BRAINSWEEP = REGISTER_SERIALIZER.register("brainsweep", BrainsweepRecipe.Serializer::new); - public static final Supplier> SEAL_FOCUS = REGISTER_SERIALIZER.register( + public static final Supplier> BRAINSWEEP = REGISTRAR_SERIALIZER.register("brainsweep", BrainsweepRecipe.Serializer::new); + public static final Supplier> SEAL_FOCUS = REGISTRAR_SERIALIZER.register( "seal_focus", () -> SealThingsRecipe.FOCUS_SERIALIZER); - public static final Supplier> SEAL_SPELLBOOK = REGISTER_SERIALIZER.register( + public static final Supplier> SEAL_SPELLBOOK = REGISTRAR_SERIALIZER.register( "seal_spellbook", () -> SealThingsRecipe.SPELLBOOK_SERIALIZER); - public static Supplier> BRAINSWEEP_TYPE = REGISTER_RECIPE_TYPE.register("brainsweep", () -> + public static Supplier> BRAINSWEEP_TYPE = REGISTRAR_RECIPE_TYPE.register("brainsweep", () -> new RecipeType() { @Override public String toString() { diff --git a/Common/src/main/java/at/petrak/hexcasting/xplat/DummyXplatAbstractions.kt b/Common/src/main/java/at/petrak/hexcasting/xplat/DummyXplatAbstractions.kt index 82edb9391d..c41fa73b99 100644 --- a/Common/src/main/java/at/petrak/hexcasting/xplat/DummyXplatAbstractions.kt +++ b/Common/src/main/java/at/petrak/hexcasting/xplat/DummyXplatAbstractions.kt @@ -119,7 +119,8 @@ internal class DummyXplatAbstractions: IXplatAbstractions { override fun isBreakingAllowed(world: ServerLevel, pos: BlockPos, state: BlockState, player: Player?): Boolean = error("Found use of DummyXplatAbstractions.") override fun isPlacingAllowed(world: ServerLevel, pos: BlockPos, blockStack: ItemStack, player: Player?): Boolean = error("Found use of DummyXplatAbstractions.") override fun getPehkuiApi(): PehkuiInterop.ApiAbstraction? = error("Found use of DummyXplatAbstractions.") - override fun createRegistar(registryKey: ResourceKey?>): IXplatRegister? = if(registryKey == HexRegistries.IOTA_TYPE) (object : IXplatRegister> { + override fun createRegistrar(registryKey: ResourceKey?>): IXplatRegistrar? = if(registryKey == HexRegistries.IOTA_TYPE) (object : + IXplatRegistrar> { val inner = iotaTypeRegistry override fun > register(id: String?, provider: Supplier?): Supplier { @@ -137,7 +138,7 @@ internal class DummyXplatAbstractions: IXplatAbstractions { override fun registerAll() { inner.freeze() } - }) as IXplatRegister? else error("Found use of DummyXplatAbstractions.") + }) as IXplatRegistrar? else error("Found use of DummyXplatAbstractions.") override fun getBrainsweepeeIngredientRegistry(): Registry?>? = error("Found use of DummyXplatAbstractions.") override fun getStateIngredientRegistry(): Registry?>? = error("Found use of DummyXplatAbstractions.") } diff --git a/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java b/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java index d7ebd88679..5b0ebd91f3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java +++ b/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java @@ -199,7 +199,7 @@ BlockEntityType createBlockEntityType(BiFunction} * @param */ - IXplatRegister createRegistar(ResourceKey> registryKey); + IXplatRegistrar createRegistrar(ResourceKey> registryKey); // interop diff --git a/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatRegister.java b/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatRegistrar.java similarity index 61% rename from Common/src/main/java/at/petrak/hexcasting/xplat/IXplatRegister.java rename to Common/src/main/java/at/petrak/hexcasting/xplat/IXplatRegistrar.java index 77130ba486..42e952d86b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatRegister.java +++ b/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatRegistrar.java @@ -5,11 +5,11 @@ import java.util.function.Supplier; /** - * A platform-agnostic registry of type {B}
- * FabricRegister registers directly while ForgeRegister uses deferred registry instead - * @param The Type the IXplatRegister is registering + * A platform-agnostic registrar for type {B}
+ * FabricRegistrar registers entries directly, while ForgeRegistrar uses a DeferredRegister instead + * @param The Type the IXplatRegistrar is registering */ -public interface IXplatRegister { +public interface IXplatRegistrar { Supplier register(String id, Supplier provider); diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricRegister.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricRegistrar.java similarity index 61% rename from Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricRegister.java rename to Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricRegistrar.java index d9659ad79d..cba469407e 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricRegister.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricRegistrar.java @@ -1,38 +1,36 @@ package at.petrak.hexcasting.fabric.xplat; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceKey; -import java.util.HashMap; -import java.util.Map; import java.util.function.Supplier; import static at.petrak.hexcasting.api.HexAPI.modLoc; -public class FabricRegister implements IXplatRegister { - private final Registry register; +public class FabricRegistrar implements IXplatRegistrar { + private final Registry registry; @SuppressWarnings("unchecked") - public FabricRegister(ResourceKey> registryKey) { - this.register = (Registry) BuiltInRegistries.REGISTRY.get(registryKey.location()); + public FabricRegistrar(ResourceKey> registryKey) { + this.registry = (Registry) BuiltInRegistries.REGISTRY.get(registryKey.location()); } @Override public Supplier register(String id, Supplier provider) { T value = provider.get(); - Registry.register(register, modLoc(id), value); + Registry.register(registry, modLoc(id), value); return () -> value; } @Override public Holder registerHolder(String id, Supplier provider) { T value = provider.get(); - Registry.register(register, modLoc(id), value); - return register.wrapAsHolder(value); + Registry.register(registry, modLoc(id), value); + return registry.wrapAsHolder(value); } @Override diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java index fe5ec47084..49b62c5cc8 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java @@ -30,7 +30,7 @@ import at.petrak.hexcasting.interop.HexInterop; import at.petrak.hexcasting.interop.pehkui.PehkuiInterop; import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import at.petrak.hexcasting.xplat.IXplatTags; import at.petrak.hexcasting.xplat.Platform; import com.mojang.serialization.Lifecycle; @@ -476,8 +476,8 @@ public boolean isPlacingAllowed(ServerLevel world, BlockPos pos, ItemStack block } @Override - public IXplatRegister createRegistar(ResourceKey> registryKey) { - return new FabricRegister<>(registryKey); + public IXplatRegistrar createRegistrar(ResourceKey> registryKey) { + return new FabricRegistrar<>(registryKey); } private static PehkuiInterop.ApiAbstraction PEHKUI_API = null; diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/network/ForgePacketHandler.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/network/ForgePacketHandler.java index c53a796a4e..ff97208067 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/network/ForgePacketHandler.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/network/ForgePacketHandler.java @@ -16,38 +16,38 @@ public class ForgePacketHandler { public static void init(IEventBus modBus) { modBus.addListener(RegisterPayloadHandlersEvent.class, ev -> { - final PayloadRegistrar registar = ev.registrar("1"); + final PayloadRegistrar registrar = ev.registrar("1"); // Client -> server - registar.playToServer(MsgNewSpellPatternC2S.TYPE, MsgNewSpellPatternC2S.STREAM_CODEC, + registrar.playToServer(MsgNewSpellPatternC2S.TYPE, MsgNewSpellPatternC2S.STREAM_CODEC, makeServerBoundHandler(MsgNewSpellPatternC2S::handle)); - registar.playToServer(MsgShiftScrollC2S.TYPE, MsgShiftScrollC2S.STREAM_CODEC, + registrar.playToServer(MsgShiftScrollC2S.TYPE, MsgShiftScrollC2S.STREAM_CODEC, makeServerBoundHandler(MsgShiftScrollC2S::handle)); // Server -> client - registar.playToClient(MsgNewSpellPatternS2C.TYPE, MsgNewSpellPatternS2C.STREAM_CODEC, + registrar.playToClient(MsgNewSpellPatternS2C.TYPE, MsgNewSpellPatternS2C.STREAM_CODEC, makeClientBoundHandler(MsgNewSpellPatternS2C::handle)); - registar.playToClient(MsgSentinelStatusUpdateAck.TYPE, MsgSentinelStatusUpdateAck.STREAM_CODEC, + registrar.playToClient(MsgSentinelStatusUpdateAck.TYPE, MsgSentinelStatusUpdateAck.STREAM_CODEC, makeClientBoundHandler(MsgSentinelStatusUpdateAck::handle)); - registar.playToClient(MsgPigmentUpdateAck.TYPE, MsgPigmentUpdateAck.STREAM_CODEC, + registrar.playToClient(MsgPigmentUpdateAck.TYPE, MsgPigmentUpdateAck.STREAM_CODEC, makeClientBoundHandler(MsgPigmentUpdateAck::handle)); - registar.playToClient(MsgAltioraUpdateAck.TYPE, MsgAltioraUpdateAck.STREAM_CODEC, + registrar.playToClient(MsgAltioraUpdateAck.TYPE, MsgAltioraUpdateAck.STREAM_CODEC, makeClientBoundHandler(MsgAltioraUpdateAck::handle)); - registar.playToClient(MsgCastParticleS2C.TYPE, MsgCastParticleS2C.STREAM_CODEC, + registrar.playToClient(MsgCastParticleS2C.TYPE, MsgCastParticleS2C.STREAM_CODEC, makeClientBoundHandler(MsgCastParticleS2C::handle)); - registar.playToClient(MsgOpenSpellGuiS2C.TYPE, MsgOpenSpellGuiS2C.STREAM_CODEC, + registrar.playToClient(MsgOpenSpellGuiS2C.TYPE, MsgOpenSpellGuiS2C.STREAM_CODEC, makeClientBoundHandler(MsgOpenSpellGuiS2C::handle)); - registar.playToClient(MsgBeepS2C.TYPE, MsgBeepS2C.STREAM_CODEC, + registrar.playToClient(MsgBeepS2C.TYPE, MsgBeepS2C.STREAM_CODEC, makeClientBoundHandler(MsgBeepS2C::handle)); - registar.playToClient(MsgBrainsweepAck.TYPE, MsgBrainsweepAck.STREAM_CODEC, + registrar.playToClient(MsgBrainsweepAck.TYPE, MsgBrainsweepAck.STREAM_CODEC, makeClientBoundHandler(MsgBrainsweepAck::handle)); - registar.playToClient(MsgNewWallScrollS2C.TYPE, MsgNewWallScrollS2C.STREAM_CODEC, + registrar.playToClient(MsgNewWallScrollS2C.TYPE, MsgNewWallScrollS2C.STREAM_CODEC, makeClientBoundHandler(MsgNewWallScrollS2C::handle)); - registar.playToClient(MsgRecalcWallScrollDisplayS2C.TYPE, MsgRecalcWallScrollDisplayS2C.STREAM_CODEC, + registrar.playToClient(MsgRecalcWallScrollDisplayS2C.TYPE, MsgRecalcWallScrollDisplayS2C.STREAM_CODEC, makeClientBoundHandler(MsgRecalcWallScrollDisplayS2C::handle)); - registar.playToClient(MsgNewSpiralPatternsS2C.TYPE, MsgNewSpiralPatternsS2C.STREAM_CODEC, + registrar.playToClient(MsgNewSpiralPatternsS2C.TYPE, MsgNewSpiralPatternsS2C.STREAM_CODEC, makeClientBoundHandler(MsgNewSpiralPatternsS2C::handle)); - registar.playToClient(MsgClearSpiralPatternsS2C.TYPE, MsgClearSpiralPatternsS2C.STREAM_CODEC, + registrar.playToClient(MsgClearSpiralPatternsS2C.TYPE, MsgClearSpiralPatternsS2C.STREAM_CODEC, makeClientBoundHandler(MsgClearSpiralPatternsS2C::handle)); }); } diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeRegister.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeRegistrar.java similarity index 53% rename from Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeRegister.java rename to Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeRegistrar.java index b4c7dd9f0e..1fa914de3e 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeRegister.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeRegistrar.java @@ -1,31 +1,31 @@ package at.petrak.hexcasting.forge.xplat; import at.petrak.hexcasting.forge.ForgeHexInitializer; -import at.petrak.hexcasting.xplat.IXplatRegister; +import at.petrak.hexcasting.xplat.IXplatRegistrar; import net.minecraft.core.Holder; import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.Supplier; -public class ForgeRegister implements IXplatRegister { - private final DeferredRegister register; +public class ForgeRegistrar implements IXplatRegistrar { + private final DeferredRegister deferredReg; - public ForgeRegister(DeferredRegister register) { - this.register = register; + public ForgeRegistrar(DeferredRegister deferredReg) { + this.deferredReg = deferredReg; } @Override public void registerAll() { - register.register(ForgeHexInitializer.getModEventBus()); + deferredReg.register(ForgeHexInitializer.getModEventBus()); } @Override public Supplier register(String id, Supplier provider) { - return register.register(id, provider); + return deferredReg.register(id, provider); } @Override public Holder registerHolder(String id, Supplier provider) { - return register.register(id, provider); + return deferredReg.register(id, provider); } } diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java index c0ceedef9e..72e01c0585 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java @@ -33,10 +33,7 @@ import at.petrak.hexcasting.forge.recipe.ForgeUnsealedIngredient; import at.petrak.hexcasting.interop.HexInterop; import at.petrak.hexcasting.interop.pehkui.PehkuiInterop; -import at.petrak.hexcasting.xplat.IXplatAbstractions; -import at.petrak.hexcasting.xplat.IXplatRegister; -import at.petrak.hexcasting.xplat.IXplatTags; -import at.petrak.hexcasting.xplat.Platform; +import at.petrak.hexcasting.xplat.*; import com.illusivesoulworks.caelus.api.CaelusApi; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -100,8 +97,8 @@ public class ForgeXplatImpl implements IXplatAbstractions { @Override - public IXplatRegister createRegistar(ResourceKey> registryKey) { - return new ForgeRegister<>(DeferredRegister.create(registryKey, HexAPI.MOD_ID)); + public IXplatRegistrar createRegistrar(ResourceKey> registryKey) { + return new ForgeRegistrar<>(DeferredRegister.create(registryKey, HexAPI.MOD_ID)); } @Override