跳转至内容

论坛Tag征求

壁画石窟
4 3 342 1

相关推荐


  • [原创]使用kjs进行文件的删除

    灵感大王 kubejs 危险行为 数据操作
    4
    0 赞同
    4 帖子
    324 浏览
    草莓呜咩B
    @芒果凍布丁 我揣测Client可能被安全化了,所以loadClass,能直接用的话就安全多了呢。
  • [1.20.1]强制加载并渲染特定区块

    灵感大王 渲染 forge
    5
    1 赞同
    5 帖子
    344 浏览
    忆然
    @Mafuyu 区块强制加载有用(点头
  • 1 赞同
    5 帖子
    360 浏览
    不是客服M
    翻了一下Forge原生的有这些 public static final RegistryObject<Codec<NoneBiomeModifier>> NONE_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("none", () -> Codec.unit(NoneBiomeModifier.INSTANCE)); /** * Stock biome modifier for adding features to biomes. */ public static final RegistryObject<Codec<AddFeaturesBiomeModifier>> ADD_FEATURES_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("add_features", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(AddFeaturesBiomeModifier::biomes), PlacedFeature.LIST_CODEC.fieldOf("features").forGetter(AddFeaturesBiomeModifier::features), Decoration.CODEC.fieldOf("step").forGetter(AddFeaturesBiomeModifier::step) ).apply(builder, AddFeaturesBiomeModifier::new)) ); /** * Stock biome modifier for removing features from biomes. */ public static final RegistryObject<Codec<RemoveFeaturesBiomeModifier>> REMOVE_FEATURES_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("remove_features", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(RemoveFeaturesBiomeModifier::biomes), PlacedFeature.LIST_CODEC.fieldOf("features").forGetter(RemoveFeaturesBiomeModifier::features), new ExtraCodecs.EitherCodec<List<Decoration>, Decoration>(Decoration.CODEC.listOf(), Decoration.CODEC).<Set<Decoration>>xmap( either -> either.map(Set::copyOf, Set::of), // convert list/singleton to set when decoding set -> set.size() == 1 ? Either.right(set.toArray(Decoration[]::new)[0]) : Either.left(List.copyOf(set)) ).optionalFieldOf("steps", EnumSet.allOf(Decoration.class)).forGetter(RemoveFeaturesBiomeModifier::steps) ).apply(builder, RemoveFeaturesBiomeModifier::new)) ); /** * Stock biome modifier for adding mob spawns to biomes. */ public static final RegistryObject<Codec<AddSpawnsBiomeModifier>> ADD_SPAWNS_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("add_spawns", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(AddSpawnsBiomeModifier::biomes), // Allow either a list or single spawner, attempting to decode the list format first. // Uses the better EitherCodec that logs both errors if both formats fail to parse. new ExtraCodecs.EitherCodec<>(SpawnerData.CODEC.listOf(), SpawnerData.CODEC).xmap( either -> either.map(Function.identity(), List::of), // convert list/singleton to list when decoding list -> list.size() == 1 ? Either.right(list.get(0)) : Either.left(list) // convert list to singleton/list when encoding ).fieldOf("spawners").forGetter(AddSpawnsBiomeModifier::spawners) ).apply(builder, AddSpawnsBiomeModifier::new)) ); /** * Stock biome modifier for removing mob spawns from biomes. */ public static final RegistryObject<Codec<RemoveSpawnsBiomeModifier>> REMOVE_SPAWNS_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("remove_spawns", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(RemoveSpawnsBiomeModifier::biomes), RegistryCodecs.homogeneousList(ForgeRegistries.Keys.ENTITY_TYPES).fieldOf("entity_types").forGetter(RemoveSpawnsBiomeModifier::entityTypes) ).apply(builder, RemoveSpawnsBiomeModifier::new)) );