This commit is contained in:
gnembon committed 2025-11-04 18:04:16 +01:00
1 parent 2ddfdddb89
commit 0a146e1d4e
36 files changed
+115 -115

No files matched your search

@@ -30,7 +30,7 @@ import carpet.script.value.ValueConversions;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.LongSet;
import net.minecraft.Util;
import net.minecraft.util.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
@@ -87,7 +87,7 @@ import java.util.stream.Stream;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.game.ClientboundExplodePacket;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionResult;
@@ -397,7 +397,7 @@ public class WorldAccess
return Value.TRUE;
}
String poiTypeString = poi.getString().toLowerCase(Locale.ROOT);
ResourceLocation resource = InputValidator.identifierOf(poiTypeString);
Identifier resource = InputValidator.identifierOf(poiTypeString);
Registry<PoiType> poiReg = cc.registry(Registries.POINT_OF_INTEREST_TYPE);
PoiType type = poiReg.getOptional(resource)
.orElseThrow(() -> new ThrowStatement(poiTypeString, Throwables.UNKNOWN_POI));
@@ -1228,9 +1228,9 @@ public class WorldAccess
Registry<Block> blocks = cc.registry(Registries.BLOCK);
if (lv.isEmpty())
{
return ListValue.wrap(blocks.listElements().map(blockReference -> ValueConversions.of(blockReference.key().location())));
return ListValue.wrap(blocks.listElements().map(blockReference -> ValueConversions.of(blockReference.key().identifier())));
}
ResourceLocation tag = InputValidator.identifierOf(lv.get(0).getString());
Identifier tag = InputValidator.identifierOf(lv.get(0).getString());
Optional<HolderSet.Named<Block>> tagset = blocks.get(TagKey.create(Registries.BLOCK, tag));
return tagset.isEmpty() ? Value.NULL : ListValue.wrap(tagset.get().stream().map(b -> ValueConversions.of(blocks.getKey(b.value()))));
});
@@ -1259,7 +1259,7 @@ public class WorldAccess
ServerLevel world = cc.level();
if (lv.isEmpty())
{
return ListValue.wrap(cc.registry(Registries.BIOME).listElements().map(biomeReference -> ValueConversions.of(biomeReference.key().location())));
return ListValue.wrap(cc.registry(Registries.BIOME).listElements().map(biomeReference -> ValueConversions.of(biomeReference.key().identifier())));
}
Biome biome;
@@ -1296,7 +1296,7 @@ public class WorldAccess
Climate.quantizeCoord(numberGetOrThrow(weirdness))
);
biome = mnbs.getNoiseBiome(point).value();
ResourceLocation biomeId = cc.registry(Registries.BIOME).getKey(biome);
Identifier biomeId = cc.registry(Registries.BIOME).getKey(biome);
return NBTSerializableValue.nameFromRegistryId(biomeId);
}
@@ -1317,7 +1317,7 @@ public class WorldAccess
// in locatebiome
if (locator.offset == lv.size())
{
ResourceLocation biomeId = cc.registry(Registries.BIOME).getKey(biome);
Identifier biomeId = cc.registry(Registries.BIOME).getKey(biome);
return NBTSerializableValue.nameFromRegistryId(biomeId);
}
String biomeFeature = lv.get(locator.offset).getString();
@@ -1433,7 +1433,7 @@ public class WorldAccess
if (!requested.isNull())
{
String reqString = requested.getString();
ResourceLocation id = InputValidator.identifierOf(reqString);
Identifier id = InputValidator.identifierOf(reqString);
Structure requestedStructure = reg.getValue(id);
if (requestedStructure != null)
{