@@ -118,7 +118,7 @@
|
||||
world.playSound((EntityHuman) null, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
world.gameEvent((Entity) null, (Holder) GameEvent.FLUID_PLACE, blockposition);
|
||||
}
|
||||
@@ -227,47 +260,55 @@
|
||||
@@ -227,76 +260,89 @@
|
||||
return ItemInteractionResult.sidedSuccess(world.isClientSide);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,9 @@
|
||||
+ return ItemInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
entityhuman.setItemInHand(enumhand, itemstack.transmuteCopy(Blocks.SHULKER_BOX, 1));
|
||||
ItemStack itemstack1 = itemstack.transmuteCopy(Blocks.SHULKER_BOX, 1);
|
||||
|
||||
entityhuman.setItemInHand(enumhand, ItemLiquidUtil.createFilledResult(itemstack, entityhuman, itemstack1, false));
|
||||
entityhuman.awardStat(StatisticList.CLEAN_SHULKER_BOX);
|
||||
- LayeredCauldronBlock.lowerFillLevel(iblockdata, world, blockposition);
|
||||
+ // LayeredCauldronBlock.lowerFillLevel(iblockdata, world, blockposition); // CraftBukkit
|
||||
@@ -190,9 +192,7 @@
|
||||
ItemStack itemstack1 = itemstack.copyWithCount(1);
|
||||
|
||||
itemstack1.set(DataComponents.BANNER_PATTERNS, bannerpatternlayers.removeLast());
|
||||
@@ -281,28 +322,33 @@
|
||||
}
|
||||
|
||||
entityhuman.setItemInHand(enumhand, ItemLiquidUtil.createFilledResult(itemstack, entityhuman, itemstack1, false));
|
||||
entityhuman.awardStat(StatisticList.CLEAN_BANNER);
|
||||
- LayeredCauldronBlock.lowerFillLevel(iblockdata, world, blockposition);
|
||||
+ // LayeredCauldronBlock.lowerFillLevel(iblockdata, world, blockposition); // CraftBukkit
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
});
|
||||
public static final StreamCodec<RegistryFriendlyByteBuf, DataComponentPatch> STREAM_CODEC = new StreamCodec<RegistryFriendlyByteBuf, DataComponentPatch>() {
|
||||
public DataComponentPatch decode(RegistryFriendlyByteBuf registryfriendlybytebuf) {
|
||||
@@ -143,7 +143,7 @@
|
||||
@@ -144,7 +144,7 @@
|
||||
}
|
||||
|
||||
private static <T> void encodeComponent(RegistryFriendlyByteBuf registryfriendlybytebuf, DataComponentType<T> datacomponenttype, Object object) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
};
|
||||
private static final String REMOVED_PREFIX = "!";
|
||||
@@ -270,6 +270,42 @@
|
||||
@@ -271,6 +271,42 @@
|
||||
|
||||
a() {}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorItem.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorItem.java
|
||||
@@ -7,8 +7,23 @@
|
||||
@@ -7,10 +7,25 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.BlockDispenser;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
+
|
||||
public class DispenseBehaviorItem implements IDispenseBehavior {
|
||||
|
||||
private static final int DEFAULT_ACCURACY = 6;
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ private boolean dropper;
|
||||
+
|
||||
@@ -24,7 +26,7 @@
|
||||
public DispenseBehaviorItem() {}
|
||||
|
||||
@Override
|
||||
@@ -25,11 +40,22 @@
|
||||
@@ -27,11 +42,22 @@
|
||||
IPosition iposition = BlockDispenser.getDispensePosition(sourceblock);
|
||||
ItemStack itemstack1 = itemstack.split(1);
|
||||
|
||||
@@ -48,7 +50,7 @@
|
||||
double d0 = iposition.x();
|
||||
double d1 = iposition.y();
|
||||
double d2 = iposition.z();
|
||||
@@ -44,7 +70,47 @@
|
||||
@@ -46,7 +72,47 @@
|
||||
double d3 = world.random.nextDouble() * 0.1D + 0.2D;
|
||||
|
||||
entityitem.setDeltaMovement(world.random.triangle((double) enumdirection.getStepX() * d3, 0.0172275D * (double) i), world.random.triangle(0.2D, 0.0172275D * (double) i), world.random.triangle((double) enumdirection.getStepZ() * d3, 0.0172275D * (double) i));
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
- this.setSuccess(tryShearBeehive(worldserver, blockposition) || tryShearLivingEntity(worldserver, blockposition));
|
||||
+ this.setSuccess(tryShearBeehive(worldserver, blockposition) || tryShearLivingEntity(worldserver, blockposition, bukkitBlock, craftItem)); // CraftBukkit
|
||||
if (this.isSuccess()) {
|
||||
itemstack.hurtAndBreak(1, worldserver.getRandom(), (EntityPlayer) null, () -> {
|
||||
itemstack.setCount(0);
|
||||
@@ -65,7 +95,7 @@
|
||||
itemstack.hurtAndBreak(1, worldserver, (EntityPlayer) null, (item) -> {
|
||||
});
|
||||
@@ -64,7 +94,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
List<EntityLiving> list = worldserver.getEntitiesOfClass(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.NO_SPECTATORS);
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
@@ -74,6 +104,11 @@
|
||||
@@ -73,6 +103,11 @@
|
||||
|
||||
if (entityliving instanceof IShearable ishearable) {
|
||||
if (ishearable.readyForShearing()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
+++ b/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
@@ -66,6 +66,22 @@
|
||||
@@ -67,6 +67,22 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
public interface IDispenseBehavior {
|
||||
|
||||
Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -93,14 +109,42 @@
|
||||
@@ -94,14 +110,42 @@
|
||||
EnumDirection enumdirection = (EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING);
|
||||
EntityTypes<?> entitytypes = ((ItemMonsterEgg) itemstack.getItem()).getType(itemstack);
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
sourceblock.level().gameEvent((Entity) null, (Holder) GameEvent.ENTITY_PLACE, sourceblock.pos());
|
||||
return itemstack;
|
||||
}
|
||||
@@ -119,13 +163,41 @@
|
||||
@@ -120,13 +164,41 @@
|
||||
EnumDirection enumdirection = (EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING);
|
||||
BlockPosition blockposition = sourceblock.pos().relative(enumdirection);
|
||||
WorldServer worldserver = sourceblock.level();
|
||||
@@ -111,10 +111,11 @@
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
@@ -144,8 +216,35 @@
|
||||
@@ -145,7 +217,34 @@
|
||||
});
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
- ((ISaddleable) list.get(0)).equipSaddle(itemstack.split(1), SoundCategory.BLOCKS);
|
||||
+ // CraftBukkit start
|
||||
+ ItemStack itemstack1 = itemstack.split(1);
|
||||
+ WorldServer world = sourceblock.level();
|
||||
@@ -141,10 +142,8 @@
|
||||
+ return itemstack;
|
||||
+ }
|
||||
+ }
|
||||
+ ((ISaddleable) list.get(0)).equipSaddle(itemstack1, SoundCategory.BLOCKS);
|
||||
+ // CraftBukkit end
|
||||
((ISaddleable) list.get(0)).equipSaddle(SoundCategory.BLOCKS);
|
||||
- itemstack.shrink(1);
|
||||
+ // itemstack.shrink(1); // CraftBukkit - handled above
|
||||
this.setSuccess(true);
|
||||
return itemstack;
|
||||
} else {
|
||||
@@ -223,7 +222,7 @@
|
||||
this.setSuccess(true);
|
||||
return itemstack;
|
||||
}
|
||||
@@ -249,9 +402,51 @@
|
||||
@@ -249,6 +402,38 @@
|
||||
BlockPosition blockposition = sourceblock.pos().relative((EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING));
|
||||
WorldServer worldserver = sourceblock.level();
|
||||
|
||||
@@ -261,22 +260,8 @@
|
||||
+
|
||||
if (dispensiblecontaineritem.emptyContents((EntityHuman) null, worldserver, blockposition, (MovingObjectPositionBlock) null)) {
|
||||
dispensiblecontaineritem.checkExtraContent((EntityHuman) null, worldserver, itemstack, blockposition);
|
||||
- return new ItemStack(Items.BUCKET);
|
||||
+ // CraftBukkit start - Handle stacked buckets
|
||||
+ Item item = Items.BUCKET;
|
||||
+ itemstack.shrink(1);
|
||||
+ if (itemstack.isEmpty()) {
|
||||
+ itemstack.setItem(Items.BUCKET);
|
||||
+ itemstack.setCount(1);
|
||||
+ } else if (sourceblock.blockEntity().addItem(new ItemStack(item)) < 0) {
|
||||
+ this.defaultDispenseItemBehavior.dispense(sourceblock, new ItemStack(item));
|
||||
+ }
|
||||
+ return itemstack;
|
||||
+ // CraftBukkit end
|
||||
} else {
|
||||
return this.defaultDispenseItemBehavior.dispense(sourceblock, itemstack);
|
||||
}
|
||||
@@ -278,7 +473,7 @@
|
||||
return this.consumeWithRemainder(sourceblock, itemstack, new ItemStack(Items.BUCKET));
|
||||
@@ -276,7 +461,7 @@
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (block instanceof IFluidSource ifluidsource) {
|
||||
@@ -285,7 +270,7 @@
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
return super.execute(sourceblock, itemstack);
|
||||
@@ -286,6 +481,32 @@
|
||||
@@ -284,6 +469,32 @@
|
||||
worldserver.gameEvent((Entity) null, (Holder) GameEvent.FLUID_PICKUP, blockposition);
|
||||
Item item = itemstack1.getItem();
|
||||
|
||||
@@ -315,10 +300,10 @@
|
||||
+ itemstack1 = ifluidsource.pickupBlock((EntityHuman) null, worldserver, blockposition, iblockdata); // From above
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
itemstack.shrink(1);
|
||||
if (itemstack.isEmpty()) {
|
||||
return new ItemStack(item);
|
||||
@@ -307,16 +528,44 @@
|
||||
return this.consumeWithRemainder(sourceblock, itemstack, new ItemStack(item));
|
||||
}
|
||||
} else {
|
||||
@@ -296,16 +507,44 @@
|
||||
protected ItemStack execute(SourceBlock sourceblock, ItemStack itemstack) {
|
||||
WorldServer worldserver = sourceblock.level();
|
||||
|
||||
@@ -366,7 +351,7 @@
|
||||
BlockTNT.explode(worldserver, blockposition);
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
} else {
|
||||
@@ -342,12 +591,62 @@
|
||||
@@ -330,12 +569,62 @@
|
||||
this.setSuccess(true);
|
||||
WorldServer worldserver = sourceblock.level();
|
||||
BlockPosition blockposition = sourceblock.pos().relative((EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING));
|
||||
@@ -429,7 +414,7 @@
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
@@ -357,12 +656,41 @@
|
||||
@@ -345,12 +634,41 @@
|
||||
protected ItemStack execute(SourceBlock sourceblock, ItemStack itemstack) {
|
||||
WorldServer worldserver = sourceblock.level();
|
||||
BlockPosition blockposition = sourceblock.pos().relative((EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING));
|
||||
@@ -473,7 +458,7 @@
|
||||
return itemstack;
|
||||
}
|
||||
});
|
||||
@@ -387,6 +715,30 @@
|
||||
@@ -375,6 +693,30 @@
|
||||
EnumDirection enumdirection = (EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING);
|
||||
BlockPosition blockposition = sourceblock.pos().relative(enumdirection);
|
||||
|
||||
@@ -504,7 +489,7 @@
|
||||
if (worldserver.isEmptyBlock(blockposition) && BlockWitherSkull.canSpawnMob(worldserver, blockposition, itemstack)) {
|
||||
worldserver.setBlock(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.defaultBlockState().setValue(BlockSkull.ROTATION, RotationSegment.convertToSegment(enumdirection)), 3);
|
||||
worldserver.gameEvent((Entity) null, (Holder) GameEvent.BLOCK_PLACE, blockposition);
|
||||
@@ -412,6 +764,30 @@
|
||||
@@ -400,6 +742,30 @@
|
||||
BlockPosition blockposition = sourceblock.pos().relative((EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING));
|
||||
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
|
||||
|
||||
@@ -535,7 +520,7 @@
|
||||
if (worldserver.isEmptyBlock(blockposition) && blockpumpkincarved.canSpawnGolem(worldserver, blockposition)) {
|
||||
if (!worldserver.isClientSide) {
|
||||
worldserver.setBlock(blockposition, blockpumpkincarved.defaultBlockState(), 3);
|
||||
@@ -461,6 +837,30 @@
|
||||
@@ -438,6 +804,30 @@
|
||||
BlockPosition blockposition = sourceblock.pos().relative((EnumDirection) sourceblock.state().getValue(BlockDispenser.FACING));
|
||||
IBlockData iblockdata = worldserver.getBlockState(blockposition);
|
||||
|
||||
@@ -566,7 +551,7 @@
|
||||
if (iblockdata.is(TagsBlock.BEEHIVES, (blockbase_blockdata) -> {
|
||||
return blockbase_blockdata.hasProperty(BlockBeehive.HONEY_LEVEL) && blockbase_blockdata.getBlock() instanceof BlockBeehive;
|
||||
}) && (Integer) iblockdata.getValue(BlockBeehive.HONEY_LEVEL) >= 5) {
|
||||
@@ -510,6 +910,31 @@
|
||||
@@ -487,6 +877,31 @@
|
||||
this.setSuccess(false);
|
||||
return itemstack;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user