Paper/CraftBukkit-Patches/0137-Don-t-let-trees-replace-any-block.patch

28 lines
1.3 KiB
Diff
Raw Normal View History

2014-06-22 11:25:10 +02:00
From 78b4967cb13b8f992a095cfc647280f2842ac204 Mon Sep 17 00:00:00 2001
2014-04-12 06:18:37 +02:00
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Mon, 20 Jan 2014 20:42:28 +0000
2014-04-24 08:27:12 +02:00
Subject: [PATCH] Don't let trees replace any block.
2014-04-12 06:18:37 +02:00
diff --git a/src/main/java/net/minecraft/server/WorldGenForestTree.java b/src/main/java/net/minecraft/server/WorldGenForestTree.java
2014-04-24 08:27:12 +02:00
index 63c5af6..a758179 100644
2014-04-12 06:18:37 +02:00
--- a/src/main/java/net/minecraft/server/WorldGenForestTree.java
+++ b/src/main/java/net/minecraft/server/WorldGenForestTree.java
2014-04-24 08:27:12 +02:00
@@ -124,7 +124,12 @@ public class WorldGenForestTree extends WorldGenTreeAbstract {
2014-04-12 06:18:37 +02:00
int k3;
for (k3 = 0; k3 < j3; ++k3) {
- this.setTypeAndData(world, i + l2, k2 - k3 - 1, k + i3, Blocks.LOG2, 1);
+ Block block = world.getType(i + l2, k2 - k3 - 1, k + i3);
+
+ if (block.getMaterial() == Material.AIR || block.getMaterial() == Material.LEAVES)
+ {
+ this.setTypeAndData(world, i + l2, k2 - k3 - 1, k + i3, Blocks.LOG2, 1);
+ }
}
int l3;
--
2014-04-19 01:15:23 +02:00
1.9.1
2014-04-12 06:18:37 +02:00