mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Update to 1.18.2
This commit is contained in:
77
patches/server/0271-Fix-compile-errors.patch
Normal file
77
patches/server/0271-Fix-compile-errors.patch
Normal file
@@ -0,0 +1,77 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||
Date: Tue, 1 Mar 2022 17:03:44 -0600
|
||||
Subject: [PATCH] Fix compile errors
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
index 74b446bde17ff023fb19c422d15993fb1f4b3d69..e23d835557b02a1a882cfc8ae59e7d767e5ffe12 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
@@ -37,6 +37,32 @@ import net.minecraft.world.level.material.Fluids;
|
||||
public final class Biome {
|
||||
public static final Codec<Biome> DIRECT_CODEC;
|
||||
public static final Codec<Biome> NETWORK_CODEC;
|
||||
+ static {
|
||||
+ DIRECT_CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
+ return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> {
|
||||
+ return biome.climateSettings;
|
||||
+ }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> {
|
||||
+ return biome.biomeCategory;
|
||||
+ }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> {
|
||||
+ return biome.specialEffects;
|
||||
+ }), BiomeGenerationSettings.CODEC.forGetter((biome) -> {
|
||||
+ return biome.generationSettings;
|
||||
+ }), MobSpawnSettings.CODEC.forGetter((biome) -> {
|
||||
+ return biome.mobSettings;
|
||||
+ })).apply(instance, Biome::new);
|
||||
+ });
|
||||
+ NETWORK_CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
+ return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> {
|
||||
+ return biome.climateSettings;
|
||||
+ }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> {
|
||||
+ return biome.biomeCategory;
|
||||
+ }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> {
|
||||
+ return biome.specialEffects;
|
||||
+ })).apply(instance, (weather, category, effects) -> {
|
||||
+ return new Biome(weather, category, effects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY);
|
||||
+ });
|
||||
+ });
|
||||
+ }
|
||||
public static final Codec<Holder<Biome>> CODEC = RegistryFileCodec.create(Registry.BIOME_REGISTRY, DIRECT_CODEC);
|
||||
public static final Codec<HolderSet<Biome>> LIST_CODEC = RegistryCodecs.homogeneousList(Registry.BIOME_REGISTRY, DIRECT_CODEC);
|
||||
private static final PerlinSimplexNoise TEMPERATURE_NOISE = new PerlinSimplexNoise(new WorldgenRandom(new LegacyRandomSource(1234L)), ImmutableList.of(0));
|
||||
@@ -257,33 +283,6 @@ public final class Biome {
|
||||
return biomeEntry.value().getBiomeCategory();
|
||||
}
|
||||
|
||||
- static {
|
||||
- DIRECT_CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
- return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> {
|
||||
- return biome.climateSettings;
|
||||
- }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> {
|
||||
- return biome.biomeCategory;
|
||||
- }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> {
|
||||
- return biome.specialEffects;
|
||||
- }), BiomeGenerationSettings.CODEC.forGetter((biome) -> {
|
||||
- return biome.generationSettings;
|
||||
- }), MobSpawnSettings.CODEC.forGetter((biome) -> {
|
||||
- return biome.mobSettings;
|
||||
- })).apply(instance, Biome::new);
|
||||
- });
|
||||
- NETWORK_CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
- return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> {
|
||||
- return biome.climateSettings;
|
||||
- }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> {
|
||||
- return biome.biomeCategory;
|
||||
- }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> {
|
||||
- return biome.specialEffects;
|
||||
- })).apply(instance, (weather, category, effects) -> {
|
||||
- return new Biome(weather, category, effects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY);
|
||||
- });
|
||||
- });
|
||||
- }
|
||||
-
|
||||
public static class BiomeBuilder {
|
||||
@Nullable
|
||||
private Biome.Precipitation precipitation;
|
||||
Reference in New Issue
Block a user