45a great reg split
This commit is contained in:
1 parent
48c804fcaa
commit
cda6994cae
28 files changed
+164
-153
No files matched your search
@@ -12,12 +12,11 @@ import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
|
||||
public class BiomeInfo
|
||||
{
|
||||
@@ -25,7 +24,7 @@ public class BiomeInfo
|
||||
//put("top_material", (w, b) -> new BlockValue( b.getGenerationSettings(). getSurfaceConfig().getTopMaterial(), null, null));
|
||||
//put("under_material", (w, b) -> new BlockValue( b.getGenerationSettings().getSurfaceConfig().getUnderMaterial(), null, null));
|
||||
//put("category", (w, b) -> StringValue.of(Biome.getBiomeCategory(Holder.direct(b)).getName()));
|
||||
put("tags", (w, b) -> ListValue.wrap(w.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getTags().filter(p -> p.getSecond().stream().anyMatch(h -> h.value() == b)).map(p -> p.getFirst().location()).map(ValueConversions::of).collect(Collectors.toList())));
|
||||
put("tags", (w, b) -> ListValue.wrap(w.registryAccess().registryOrThrow(Registries.BIOME).getTags().filter(p -> p.getSecond().stream().anyMatch(h -> h.value() == b)).map(p -> p.getFirst().location()).map(ValueConversions::of).collect(Collectors.toList())));
|
||||
|
||||
put("temperature", (w, b) -> NumericValue.of(b.getBaseTemperature()));
|
||||
put("fog_color", (w, b) -> ValueConversions.ofRGB(b.getSpecialEffects().getFogColor()));
|
||||
@@ -39,7 +38,7 @@ public class BiomeInfo
|
||||
//put("scale", (w, b) -> NumericValue.of(b.getScale()));
|
||||
put("features", (w, b) -> {
|
||||
|
||||
Registry<ConfiguredFeature<?,?>> registry = w.registryAccess().registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY);
|
||||
Registry<ConfiguredFeature<?,?>> registry = w.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE);
|
||||
return ListValue.wrap(
|
||||
b.getGenerationSettings().features().stream().map(step ->
|
||||
ListValue.wrap(step.stream().map(cfp ->
|
||||
|
||||
@@ -29,9 +29,10 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import net.minecraft.commands.arguments.ParticleArgument;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.nbt.ByteTag;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.DoubleTag;
|
||||
@@ -179,7 +180,7 @@ public class ShapeDispatcher
|
||||
return particle;
|
||||
try
|
||||
{
|
||||
particle = ParticleArgument.readParticle(new StringReader(name), regs.lookupOrThrow(Registry.PARTICLE_TYPE_REGISTRY));
|
||||
particle = ParticleArgument.readParticle(new StringReader(name), regs.lookupOrThrow(Registries.PARTICLE_TYPE));
|
||||
}
|
||||
catch (CommandSyntaxException e)
|
||||
{
|
||||
@@ -348,7 +349,7 @@ public class ShapeDispatcher
|
||||
|
||||
key = 0;
|
||||
followEntity = -1;
|
||||
shapeDimension = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(options.get("dim").getString()));
|
||||
shapeDimension = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(options.get("dim").getString()));
|
||||
if (options.containsKey("follow"))
|
||||
{
|
||||
followEntity = NumericValue.asNumber(options.getOrDefault("follow", optional.get("follow"))).getInt();
|
||||
@@ -650,11 +651,11 @@ public class ShapeDispatcher
|
||||
if(this.isitem)
|
||||
{
|
||||
if (Block.byItem(this.item.getItem()).defaultBlockState().isAir()) return;
|
||||
particle = getParticleData("block_marker "+Registry.BLOCK.getKey(Block.byItem(this.item.getItem())), p.level.registryAccess());
|
||||
particle = getParticleData("block_marker "+ BuiltInRegistries.BLOCK.getKey(Block.byItem(this.item.getItem())), p.level.registryAccess());
|
||||
}
|
||||
else
|
||||
{
|
||||
particle = getParticleData("block_marker "+Registry.BLOCK.getKey(this.blockState.getBlock()), p.level.registryAccess());
|
||||
particle = getParticleData("block_marker "+BuiltInRegistries.BLOCK.getKey(this.blockState.getBlock()), p.level.registryAccess());
|
||||
}
|
||||
|
||||
Vec3 v = relativiseRender(p.level, this.pos, 0);
|
||||
@@ -1324,7 +1325,7 @@ public class ShapeDispatcher
|
||||
|
||||
@Override
|
||||
public Value decode(Tag tag, Level level) {
|
||||
BlockState bs = NbtUtils.readBlockState(level.holderLookup(Registry.BLOCK_REGISTRY), (CompoundTag) tag);
|
||||
BlockState bs = NbtUtils.readBlockState(level.holderLookup(Registries.BLOCK), (CompoundTag) tag);
|
||||
CompoundTag compoundTag2 = null;
|
||||
if (((CompoundTag) tag).contains("TileEntityData", 10)) {
|
||||
compoundTag2 = ((CompoundTag) tag).getCompound("TileEntityData");
|
||||
|
||||
Reference in new issue
Block a user