diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-21 12:35:22 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-21 12:35:22 +0100 |
commit | c4197fe02bcc1250f1e41eed98fff0fe5cf76351 (patch) | |
tree | d8c176c93c337e643ab0540a1eb0a6173023f22c /src | |
parent | a03328d251b3a3d12879f9a7002acd253ece73bd (diff) | |
download | funny-teleporters-c4197fe02bcc1250f1e41eed98fff0fe5cf76351.tar.gz funny-teleporters-c4197fe02bcc1250f1e41eed98fff0fe5cf76351.tar.bz2 funny-teleporters-c4197fe02bcc1250f1e41eed98fff0fe5cf76351.zip |
Hide data component types
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/moe/nea/funnyteleporters/FunnyRegistry.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/moe/nea/funnyteleporters/FunnyRegistry.java b/src/main/java/moe/nea/funnyteleporters/FunnyRegistry.java index c42f4e4..ff3cb50 100644 --- a/src/main/java/moe/nea/funnyteleporters/FunnyRegistry.java +++ b/src/main/java/moe/nea/funnyteleporters/FunnyRegistry.java @@ -4,6 +4,7 @@ import com.mojang.serialization.Codec; import eu.pb4.polymer.core.api.block.PolymerBlockUtils; import eu.pb4.polymer.core.api.block.SimplePolymerBlock; import eu.pb4.polymer.core.api.item.PolymerBlockItem; +import eu.pb4.polymer.rsm.api.RegistrySyncUtils; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.Blocks; @@ -25,8 +26,8 @@ public class FunnyRegistry { .strength(10F), Blocks.GREEN_WOOL), Items.GREEN_WOOL); public static TeleporterBlock TELEPORTER = registerBlock("teleporter", new TeleporterBlock(AbstractBlock.Settings.create() - .pistonBehavior(PistonBehavior.BLOCK) - .strength(50F, 1200F)), Items.SEA_LANTERN); + .pistonBehavior(PistonBehavior.BLOCK) + .strength(50F, 1200F)), Items.SEA_LANTERN); public static ComponentType<TeleporterDestination> TELEPORTER_DESTINATION = registerComponentType("teleporter_destination", TeleporterDestination.CODEC); @@ -36,7 +37,9 @@ public class FunnyRegistry { public static TeleporterWand TELEPORTER_WAND = registerItem("teleporter_wand", new TeleporterWand(new Item.Settings().maxCount(1))); private static <T> ComponentType<T> registerComponentType(String name, Codec<T> codec) { - return Registry.register(Registries.DATA_COMPONENT_TYPE, FunnyTeleporters.id(name), ComponentType.<T>builder().codec(codec).build()); + var comp = Registry.register(Registries.DATA_COMPONENT_TYPE, FunnyTeleporters.id(name), ComponentType.<T>builder().codec(codec).build()); + RegistrySyncUtils.setServerEntry(Registries.DATA_COMPONENT_TYPE, comp); + return comp; } private static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String name, BlockEntityType.Builder<T> builder) { |