2014-07-03 03:47:25 +02:00
|
|
|
From 4a4bbb0cb896d1d224da7e5b319061ecf14fdfce Mon Sep 17 00:00:00 2001
|
2014-06-22 22:38:49 +02:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-06-24 14:21:58 +02:00
|
|
|
Date: Tue, 24 Jun 2014 07:44:59 -0500
|
2014-06-22 22:38:49 +02:00
|
|
|
Subject: [PATCH] Configurable cactus and reed natural growth heights
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
|
2014-07-03 03:47:25 +02:00
|
|
|
index f55e531..cc16f1d 100644
|
2014-06-22 22:38:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
|
|
|
|
@@ -4,6 +4,8 @@ import java.util.Random;
|
|
|
|
|
2014-06-24 14:21:58 +02:00
|
|
|
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
2014-06-22 22:38:49 +02:00
|
|
|
|
2014-07-03 03:47:25 +02:00
|
|
|
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
|
2014-06-22 22:38:49 +02:00
|
|
|
+
|
|
|
|
public class BlockCactus extends Block {
|
|
|
|
|
|
|
|
protected BlockCactus() {
|
|
|
|
@@ -20,7 +22,7 @@ public class BlockCactus extends Block {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (l < 3) {
|
2014-07-03 03:47:25 +02:00
|
|
|
+ if (l < PaperSpigotWorldConfig.cactusMaxHeight) { // PaperSpigot - Configurable natural growth heights
|
2014-06-22 22:38:49 +02:00
|
|
|
int i1 = world.getData(i, j, k);
|
|
|
|
|
|
|
|
if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.cactusModifier * 15) + 0.5F, 15)) { // Spigot
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
|
2014-07-03 03:47:25 +02:00
|
|
|
index 6c04ad2..9d638fe 100644
|
2014-06-22 22:38:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockReed.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockReed.java
|
|
|
|
@@ -1,5 +1,7 @@
|
|
|
|
package net.minecraft.server;
|
|
|
|
|
2014-07-03 03:47:25 +02:00
|
|
|
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
|
2014-06-22 22:38:49 +02:00
|
|
|
+
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
public class BlockReed extends Block {
|
|
|
|
@@ -21,7 +23,7 @@ public class BlockReed extends Block {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (l < 3) {
|
2014-07-03 03:47:25 +02:00
|
|
|
+ if (l < PaperSpigotWorldConfig.reedMaxHeight) { // PaperSpigot - Configurable natural growth heights
|
2014-06-22 22:38:49 +02:00
|
|
|
int i1 = world.getData(i, j, k);
|
|
|
|
|
|
|
|
if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.caneModifier * 15) + 0.5F, 15)) { // Spigot
|
2014-07-03 03:47:25 +02:00
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
index 9f2c3dc..27be0a8 100644
|
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
@@ -95,4 +95,12 @@ public class PaperSpigotWorldConfig
|
|
|
|
{
|
|
|
|
playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F );
|
2014-06-22 22:38:49 +02:00
|
|
|
}
|
2014-07-03 03:47:25 +02:00
|
|
|
+
|
2014-06-22 22:38:49 +02:00
|
|
|
+ public static int cactusMaxHeight;
|
|
|
|
+ public static int reedMaxHeight;
|
|
|
|
+ private void blockGrowthHeight()
|
|
|
|
+ {
|
|
|
|
+ cactusMaxHeight = getInt( "max-growth-height.cactus", 3 );
|
|
|
|
+ reedMaxHeight = getInt ( "max-growth-height.reeds", 3 );
|
|
|
|
+ }
|
2014-07-03 03:47:25 +02:00
|
|
|
}
|
2014-06-22 22:38:49 +02:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|