mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
SPIGOT-1814: Crop growth rates inverted.
This commit is contained in:
parent
b2bbaa0190
commit
7d05145bf4
1 changed files with 17 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
From 876a2fbc11025b6010feb8734606f77f00067506 Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Fri, 21 Jun 2013 17:17:20 +1000
|
||||
From bf9a9c1ba24bbc4cc668647b5e123717ba9defa9 Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <git@md-5.net>
|
||||
Date: Mon, 7 Mar 2016 22:14:13 +1100
|
||||
Subject: [PATCH] Crop Growth Rates
|
||||
|
||||
Allows configuring the growth rates of crops as a percentage of their normal growth rate.
|
||||
|
@ -27,7 +27,7 @@ index 57f3981..12589d6 100644
|
|||
+ // Spigot end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
index f4b90e1..862075d 100644
|
||||
index f4b90e1..c00d874 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
@@ -31,7 +31,7 @@ public class BlockCactus extends Block {
|
||||
|
@ -35,12 +35,12 @@ index f4b90e1..862075d 100644
|
|||
int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue();
|
||||
|
||||
- if (j == 15) {
|
||||
+ if (j >= (byte) range(3, (world.spigotConfig.cactusModifier / 100 * 15) + 0.5F, 15)) { // Spigot
|
||||
+ if (j >= (byte) range(3, ((100 / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
|
||||
// world.setTypeUpdate(blockposition1, this.getBlockData()); // CraftBukkit
|
||||
IBlockData iblockdata1 = iblockdata.set(BlockCactus.AGE, Integer.valueOf(0));
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
|
||||
index 062f769..d545d1a 100644
|
||||
index 062f769..7c909d8 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCrops.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCrops.java
|
||||
@@ -54,7 +54,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement
|
||||
|
@ -48,12 +48,12 @@ index 062f769..d545d1a 100644
|
|||
float f = a((Block) this, world, blockposition);
|
||||
|
||||
- if (random.nextInt((int) (25.0F / f) + 1) == 0) {
|
||||
+ if (random.nextInt((int) (world.spigotConfig.wheatModifier / 100 * (25.0F / f)) + 1) == 0) { // Spigot // CraftBukkit start
|
||||
+ if (random.nextInt((int) ((100 / world.spigotConfig.wheatModifier) * (25.0F / f)) + 1) == 0) { // Spigot
|
||||
// CraftBukkit start
|
||||
IBlockData data = this.setAge(i + 1);
|
||||
CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java
|
||||
index fa7919e..e069252 100644
|
||||
index fa7919e..6148691 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockMushroom.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockMushroom.java
|
||||
@@ -23,7 +23,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme
|
||||
|
@ -61,12 +61,12 @@ index fa7919e..e069252 100644
|
|||
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
||||
final int sourceX = blockposition.getX(), sourceY = blockposition.getY(), sourceZ = blockposition.getZ(); // CraftBukkit
|
||||
- if (random.nextInt(25) == 0) {
|
||||
+ if (random.nextInt(Math.max(1, (int) world.spigotConfig.mushroomModifier / 100 * 25)) == 0) { // Spigot
|
||||
+ if (random.nextInt(Math.max(1, (int) (100 / world.spigotConfig.mushroomModifier) * 25)) == 0) { // Spigot
|
||||
int i = 5;
|
||||
boolean flag = true;
|
||||
Iterator iterator = BlockPosition.b(blockposition.a(-4, -1, -4), blockposition.a(4, 1, 4)).iterator();
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java
|
||||
index b2ca55f..9cd8bd8 100644
|
||||
index b2ca55f..ff485b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockNetherWart.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockNetherWart.java
|
||||
@@ -29,7 +29,7 @@ public class BlockNetherWart extends BlockPlant {
|
||||
|
@ -74,12 +74,12 @@ index b2ca55f..9cd8bd8 100644
|
|||
int i = ((Integer) iblockdata.get(BlockNetherWart.AGE)).intValue();
|
||||
|
||||
- if (i < 3 && random.nextInt(10) == 0) {
|
||||
+ if (i < 3 && random.nextInt(Math.max(1, (int) world.spigotConfig.wartModifier / 100 * 10)) == 0) { // Spigot
|
||||
+ if (i < 3 && random.nextInt(Math.max(1, (int) (100 / world.spigotConfig.wartModifier) * 10)) == 0) { // Spigot
|
||||
iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));
|
||||
// world.setTypeAndData(blockposition, iblockdata, 2); // CraftBukkit
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(iblockdata)); // CraftBukkit
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
|
||||
index f507b83..b8c36a7 100644
|
||||
index f507b83..fb19f19 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockReed.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockReed.java
|
||||
@@ -30,7 +30,7 @@ public class BlockReed extends Block {
|
||||
|
@ -87,12 +87,12 @@ index f507b83..b8c36a7 100644
|
|||
int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue();
|
||||
|
||||
- if (j == 15) {
|
||||
+ if (j >= (byte) range(3, (world.spigotConfig.caneModifier /100 * 15) + 0.5F, 15)) { // Spigot
|
||||
+ if (j >= (byte) range(3, ((100 / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot
|
||||
// CraftBukkit start
|
||||
// world.setTypeUpdate(blockposition.up(), this.getBlockData()); // CraftBukkit
|
||||
BlockPosition upPos = blockposition.up();
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
|
||||
index a2691a5..a60a7f8 100644
|
||||
index a2691a5..8b34250 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockSapling.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
|
||||
@@ -34,7 +34,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen
|
||||
|
@ -100,12 +100,12 @@ index a2691a5..a60a7f8 100644
|
|||
if (!world.isClientSide) {
|
||||
super.b(world, blockposition, iblockdata, random);
|
||||
- if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
|
||||
+ if (world.getLightLevel(blockposition.up()) >= 9 && (random.nextInt(Math.max(2, (int) ((world.spigotConfig.saplingModifier / 100 * 7) + 0.5F))) == 0)) { // Spigot) {
|
||||
+ if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(Math.max(2, (int) (((100 / world.spigotConfig.saplingModifier) * 7) + 0.5F))) == 0) { // Spigot
|
||||
// CraftBukkit start
|
||||
world.captureTreeGeneration = true;
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
|
||||
index 41200fa..53d99aa 100644
|
||||
index 41200fa..097d11e 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockStem.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockStem.java
|
||||
@@ -50,7 +50,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
@ -113,7 +113,7 @@ index 41200fa..53d99aa 100644
|
|||
float f = BlockCrops.a((Block) this, world, blockposition);
|
||||
|
||||
- if (random.nextInt((int) (25.0F / f) + 1) == 0) {
|
||||
+ if (random.nextInt((int) ((this == Blocks.PUMPKIN_STEM? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / 100 * (25.0F / f)) + 1) == 0) { // Spigot
|
||||
+ if (random.nextInt((int) ((100 / (this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier)) * (25.0F / f)) + 1) == 0) { // Spigot
|
||||
int i = ((Integer) iblockdata.get(BlockStem.AGE)).intValue();
|
||||
|
||||
if (i < 7) {
|
||||
|
|
Loading…
Reference in a new issue