reapply SummonEntityEffect

This commit is contained in:
Lulu13022002
2024-12-19 18:35:43 +01:00
parent a438cc45f6
commit 1f86b55302
5 changed files with 14 additions and 22 deletions

View File

@@ -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());
+ }
+ };

View File

@@ -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
}