This commit is contained in:
gnembon committed 2024-08-28 23:43:40 +02:00
1 parent 7ee1baab2c
commit 5e89cc6ddb
23 files changed
+80 -80

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ public class BlockInfo
BlockState state = world.getBlockState(pos);
Block block = state.getBlock();
String metastring = "";
final Registry<Block> blocks = world.registryAccess().registryOrThrow(Registries.BLOCK);
final Registry<Block> blocks = world.registryAccess().lookupOrThrow(Registries.BLOCK);
for (net.minecraft.world.level.block.state.properties.Property<?> iproperty : state.getProperties())
{
metastring += ", "+iproperty.getName() + '='+state.getValue(iproperty);
@@ -279,11 +279,11 @@ public class CarpetProfiler
final RegistryAccess regs = section.getKey().registryAccess();
if (section.getValue() instanceof EntityType)
{
id = regs.registryOrThrow(Registries.ENTITY_TYPE).getKey((EntityType<?>) section.getValue());
id = regs.lookupOrThrow(Registries.ENTITY_TYPE).getKey((EntityType<?>) section.getValue());
}
else
{
id = regs.registryOrThrow(Registries.BLOCK_ENTITY_TYPE).getKey((BlockEntityType<?>) section.getValue());
id = regs.lookupOrThrow(Registries.BLOCK_ENTITY_TYPE).getKey((BlockEntityType<?>) section.getValue());
}
String name = "minecraft".equals(id.getNamespace())?id.getPath():id.toString();
if (section.getKey().isClientSide)
+1 -1
View File
@@ -64,7 +64,7 @@ public class MobAI
{
types.addAll(type.types);
}
return types.stream().map(t -> source.registryAccess().registryOrThrow(Registries.ENTITY_TYPE).getKey(t).getPath());
return types.stream().map(t -> source.registryAccess().lookupOrThrow(Registries.ENTITY_TYPE).getKey(t).getPath());
}
public static Stream<String> availableFor(EntityType<?> entityType)
@@ -54,7 +54,7 @@ public class SpawnOverrides {
public static WeightedRandomList<MobSpawnSettings.SpawnerData> test(StructureManager structureFeatureManager, LongSet foo,
MobCategory cat, Structure confExisting, BlockPos where) {
ResourceLocation resource = structureFeatureManager.registryAccess().registryOrThrow(Registries.STRUCTURE).getKey(confExisting);
ResourceLocation resource = structureFeatureManager.registryAccess().lookupOrThrow(Registries.STRUCTURE).getKey(confExisting);
ResourceKey<Structure> key = ResourceKey.create(Registries.STRUCTURE, resource);
final Pair<BooleanSupplier, StructureSpawnOverride> spawnData = carpetOverrides.get(Pair.of(cat, key));
if (spawnData == null || !spawnData.getKey().getAsBoolean()) return null;
@@ -76,7 +76,7 @@ public class SpawnOverrides {
public static boolean isStructureAtPosition(ServerLevel level, ResourceKey<Structure> structureKey, BlockPos pos)
{
final Structure fortressFeature = level.registryAccess().registryOrThrow(Registries.STRUCTURE).get(structureKey);
final Structure fortressFeature = level.registryAccess().lookupOrThrow(Registries.STRUCTURE).getValue(structureKey);
if (fortressFeature == null) {
return false;
}