3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 14:28:09 +01:00

Handle filled buckets dispensing up and down. Fixes BUKKIT-3814

Dieser Commit ist enthalten in:
Travis Watkins 2013-03-20 10:24:22 -05:00
Ursprung 2fc755cc65
Commit b325ffc8f6
2 geänderte Dateien mit 8 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -108,11 +108,6 @@ public class BlockFire extends Block {
this.a(world, i, j, k - 1, 300 + b0, random, l); this.a(world, i, j, k - 1, 300 + b0, random, l);
this.a(world, i, j, k + 1, 300 + b0, random, l); this.a(world, i, j, k + 1, 300 + b0, random, l);
// CraftBukkit start - call to stop spread of fire
org.bukkit.Server server = world.getServer();
org.bukkit.World bworld = world.getWorld();
// CraftBukkit end
for (int i1 = i - 1; i1 <= i + 1; ++i1) { for (int i1 = i - 1; i1 <= i + 1; ++i1) {
for (int j1 = k - 1; j1 <= k + 1; ++j1) { for (int j1 = k - 1; j1 <= k + 1; ++j1) {
for (int k1 = j - 1; k1 <= j + 4; ++k1) { for (int k1 = j - 1; k1 <= j + 4; ++k1) {
@ -145,6 +140,8 @@ public class BlockFire extends Block {
continue; continue;
} }
org.bukkit.Server server = world.getServer();
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState(); org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState();
blockState.setTypeId(this.id); blockState.setTypeId(this.id);
blockState.setData(new org.bukkit.material.MaterialData(this.id, (byte) k2)); blockState.setData(new org.bukkit.material.MaterialData(this.id, (byte) k2));

Datei anzeigen

@ -20,13 +20,14 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
// CraftBukkit start // CraftBukkit start
World world = isourceblock.k(); World world = isourceblock.k();
int i2 = i + enumfacing.c(); int x = i + enumfacing.c();
int k2 = k + enumfacing.e(); int y = j + enumfacing.d();
if (world.isEmpty(i2, j, k2) || world.getMaterial(i2, j, k2).isBuildable()) { int z = k + enumfacing.e();
if (world.isEmpty(x, y, z) || world.getMaterial(x, y, z).isBuildable()) {
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k); org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack);
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z));
if (!BlockDispenser.eventFired) { if (!BlockDispenser.eventFired) {
world.getServer().getPluginManager().callEvent(event); world.getServer().getPluginManager().callEvent(event);
} }
@ -49,7 +50,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
} }
// CraftBukkit end // CraftBukkit end
if (itembucket.a(isourceblock.k(), (double) i, (double) j, (double) k, i + enumfacing.c(), j, k + enumfacing.e())) { if (itembucket.a(isourceblock.k(), (double) i, (double) j, (double) k, i + enumfacing.c(), j + enumfacing.d(), k + enumfacing.e())) {
// CraftBukkit start - handle stacked buckets // CraftBukkit start - handle stacked buckets
Item item = Item.BUCKET; Item item = Item.BUCKET;
if (--itemstack.count == 0) { if (--itemstack.count == 0) {