diff options
author | Lulu13022002 <[email protected]> | 2024-12-19 18:35:43 +0100 |
---|---|---|
committer | Lulu13022002 <[email protected]> | 2024-12-19 21:29:31 +0100 |
commit | 1f86b55302987565028f96f8fe8e07d441cdb98b (patch) | |
tree | 504a5c7c3dc2826ded8e73525f96846c73987b48 | |
parent | a438cc45f60220d5cae88f9e1b3e015071cc1bb2 (diff) | |
download | Paper-1f86b55302987565028f96f8fe8e07d441cdb98b.tar.gz Paper-1f86b55302987565028f96f8fe8e07d441cdb98b.zip |
reapply SummonEntityEffect
5 files changed, 14 insertions, 22 deletions
diff --git a/paper-server/patches/features/0007-Anti-Xray.patch b/paper-server/patches/features/0007-Anti-Xray.patch index 801b9fcda9..bb7e6f43a4 100644 --- a/paper-server/patches/features/0007-Anti-Xray.patch +++ b/paper-server/patches/features/0007-Anti-Xray.patch @@ -166,10 +166,10 @@ index 7702004b68b7735043914f93b54b4413cd21ba41..4d20bda4cba578c47216d450c99389b7 this.levelStorageAccess = levelStorageAccess; this.uuid = org.bukkit.craftbukkit.util.WorldUUID.getUUID(levelStorageAccess.levelDirectory.path().toFile()); diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java -index d7028ed8ebdecd647467b67f62f7431a6df59f76..9fdb825be2b04a5806bbb3d39948bad0863e7ae5 100644 +index 23d241e98f37979701f80fb6f7b76954bd699ad6..fd7ad2b1bffe3880def0f0c9a7ed8de5088ecd71 100644 --- a/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -312,6 +312,7 @@ public class ServerPlayerGameMode { +@@ -298,6 +298,7 @@ public class ServerPlayerGameMode { org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDamageAbortEvent(this.player, pos, this.player.getInventory().getSelected()); // CraftBukkit } } @@ -269,7 +269,7 @@ index 809b3c37d3749c76c3c243cd91c593d03693e9b3..860d1c9729c4ee97ec6f40f7aa969829 } } diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 2b5d99eb6860578cc1af8fbe2571c314846984dd..bc4260623dfb1d804f41593293a5c176c86df5a1 100644 +index 51a136cf015de730ca0d1b48cf618a2ed69ea89f..96b0342ab7b922aa16d07b6c00542e6cb66c974a 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java @@ -109,7 +109,7 @@ public class LevelChunk extends ChunkAccess { diff --git a/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/ReplaceBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/ReplaceBlock.java.patch index 497dec7455..4e789c8e9d 100644 --- a/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/ReplaceBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/ReplaceBlock.java.patch @@ -1,10 +1,8 @@ --- a/net/minecraft/world/item/enchantment/effects/ReplaceBlock.java +++ b/net/minecraft/world/item/enchantment/effects/ReplaceBlock.java -@@ -29,8 +_,9 @@ - @Override +@@ -30,7 +_,7 @@ public void apply(ServerLevel level, int enchantmentLevel, EnchantedItemInUse item, Entity entity, Vec3 origin) { BlockPos blockPos = BlockPos.containing(origin).offset(this.offset); -+ // }).orElse(true) && if (this.predicate.map(blockPredicate -> blockPredicate.test(level, blockPos)).orElse(true) - && level.setBlockAndUpdate(blockPos, this.blockState.getState(entity.getRandom(), blockPos))) { + && org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(level, blockPos, this.blockState.getState(entity.getRandom(), blockPos), entity)) { // CraftBukkit - Call EntityBlockFormEvent diff --git a/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java.patch b/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java.patch index 913d9aeec7..cf03e4582d 100644 --- a/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java +++ b/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java -@@ -34,11 +_,16 @@ +@@ -34,11 +_,18 @@ if (Level.isInSpawnableBounds(blockPos)) { Optional<Holder<EntityType<?>>> randomElement = this.entityTypes().getRandomElement(level.getRandom()); if (!randomElement.isEmpty()) { @@ -11,9 +11,11 @@ lightningBolt.setCause(serverPlayer); } + // CraftBukkit start -+ level.strikeLightning(entity1, (item.itemStack().getItem() == net.minecraft.world.item.Items.TRIDENT) ? org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT : org.bukkit.event.weather.LightningStrikeEvent.Cause.ENCHANTMENT); -+ } else { -+ level.addFreshEntityWithPassengers(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.ENCHANTMENT); ++ if (entity1 instanceof LightningBolt) { ++ level.strikeLightning(entity1, (item.itemStack().is(net.minecraft.world.item.Items.TRIDENT)) ? org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT : org.bukkit.event.weather.LightningStrikeEvent.Cause.ENCHANTMENT); ++ } else { ++ level.addFreshEntityWithPassengers(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.ENCHANTMENT); ++ } + // CraftBukkit end if (this.joinTeam && entity.getTeam() != null) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch index 680447ba4e..9ee94df160 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch @@ -90,7 +90,7 @@ + final List<BlockPos> moved = pistonStructureResolver.getToPush(); + final List<BlockPos> broken = pistonStructureResolver.getToDestroy(); + -+ List<org.bukkit.block.Block> blocks = new java.util.AbstractList<org.bukkit.block.Block>() { ++ List<org.bukkit.block.Block> blocks = new java.util.AbstractList<>() { + + @Override + public int size() { @@ -102,7 +102,7 @@ + if (index >= this.size() || index < 0) { + throw new ArrayIndexOutOfBoundsException(index); + } -+ BlockPos pos = (BlockPos) (index < moved.size() ? moved.get(index) : broken.get(index - moved.size())); ++ BlockPos pos = index < moved.size() ? moved.get(index) : broken.get(index - moved.size()); + return bblock.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); + } + }; diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch index 4f4759e0c9..ee4aa83de5 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -1,13 +1,5 @@ --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -46,6 +_,7 @@ - import net.minecraft.world.item.Item; - import net.minecraft.world.item.ItemStack; - import net.minecraft.world.item.context.BlockPlaceContext; -+import net.minecraft.world.item.context.UseOnContext; - import net.minecraft.world.level.BlockGetter; - import net.minecraft.world.level.EmptyBlockGetter; - import net.minecraft.world.level.Explosion; @@ -167,16 +_,24 @@ } @@ -17,7 +9,7 @@ + } + + // CraftBukkit start -+ protected void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, @Nullable UseOnContext context) { ++ protected void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, @Nullable net.minecraft.world.item.context.UseOnContext context) { + this.onPlace(iblockdata, world, blockposition, iblockdata1, flag); + } + // CraftBukkit end @@ -152,7 +144,7 @@ + this.onPlace(level, pos, oldState, movedByPiston, null); + } + -+ public void onPlace(Level level, BlockPos pos, BlockState oldState, boolean movedByPiston, @Nullable UseOnContext context) { ++ public void onPlace(Level level, BlockPos pos, BlockState oldState, boolean movedByPiston, @Nullable net.minecraft.world.item.context.UseOnContext context) { + this.getBlock().onPlace(this.asState(), level, pos, oldState, movedByPiston, context); + // CraftBukkit end } |