Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
Fixed bonemeal not being consumed on failed growth attempts. This fixes BUKKIT-337. Thanks to md-5 for the pull request!
Dieser Commit ist enthalten in:
Ursprung
246d07482b
Commit
972b2087f2
@ -108,10 +108,13 @@ public class BlockMushroom extends BlockFlower {
|
|||||||
event = new StructureGrowEvent(location, TreeType.RED_MUSHROOM, bonemeal, player, new ArrayList<BlockState>());
|
event = new StructureGrowEvent(location, TreeType.RED_MUSHROOM, bonemeal, player, new ArrayList<BlockState>());
|
||||||
worldgenhugemushroom = new WorldGenHugeMushroom(1);
|
worldgenhugemushroom = new WorldGenHugeMushroom(1);
|
||||||
}
|
}
|
||||||
if (worldgenhugemushroom != null && event != null){
|
if (worldgenhugemushroom != null && event != null) {
|
||||||
grown = worldgenhugemushroom.grow(world, random, i, j, k, event, itemstack, world.getWorld());
|
grown = worldgenhugemushroom.grow(world, random, i, j, k, event, itemstack, world.getWorld());
|
||||||
|
if (event.isFromBonemeal() && itemstack != null) {
|
||||||
|
--itemstack.count;
|
||||||
}
|
}
|
||||||
if (!grown || event.isCancelled()){
|
}
|
||||||
|
if (!grown || event.isCancelled()) {
|
||||||
world.setRawTypeIdAndData(i, j, k, this.id, l);
|
world.setRawTypeIdAndData(i, j, k, this.id, l);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,9 @@ public class BlockSapling extends BlockFlower {
|
|||||||
if (event == null) {
|
if (event == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (event.isFromBonemeal() && itemstack != null) {
|
||||||
|
--itemstack.count;
|
||||||
|
}
|
||||||
if (!grownTree || event.isCancelled()) {
|
if (!grownTree || event.isCancelled()) {
|
||||||
world.setRawTypeIdAndData(i, j, k, this.id, l);
|
world.setRawTypeIdAndData(i, j, k, this.id, l);
|
||||||
}
|
}
|
||||||
@ -82,6 +85,7 @@ public class BlockSapling extends BlockFlower {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private class BlockChangeWithNotify implements BlockChangeDelegate {
|
private class BlockChangeWithNotify implements BlockChangeDelegate {
|
||||||
|
|
||||||
World world;
|
World world;
|
||||||
|
|
||||||
BlockChangeWithNotify(World world) {
|
BlockChangeWithNotify(World world) {
|
||||||
|
@ -401,9 +401,6 @@ public class WorldGenBigTree extends WorldGenerator {
|
|||||||
for (BlockState state : event.getBlocks()) {
|
for (BlockState state : event.getBlocks()) {
|
||||||
state.update();
|
state.update();
|
||||||
}
|
}
|
||||||
if (event.isFromBonemeal() && itemstack != null) {
|
|
||||||
--itemstack.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Craftbukkit end
|
// Craftbukkit end
|
||||||
|
@ -126,9 +126,6 @@ public class WorldGenForest extends WorldGenerator {
|
|||||||
for (BlockState state : event.getBlocks()) {
|
for (BlockState state : event.getBlocks()) {
|
||||||
state.update(true);
|
state.update(true);
|
||||||
}
|
}
|
||||||
if (event.isFromBonemeal() && itemstack != null) {
|
|
||||||
--itemstack.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Craftbukkit end
|
// Craftbukkit end
|
||||||
|
@ -196,9 +196,6 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
|||||||
for (BlockState state : event.getBlocks()) {
|
for (BlockState state : event.getBlocks()) {
|
||||||
state.update(true);
|
state.update(true);
|
||||||
}
|
}
|
||||||
if (event.isFromBonemeal() && itemstack != null) {
|
|
||||||
--itemstack.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Craftbukkit end
|
// Craftbukkit end
|
||||||
|
@ -144,9 +144,6 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
|||||||
for (BlockState state : event.getBlocks()) {
|
for (BlockState state : event.getBlocks()) {
|
||||||
state.update(true);
|
state.update(true);
|
||||||
}
|
}
|
||||||
if (event.isFromBonemeal() && itemstack != null) {
|
|
||||||
--itemstack.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Craftbukkit end
|
// Craftbukkit end
|
||||||
|
@ -124,9 +124,6 @@ public class WorldGenTrees extends WorldGenerator {
|
|||||||
for (BlockState state : event.getBlocks()) {
|
for (BlockState state : event.getBlocks()) {
|
||||||
state.update(true);
|
state.update(true);
|
||||||
}
|
}
|
||||||
if (event.isFromBonemeal() && itemstack != null) {
|
|
||||||
--itemstack.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Craftbukkit end
|
// Craftbukkit end
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren