Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -1,32 +1,32 @@
--- a/net/minecraft/world/item/ItemFlintAndSteel.java
+++ b/net/minecraft/world/item/ItemFlintAndSteel.java
@@ -36,6 +36,14 @@
BlockPosition blockposition1 = blockposition.shift(itemactioncontext.getClickedFace());
@@ -34,6 +34,14 @@
BlockPosition blockposition1 = blockposition.relative(itemactioncontext.getClickedFace());
if (BlockFireAbstract.a(world, blockposition1, itemactioncontext.g())) {
if (BlockFireAbstract.canBePlacedAt(world, blockposition1, itemactioncontext.getHorizontalDirection())) {
+ // CraftBukkit start - Store the clicked block
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition1, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) {
+ itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.broadcastItemBreak(itemactioncontext.getHand());
+ itemactioncontext.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.broadcastBreakEvent(itemactioncontext.getHand());
+ });
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
world.playSound(entityhuman, blockposition1, SoundEffects.FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
IBlockData iblockdata1 = BlockFireAbstract.a((IBlockAccess) world, blockposition1);
IBlockData iblockdata1 = BlockFireAbstract.getState(world, blockposition1);
@@ -55,6 +63,14 @@
@@ -53,6 +61,14 @@
return EnumInteractionResult.FAIL;
}
} else {
+ // CraftBukkit start - Store the clicked block
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) {
+ itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.broadcastItemBreak(itemactioncontext.getHand());
+ itemactioncontext.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> {
+ entityhuman1.broadcastBreakEvent(itemactioncontext.getHand());
+ });
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
world.playSound(entityhuman, blockposition, SoundEffects.FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.LIT, true), 11);
world.a((Entity) entityhuman, GameEvent.BLOCK_PLACE, blockposition);
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true), 11);
world.gameEvent(entityhuman, GameEvent.BLOCK_PLACE, blockposition);