diff --git a/src/main/java/carpet/script/api/Auxiliary.java b/src/main/java/carpet/script/api/Auxiliary.java index 3ad9f989..fe2de599 100644 --- a/src/main/java/carpet/script/api/Auxiliary.java +++ b/src/main/java/carpet/script/api/Auxiliary.java @@ -133,7 +133,7 @@ public class Auxiliary CarpetContext cc = (CarpetContext) c; if (lv.isEmpty()) { - return ListValue.wrap(cc.registry(Registries.SOUND_EVENT).keySet().stream().map(ValueConversions::of)); + return ListValue.wrap(cc.registry(Registries.SOUND_EVENT).holders().map(soundEventReference -> ValueConversions.of(soundEventReference.key().location()))); } String rawString = lv.get(0).getString(); ResourceLocation soundName = InputValidator.identifierOf(rawString); @@ -181,7 +181,7 @@ public class Auxiliary CarpetContext cc = (CarpetContext) c; if (lv.isEmpty()) { - return ListValue.wrap(cc.registry(Registries.PARTICLE_TYPE).keySet().stream().map(ValueConversions::of)); + return ListValue.wrap(cc.registry(Registries.PARTICLE_TYPE).holders().map(particleTypeReference -> ValueConversions.of(particleTypeReference.key().location()))); } MinecraftServer ms = cc.server(); ServerLevel world = cc.level(); diff --git a/src/main/java/carpet/script/api/Inventories.java b/src/main/java/carpet/script/api/Inventories.java index 327ea5fc..755369d1 100644 --- a/src/main/java/carpet/script/api/Inventories.java +++ b/src/main/java/carpet/script/api/Inventories.java @@ -29,6 +29,7 @@ import java.util.Optional; import java.util.Set; import net.minecraft.commands.arguments.item.ItemInput; +import net.minecraft.core.Holder; import net.minecraft.core.HolderSet; import net.minecraft.core.Registry; import net.minecraft.core.RegistryAccess; @@ -36,6 +37,7 @@ import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; import net.minecraft.tags.TagKey; @@ -71,7 +73,7 @@ public class Inventories Registry items = cc.registry(Registries.ITEM); if (lv.isEmpty()) { - return ListValue.wrap(items.keySet().stream().map(ValueConversions::of)); + return ListValue.wrap(items.holders().map(itemReference -> ValueConversions.of(itemReference.key().location()))); } String tag = lv.get(0).getString(); Optional> itemTag = items.getTag(TagKey.create(Registries.ITEM, InputValidator.identifierOf(tag))); diff --git a/src/main/java/carpet/script/api/WorldAccess.java b/src/main/java/carpet/script/api/WorldAccess.java index 012d931f..6ac05861 100644 --- a/src/main/java/carpet/script/api/WorldAccess.java +++ b/src/main/java/carpet/script/api/WorldAccess.java @@ -1225,7 +1225,7 @@ public class WorldAccess Registry blocks = cc.registry(Registries.BLOCK); if (lv.isEmpty()) { - return ListValue.wrap(blocks.keySet().stream().map(ValueConversions::of)); + return ListValue.wrap(blocks.holders().map(blockReference -> ValueConversions.of(blockReference.key().location()))); } ResourceLocation tag = InputValidator.identifierOf(lv.get(0).getString()); Optional> tagset = blocks.getTag(TagKey.create(Registries.BLOCK, tag)); @@ -1256,7 +1256,7 @@ public class WorldAccess ServerLevel world = cc.level(); if (lv.isEmpty()) { - return ListValue.wrap(world.registryAccess().registryOrThrow(Registries.BIOME).keySet().stream().map(ValueConversions::of)); + return ListValue.wrap(cc.registry(Registries.BIOME).holders().map(biomeReference -> ValueConversions.of(biomeReference.key().location()))); } Biome biome;