Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -1,10 +1,10 @@
--- a/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
+++ b/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
@@ -38,6 +38,7 @@
@@ -37,6 +37,7 @@
if (worldgenfeatureconfigured == null) {
return false;
} else {
+ setTreeType(worldgenfeatureconfigured); // CraftBukkit
IBlockData iblockdata1 = Blocks.AIR.getBlockData();
IBlockData iblockdata1 = Blocks.AIR.defaultBlockState();
worldserver.setTypeAndData(blockposition.c(i, 0, j), iblockdata1, 4);
worldserver.setBlock(blockposition.offset(i, 0, j), iblockdata1, 4);

View File

@@ -1,11 +1,11 @@
--- a/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
+++ b/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
@@ -14,6 +14,12 @@
@@ -13,6 +13,12 @@
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.WorldGenFeatureConfigured;
import net.minecraft.world.level.levelgen.feature.configurations.WorldGenFeatureTreeConfiguration;
+// CraftBukkit start
+import net.minecraft.data.worldgen.BiomeDecoratorGroups;
+import net.minecraft.data.worldgen.features.TreeFeatures;
+import net.minecraft.world.level.block.BlockSapling;
+import org.bukkit.TreeType;
+// CraftBukkit end
@@ -13,56 +13,56 @@
public abstract class WorldGenTreeProvider {
public WorldGenTreeProvider() {}
@@ -27,6 +33,7 @@
@@ -26,6 +32,7 @@
if (worldgenfeatureconfigured == null) {
return false;
} else {
+ setTreeType(worldgenfeatureconfigured); // CraftBukkit
worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4);
if (worldgenfeatureconfigured.a(worldserver, chunkgenerator, random, blockposition)) {
worldserver.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 4);
if (worldgenfeatureconfigured.place(worldserver, chunkgenerator, random, blockposition)) {
return true;
@@ -52,4 +59,48 @@
@@ -51,4 +58,48 @@
return true;
}
+
+ // CraftBukkit start
+ protected void setTreeType(WorldGenFeatureConfigured<?, ?> worldgentreeabstract) {
+ if (worldgentreeabstract == BiomeDecoratorGroups.OAK || worldgentreeabstract == BiomeDecoratorGroups.OAK_BEES_005) {
+ if (worldgentreeabstract == TreeFeatures.OAK || worldgentreeabstract == TreeFeatures.OAK_BEES_005) {
+ BlockSapling.treeType = TreeType.TREE;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.HUGE_RED_MUSHROOM) {
+ } else if (worldgentreeabstract == TreeFeatures.HUGE_RED_MUSHROOM) {
+ BlockSapling.treeType = TreeType.RED_MUSHROOM;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM) {
+ } else if (worldgentreeabstract == TreeFeatures.HUGE_BROWN_MUSHROOM) {
+ BlockSapling.treeType = TreeType.BROWN_MUSHROOM;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.JUNGLE_TREE) {
+ } else if (worldgentreeabstract == TreeFeatures.JUNGLE_TREE) {
+ BlockSapling.treeType = TreeType.COCOA_TREE;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.JUNGLE_TREE_NO_VINE) {
+ } else if (worldgentreeabstract == TreeFeatures.JUNGLE_TREE_NO_VINE) {
+ BlockSapling.treeType = TreeType.SMALL_JUNGLE;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.PINE) {
+ } else if (worldgentreeabstract == TreeFeatures.PINE) {
+ BlockSapling.treeType = TreeType.TALL_REDWOOD;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.SPRUCE) {
+ } else if (worldgentreeabstract == TreeFeatures.SPRUCE) {
+ BlockSapling.treeType = TreeType.REDWOOD;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.ACACIA) {
+ } else if (worldgentreeabstract == TreeFeatures.ACACIA) {
+ BlockSapling.treeType = TreeType.ACACIA;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.BIRCH || worldgentreeabstract == BiomeDecoratorGroups.BIRCH_BEES_005) {
+ } else if (worldgentreeabstract == TreeFeatures.BIRCH || worldgentreeabstract == TreeFeatures.BIRCH_BEES_005) {
+ BlockSapling.treeType = TreeType.BIRCH;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.SUPER_BIRCH_BEES_0002) {
+ } else if (worldgentreeabstract == TreeFeatures.SUPER_BIRCH_BEES_0002) {
+ BlockSapling.treeType = TreeType.TALL_BIRCH;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.SWAMP_OAK) {
+ } else if (worldgentreeabstract == TreeFeatures.SWAMP_OAK) {
+ BlockSapling.treeType = TreeType.SWAMP;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.FANCY_OAK || worldgentreeabstract == BiomeDecoratorGroups.FANCY_OAK_BEES_005) {
+ } else if (worldgentreeabstract == TreeFeatures.FANCY_OAK || worldgentreeabstract == TreeFeatures.FANCY_OAK_BEES_005) {
+ BlockSapling.treeType = TreeType.BIG_TREE;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.JUNGLE_BUSH) {
+ } else if (worldgentreeabstract == TreeFeatures.JUNGLE_BUSH) {
+ BlockSapling.treeType = TreeType.JUNGLE_BUSH;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.DARK_OAK) {
+ } else if (worldgentreeabstract == TreeFeatures.DARK_OAK) {
+ BlockSapling.treeType = TreeType.DARK_OAK;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.MEGA_SPRUCE) {
+ } else if (worldgentreeabstract == TreeFeatures.MEGA_SPRUCE) {
+ BlockSapling.treeType = TreeType.MEGA_REDWOOD;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.MEGA_PINE) {
+ } else if (worldgentreeabstract == TreeFeatures.MEGA_PINE) {
+ BlockSapling.treeType = TreeType.MEGA_REDWOOD;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.MEGA_JUNGLE_TREE) {
+ } else if (worldgentreeabstract == TreeFeatures.MEGA_JUNGLE_TREE) {
+ BlockSapling.treeType = TreeType.JUNGLE;
+ } else if (worldgentreeabstract == BiomeDecoratorGroups.AZALEA_TREE) {
+ } else if (worldgentreeabstract == TreeFeatures.AZALEA_TREE) {
+ BlockSapling.treeType = TreeType.AZALEA;
+ } else {
+ throw new IllegalArgumentException("Unknown tree generator " + worldgentreeabstract);