mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Fixed the teru teru bozu not resetting the rain time.
This commit is contained in:
1 parent
f244affcaa
commit
08e16288e2
2 files changed
+12
-2
No files matched your search
@@ -86,6 +86,7 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
private boolean removeRain(World world) {
|
||||
if(world.isRaining()) {
|
||||
world.getWorldInfo().setRaining(false);
|
||||
TileTeruTeruBozu.resetRainTime(world);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -93,8 +94,10 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
|
||||
private boolean startRain(World world) {
|
||||
if(!world.isRaining()) {
|
||||
if(world.rand.nextInt(10) == 0)
|
||||
if(world.rand.nextInt(10) == 0) {
|
||||
world.getWorldInfo().setRaining(true);
|
||||
TileTeruTeruBozu.resetRainTime(world);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileTeruTeruBozu extends TileMod {
|
||||
|
||||
public boolean wasRaining = false;
|
||||
@@ -20,12 +22,17 @@ public class TileTeruTeruBozu extends TileMod {
|
||||
return;
|
||||
|
||||
boolean isRaining = worldObj.isRaining();
|
||||
if(isRaining && worldObj.rand.nextInt(9600) == 0)
|
||||
if(isRaining && worldObj.rand.nextInt(9600) == 0) {
|
||||
worldObj.getWorldInfo().setRaining(false);
|
||||
resetRainTime(worldObj);
|
||||
}
|
||||
|
||||
if(wasRaining != isRaining)
|
||||
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
|
||||
wasRaining = isRaining;
|
||||
}
|
||||
|
||||
public static void resetRainTime(World w){
|
||||
w.getWorldInfo().setRainTime(w.rand.nextInt(w.getWorldInfo().isRaining() ? 12000 : 168000) + 12000);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user