@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
|
||||
@@ -10,6 +10,11 @@
|
||||
@@ -9,6 +9,11 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.BlockDispenser;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class DispenseBehaviorBoat extends DispenseBehaviorItem {
|
||||
|
||||
private final DispenseBehaviorItem defaultDispenseItemBehavior = new DispenseBehaviorItem();
|
||||
@@ -39,12 +44,40 @@
|
||||
@@ -38,12 +43,40 @@
|
||||
d3 = 0.0D;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorShears.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorShears.java
|
||||
@@ -24,6 +24,12 @@
|
||||
@@ -23,6 +23,12 @@
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class DispenseBehaviorShears extends DispenseBehaviorMaybe {
|
||||
|
||||
public DispenseBehaviorShears() {}
|
||||
@@ -31,11 +37,34 @@
|
||||
@@ -30,11 +36,34 @@
|
||||
@Override
|
||||
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
WorldServer worldserver = isourceblock.getLevel();
|
||||
@@ -49,7 +49,7 @@
|
||||
if (this.isSuccess() && itemstack.hurt(1, worldserver.getRandom(), (EntityPlayer) null)) {
|
||||
itemstack.setCount(0);
|
||||
}
|
||||
@@ -62,7 +91,7 @@
|
||||
@@ -63,7 +92,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
List<EntityLiving> list = worldserver.getEntitiesOfClass(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.NO_SPECTATORS);
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
@@ -73,6 +102,11 @@
|
||||
@@ -74,6 +103,11 @@
|
||||
IShearable ishearable = (IShearable) entityliving;
|
||||
|
||||
if (ishearable.readyForShearing()) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
|
||||
@@ -11,6 +11,11 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.world.level.block.BlockDispenser;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -11,7 +11,7 @@
|
||||
+
|
||||
public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -27,6 +32,30 @@
|
||||
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
||||
EnumDirection enumdirection1 = isourceblock.getLevel().isEmptyBlock(blockposition.below()) ? enumdirection : EnumDirection.UP;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
+++ b/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
@@ -76,6 +76,21 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -75,6 +75,21 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.item.ItemBucket;
|
||||
@@ -21,8 +21,8 @@
|
||||
+
|
||||
public interface IDispenseBehavior {
|
||||
|
||||
Logger LOGGER = LogManager.getLogger();
|
||||
@@ -200,14 +215,42 @@
|
||||
Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -199,14 +214,42 @@
|
||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||
EntityTypes entitytypes = ((ItemMonsterEgg) itemstack.getItem()).getType(itemstack.getTag());
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
isourceblock.getLevel().gameEvent(GameEvent.ENTITY_PLACE, isourceblock.getPos());
|
||||
return itemstack;
|
||||
}
|
||||
@@ -226,12 +269,40 @@
|
||||
@@ -225,12 +268,40 @@
|
||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
||||
WorldServer worldserver = isourceblock.getLevel();
|
||||
@@ -109,7 +109,7 @@
|
||||
return itemstack;
|
||||
}
|
||||
});
|
||||
@@ -250,8 +321,35 @@
|
||||
@@ -249,8 +320,35 @@
|
||||
});
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
@@ -146,7 +146,7 @@
|
||||
this.setSuccess(true);
|
||||
return itemstack;
|
||||
} else {
|
||||
@@ -278,7 +376,35 @@
|
||||
@@ -277,7 +375,35 @@
|
||||
entityhorseabstract = (EntityHorseAbstract) iterator1.next();
|
||||
} while (!entityhorseabstract.isArmor(itemstack) || entityhorseabstract.isWearingArmor() || !entityhorseabstract.isTamed());
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
this.setSuccess(true);
|
||||
return itemstack;
|
||||
}
|
||||
@@ -321,9 +447,35 @@
|
||||
@@ -320,9 +446,35 @@
|
||||
}
|
||||
|
||||
entityhorsechestedabstract = (EntityHorseChestedAbstract) iterator1.next();
|
||||
@@ -221,7 +221,7 @@
|
||||
this.setSuccess(true);
|
||||
return itemstack;
|
||||
}
|
||||
@@ -332,12 +484,41 @@
|
||||
@@ -331,12 +483,41 @@
|
||||
@Override
|
||||
public ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||
@@ -264,7 +264,7 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -359,12 +540,40 @@
|
||||
@@ -358,12 +539,40 @@
|
||||
double d3 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepX();
|
||||
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepY();
|
||||
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepZ();
|
||||
@@ -310,7 +310,7 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -388,9 +597,52 @@
|
||||
@@ -387,9 +596,52 @@
|
||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||
WorldServer worldserver = isourceblock.getLevel();
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
} else {
|
||||
return this.defaultDispenseItemBehavior.dispense(isourceblock, itemstack);
|
||||
}
|
||||
@@ -416,7 +668,7 @@
|
||||
@@ -415,7 +667,7 @@
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (block instanceof IFluidSource) {
|
||||
@@ -373,7 +373,7 @@
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
return super.execute(isourceblock, itemstack);
|
||||
@@ -424,6 +676,32 @@
|
||||
@@ -423,6 +675,32 @@
|
||||
worldserver.gameEvent((Entity) null, GameEvent.FLUID_PICKUP, blockposition);
|
||||
Item item = itemstack1.getItem();
|
||||
|
||||
@@ -406,7 +406,7 @@
|
||||
itemstack.shrink(1);
|
||||
if (itemstack.isEmpty()) {
|
||||
return new ItemStack(item);
|
||||
@@ -445,14 +723,42 @@
|
||||
@@ -444,14 +722,42 @@
|
||||
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
WorldServer worldserver = isourceblock.getLevel();
|
||||
|
||||
@@ -451,7 +451,7 @@
|
||||
} else if (!BlockCampfire.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) {
|
||||
if (iblockdata.getBlock() instanceof BlockTNT) {
|
||||
BlockTNT.explode(worldserver, blockposition);
|
||||
@@ -478,12 +784,62 @@
|
||||
@@ -477,12 +783,62 @@
|
||||
this.setSuccess(true);
|
||||
WorldServer worldserver = isourceblock.getLevel();
|
||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||
@@ -514,7 +514,7 @@
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
@@ -493,12 +849,41 @@
|
||||
@@ -492,12 +848,41 @@
|
||||
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
WorldServer worldserver = isourceblock.getLevel();
|
||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||
@@ -558,7 +558,7 @@
|
||||
return itemstack;
|
||||
}
|
||||
});
|
||||
@@ -522,6 +907,30 @@
|
||||
@@ -521,6 +906,30 @@
|
||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
||||
|
||||
@@ -589,7 +589,7 @@
|
||||
if (worldserver.isEmptyBlock(blockposition) && BlockWitherSkull.canSpawnMob(worldserver, blockposition, itemstack)) {
|
||||
worldserver.setBlock(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.defaultBlockState().setValue(BlockSkull.ROTATION, enumdirection.getAxis() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.getOpposite().get2DDataValue() * 4), 3);
|
||||
worldserver.gameEvent((Entity) null, GameEvent.BLOCK_PLACE, blockposition);
|
||||
@@ -547,6 +956,30 @@
|
||||
@@ -546,6 +955,30 @@
|
||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
|
||||
|
||||
@@ -620,7 +620,7 @@
|
||||
if (worldserver.isEmptyBlock(blockposition) && blockpumpkincarved.canSpawnGolem(worldserver, blockposition)) {
|
||||
if (!worldserver.isClientSide) {
|
||||
worldserver.setBlock(blockposition, blockpumpkincarved.defaultBlockState(), 3);
|
||||
@@ -596,6 +1029,30 @@
|
||||
@@ -595,6 +1028,30 @@
|
||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||
IBlockData iblockdata = worldserver.getBlockState(blockposition);
|
||||
|
||||
@@ -649,5 +649,5 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (iblockdata.is(TagsBlock.BEEHIVES, (blockbase_blockdata) -> {
|
||||
return blockbase_blockdata.hasProperty(BlockBeehive.HONEY_LEVEL);
|
||||
return blockbase_blockdata.hasProperty(BlockBeehive.HONEY_LEVEL) && blockbase_blockdata.getBlock() instanceof BlockBeehive;
|
||||
}) && (Integer) iblockdata.getValue(BlockBeehive.HONEY_LEVEL) >= 5) {
|
||||
|
||||
Reference in New Issue
Block a user