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,31 +1,31 @@
--- a/net/minecraft/world/item/ItemFireball.java
+++ b/net/minecraft/world/item/ItemFireball.java
@@ -34,12 +34,28 @@
if (!BlockCampfire.h(iblockdata) && !CandleBlock.g(iblockdata) && !CandleCakeBlock.g(iblockdata)) {
blockposition = blockposition.shift(itemactioncontext.getClickedFace());
if (BlockFireAbstract.a(world, blockposition, itemactioncontext.g())) {
@@ -32,12 +32,28 @@
if (!BlockCampfire.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) {
blockposition = blockposition.relative(itemactioncontext.getClickedFace());
if (BlockFireAbstract.canBePlacedAt(world, blockposition, itemactioncontext.getHorizontalDirection())) {
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) {
+ if (!itemactioncontext.getEntity().getAbilities().instabuild) {
+ itemactioncontext.getItemStack().subtract(1);
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getPlayer()).isCancelled()) {
+ if (!itemactioncontext.getPlayer().getAbilities().instabuild) {
+ itemactioncontext.getItemInHand().shrink(1);
+ }
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
this.a(world, blockposition);
world.setTypeUpdate(blockposition, BlockFireAbstract.a((IBlockAccess) world, blockposition));
world.a((Entity) itemactioncontext.getEntity(), GameEvent.BLOCK_PLACE, blockposition);
this.playSound(world, blockposition);
world.setBlockAndUpdate(blockposition, BlockFireAbstract.getState(world, blockposition));
world.gameEvent(itemactioncontext.getPlayer(), GameEvent.BLOCK_PLACE, blockposition);
flag = true;
}
} else {
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) {
+ if (!itemactioncontext.getEntity().getAbilities().instabuild) {
+ itemactioncontext.getItemStack().subtract(1);
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getPlayer()).isCancelled()) {
+ if (!itemactioncontext.getPlayer().getAbilities().instabuild) {
+ itemactioncontext.getItemInHand().shrink(1);
+ }
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
this.a(world, blockposition);
world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockProperties.LIT, true));
world.a((Entity) itemactioncontext.getEntity(), GameEvent.BLOCK_PLACE, blockposition);
this.playSound(world, blockposition);
world.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true));
world.gameEvent(itemactioncontext.getPlayer(), GameEvent.BLOCK_PLACE, blockposition);