mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: cc001a73b Climbing should not bypass cramming gamerule b9930b39d Add legacy plugin count to metrics 4729e6b90 Add more lightning API 5e220bcb5 [ci skip] add stale bot configuration 2a44498a5 Add PlayerItemCooldownEvent fd33bcee1 Add LivingEntity#clearActiveItem a99e0ca05 Fix Player spawnParticle x/y/z precision loss
83 lines
4.7 KiB
Diff
83 lines
4.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 23 Aug 2019 20:57:29 -0500
|
|
Subject: [PATCH] Implement bamboo growth settings
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java
|
|
index f208ab5098..ce56edb7c8 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockBamboo.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockBamboo.java
|
|
@@ -99,7 +99,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
if (random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.bambooModifier) * 3)) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot
|
|
int i = this.b(worldserver, blockposition) + 1;
|
|
|
|
- if (i < 16) {
|
|
+ if (i < worldserver.purpurConfig.bambooMaxHeight) { // Purpur
|
|
this.a(iblockdata, (World) worldserver, blockposition, random, i);
|
|
}
|
|
}
|
|
@@ -130,7 +130,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
int i = this.a(iblockaccess, blockposition);
|
|
int j = this.b(iblockaccess, blockposition);
|
|
|
|
- return i + j + 1 < 16 && (Integer) iblockaccess.getType(blockposition.up(i)).get(BlockBamboo.f) != 1;
|
|
+ return i + j + 1 < ((World) iblockaccess).purpurConfig.bambooMaxHeight && iblockaccess.getType(blockposition.up(i)).get(BlockBamboo.f) != 1; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -149,7 +149,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
BlockPosition blockposition1 = blockposition.up(i);
|
|
IBlockData iblockdata1 = worldserver.getType(blockposition1);
|
|
|
|
- if (k >= 16 || (Integer) iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) {
|
|
+ if (k >= worldserver.purpurConfig.bambooMaxHeight || iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) { // Purpur
|
|
return;
|
|
}
|
|
|
|
@@ -190,7 +190,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
}
|
|
|
|
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
|
|
- int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
|
+ int k = (i < world.purpurConfig.bambooSmallHeight || random.nextFloat() >= 0.25F) && i != (world.purpurConfig.bambooMaxHeight - 1) ? 0 : 1; // Purpur
|
|
|
|
// CraftBukkit start
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3)) {
|
|
@@ -205,7 +205,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
protected int a(IBlockAccess iblockaccess, BlockPosition blockposition) {
|
|
int i;
|
|
|
|
- for (i = 0; i < 16 && iblockaccess.getType(blockposition.up(i + 1)).a(Blocks.BAMBOO); ++i) {
|
|
+ for (i = 0; i < ((World) iblockaccess).purpurConfig.bambooMaxHeight && iblockaccess.getType(blockposition.up(i + 1)).a(Blocks.BAMBOO); ++i) { // Purpur
|
|
;
|
|
}
|
|
|
|
@@ -215,7 +215,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
|
protected int b(IBlockAccess iblockaccess, BlockPosition blockposition) {
|
|
int i;
|
|
|
|
- for (i = 0; i < 16 && iblockaccess.getType(blockposition.down(i + 1)).a(Blocks.BAMBOO); ++i) {
|
|
+ for (i = 0; i < ((World) iblockaccess).purpurConfig.bambooMaxHeight && iblockaccess.getType(blockposition.down(i + 1)).a(Blocks.BAMBOO); ++i) { // Purpur
|
|
;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index b4e42c2e65..33eac638f4 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -166,6 +166,13 @@ public class PurpurWorldConfig {
|
|
});
|
|
}
|
|
|
|
+ public int bambooMaxHeight = 16;
|
|
+ public int bambooSmallHeight = 10;
|
|
+ private void bambooSettings() {
|
|
+ bambooMaxHeight = getInt("blocks.bamboo.max-height", bambooMaxHeight);
|
|
+ bambooSmallHeight = getInt("blocks.bamboo.small-height", bambooSmallHeight);
|
|
+ }
|
|
+
|
|
public boolean dispenserApplyCursedArmor = true;
|
|
private void dispenserSettings() {
|
|
dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor);
|