Don't aggregate sapling ticks - causes issues.

This commit is contained in:
md_5 2013-03-23 12:44:28 +11:00
parent b28b270dcd
commit 03d244eef1

View file

@ -1,4 +1,4 @@
From 8d5b6b24e389d3a3aa669bfd01d61dab9b347eae Mon Sep 17 00:00:00 2001
From 05108bcbeddcf5681feb3d5f7c986ce738cccbb8 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 09:39:40 +1100
Subject: [PATCH] Spigot Changes
@ -146,7 +146,7 @@ index 8657860..50c5200 100644
world.setData(i, j, k, 0, 4);
} else {
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
index 56938cd..7217ed6 100644
index 56938cd..e65ad62 100644
--- a/src/main/java/net/minecraft/server/BlockSapling.java
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
@@ -25,7 +25,7 @@ public class BlockSapling extends BlockFlower {
@ -154,7 +154,7 @@ index 56938cd..7217ed6 100644
if (!world.isStatic) {
super.a(world, i, j, k, random);
- if (world.getLightLevel(i, j + 1, k) >= 9 && random.nextInt(7) == 0) {
+ if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds * 100 / world.getWorld().treeGrowthModifier * 7 / 100F) + 0.5F))) == 0)) { // Spigot
+ if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds / world.getWorld().aggregateTicks / world.getWorld().treeGrowthModifier * 7) + 0.5F))) == 0)) { // Spigot
this.grow(world, i, j, k, random, false, null, null); // CraftBukkit - added bonemeal, player and itemstack
}
}
@ -661,7 +661,7 @@ index b694789..2f8e066 100644
entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ce54462..05b2d6d 100644
index ce54462..b7dfe40 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,5 +1,7 @@
@ -726,7 +726,7 @@ index ce54462..05b2d6d 100644
+ } else {
+ this.growthOdds = 100;
+ }
+ for (int c = 0; c < getWorld().aggregateTicks; c++) {
+ for (int c = 0; c < ((block.id == Block.SAPLING.id) ? 1 : getWorld().aggregateTicks); c++) {
+ block.a(this, k2 + k, i3 + chunksection.d(), l2 + l, this.random);
+ }
+ // Spigot end