diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-11-27 01:41:56 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-11-27 01:41:56 +0000 |
commit | 139ad8c34aada3da55a16b6dd8058b02fcbb42c4 (patch) | |
tree | 2d6260ed202f18dc6a87eb7c0a74b9a05c9a9fd4 /src | |
parent | eb7bd5f23b56d47a8a3e27d21dad11e3f01c19d0 (diff) | |
download | craftbukkit-139ad8c34aada3da55a16b6dd8058b02fcbb42c4.tar craftbukkit-139ad8c34aada3da55a16b6dd8058b02fcbb42c4.tar.gz craftbukkit-139ad8c34aada3da55a16b6dd8058b02fcbb42c4.tar.lz craftbukkit-139ad8c34aada3da55a16b6dd8058b02fcbb42c4.tar.xz craftbukkit-139ad8c34aada3da55a16b6dd8058b02fcbb42c4.zip |
Fixed crash when breaking gravel with a high fortune enchant
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockGravel.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockGravel.java b/src/main/java/net/minecraft/server/BlockGravel.java new file mode 100644 index 00000000..6f627119 --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockGravel.java @@ -0,0 +1,15 @@ +package net.minecraft.server; + +import java.util.Random; + +public class BlockGravel extends BlockSand { + + public BlockGravel(int i, int j) { + super(i, j); + } + + public int a(int i, Random random, int j) { + j = Math.max(j, 3); // CraftBukkit - added to fix crash when j > 3 + return random.nextInt(10 - j * 3) == 0 ? Item.FLINT.id : this.id; + } +} |