@@ -8,10 +8,10 @@
|
||||
public class BlockCauldron extends Block {
|
||||
|
||||
public static final BlockStateInteger LEVEL = BlockProperties.al;
|
||||
@@ -32,8 +34,13 @@
|
||||
@@ -27,8 +29,13 @@
|
||||
float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F;
|
||||
|
||||
if (!world.isClientSide && entity.isBurning() && i > 0 && entity.getBoundingBox().minY <= (double) f) {
|
||||
if (!world.isClientSide && entity.isBurning() && i > 0 && entity.locY() <= (double) f) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH)) {
|
||||
+ return;
|
||||
@@ -23,13 +23,13 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,18 +57,27 @@
|
||||
@@ -45,18 +52,27 @@
|
||||
|
||||
if (item == Items.WATER_BUCKET) {
|
||||
if (i < 3 && !world.isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, 3, entityhuman, CauldronLevelChangeEvent.ChangeReason.BUCKET_EMPTY)) {
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
entityhuman.a(enumhand, new ItemStack(Items.BUCKET));
|
||||
@@ -42,17 +42,17 @@
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
return true;
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else if (item == Items.BUCKET) {
|
||||
if (i == 3 && !world.isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, 0, entityhuman, CauldronLevelChangeEvent.ChangeReason.BUCKET_FILL)) {
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack.subtract(1);
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -72,7 +88,8 @@
|
||||
@@ -67,7 +83,8 @@
|
||||
}
|
||||
|
||||
entityhuman.a(StatisticList.USE_CAULDRON);
|
||||
@@ -62,18 +62,18 @@
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -82,6 +99,10 @@
|
||||
@@ -77,6 +94,10 @@
|
||||
|
||||
if (item == Items.GLASS_BOTTLE) {
|
||||
if (i > 0 && !world.isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_FILL)) {
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack1 = PotionUtil.a(new ItemStack(Items.POTION), Potions.WATER);
|
||||
entityhuman.a(StatisticList.USE_CAULDRON);
|
||||
@@ -96,12 +117,17 @@
|
||||
@@ -91,12 +112,17 @@
|
||||
}
|
||||
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
@@ -82,17 +82,17 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
return true;
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else if (item == Items.POTION && PotionUtil.d(itemstack) == Potions.WATER) {
|
||||
if (i < 3 && !world.isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, i + 1, entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY)) {
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack1 = new ItemStack(Items.GLASS_BOTTLE);
|
||||
entityhuman.a(StatisticList.USE_CAULDRON);
|
||||
@@ -112,7 +138,8 @@
|
||||
@@ -107,7 +133,8 @@
|
||||
}
|
||||
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
@@ -101,29 +101,29 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -121,8 +148,13 @@
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
@@ -116,8 +143,13 @@
|
||||
IDyeable idyeable = (IDyeable) item;
|
||||
|
||||
if (idyeable.a(itemstack) && !world.isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entityhuman, CauldronLevelChangeEvent.ChangeReason.ARMOR_WASH)) {
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
idyeable.c(itemstack);
|
||||
- this.a(world, blockposition, iblockdata, i - 1);
|
||||
+ // this.a(world, blockposition, iblockdata, i - 1);
|
||||
+ // CraftBukkit end
|
||||
entityhuman.a(StatisticList.CLEAN_ARMOR);
|
||||
return true;
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
@@ -130,13 +162,18 @@
|
||||
@@ -125,13 +157,18 @@
|
||||
|
||||
if (i > 0 && item instanceof ItemBanner) {
|
||||
if (TileEntityBanner.a(itemstack) > 0 && !world.isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entityhuman, CauldronLevelChangeEvent.ChangeReason.BANNER_WASH)) {
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
itemstack1 = itemstack.cloneItemStack();
|
||||
itemstack1.setCount(1);
|
||||
@@ -137,7 +137,7 @@
|
||||
}
|
||||
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -173,9 +210,25 @@
|
||||
@@ -169,9 +206,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -187,7 +240,7 @@
|
||||
@@ -183,7 +236,7 @@
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
|
||||
if ((Integer) iblockdata.get(BlockCauldron.LEVEL) < 3) {
|
||||
|
||||
Reference in New Issue
Block a user