2
0
mirror of https://github.com/PaperMC/Paper.git synced 2024-12-09 06:50:32 +08:00

SPIGOT-5906: Huge Fungi tree generation

This commit is contained in:
md_5 2020-07-01 09:50:58 +10:00
parent fdf6017fa9
commit 5a6c529833
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 25 additions and 0 deletions
nms-patches
src/main/java/org/bukkit/craftbukkit

View File

@ -0,0 +1,16 @@
--- a/net/minecraft/server/BlockFungi.java
+++ b/net/minecraft/server/BlockFungi.java
@@ -38,6 +38,13 @@
@Override
public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
+ // CraftBukkit start
+ if (this == Blocks.WARPED_FUNGUS) {
+ BlockSapling.treeType = org.bukkit.TreeType.WARPED_FUNGUS;
+ } else if (this == Blocks.CRIMSON_FUNGUS) {
+ BlockSapling.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS;
+ }
+ // CraftBukkit end
((WorldGenFeatureConfigured) this.b.get()).a(worldserver, worldserver.getStructureManager(), worldserver.getChunkProvider().getChunkGenerator(), random, blockposition);
}
}

View File

@ -88,6 +88,7 @@ import net.minecraft.server.Ticket;
import net.minecraft.server.TicketType;
import net.minecraft.server.Unit;
import net.minecraft.server.Vec3D;
import net.minecraft.server.WorldGenFeatureHugeFungiConfiguration;
import net.minecraft.server.WorldGenerator;
import net.minecraft.server.WorldServer;
import org.apache.commons.lang.Validate;
@ -729,6 +730,14 @@ public class CraftWorld implements World {
case CHORUS_PLANT:
((BlockChorusFlower) Blocks.CHORUS_FLOWER).a(world, pos, rand, 8);
return true;
case CRIMSON_FUNGUS:
gen = WorldGenerator.HUGE_FUNGUS;
conf = WorldGenFeatureHugeFungiConfiguration.b;
break;
case WARPED_FUNGUS:
gen = WorldGenerator.HUGE_FUNGUS;
conf = WorldGenFeatureHugeFungiConfiguration.d;
break;
case TREE:
default:
gen = WorldGenerator.TREE;