From 858f92acb248ec651549b671edc324b34fe607d3 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Sat, 30 Oct 2021 16:39:05 +0800 Subject: [PATCH] Update upstream --- .../common/mixin/bukkit/CraftEventFactoryMixin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEventFactoryMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEventFactoryMixin.java index 7ba6e3ce..4d5eb159 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEventFactoryMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/bukkit/CraftEventFactoryMixin.java @@ -16,6 +16,7 @@ import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v.block.CraftBlock; import org.bukkit.craftbukkit.v.block.CraftBlockState; +import org.bukkit.craftbukkit.v.block.CraftBlockStates; import org.bukkit.craftbukkit.v.block.data.CraftBlockData; import org.bukkit.craftbukkit.v.event.CraftEventFactory; import org.bukkit.craftbukkit.v.util.CraftMagicNumbers; @@ -95,7 +96,7 @@ public class CraftEventFactoryMixin { return true; } - CraftBlockState state = CraftBlockState.getBlockState(world, target, flag); + CraftBlockState state = CraftBlockStates.getBlockState(world, target, flag); state.setData(block); BlockSpreadEvent event = new BlockSpreadEvent(state.getBlock(), CraftBlock.at(world, source), state); @@ -143,7 +144,7 @@ public class CraftEventFactoryMixin { world.setBlock(pos, block, flag); return true; } - CraftBlockState blockState = CraftBlockState.getBlockState(world, pos, flag); + CraftBlockState blockState = CraftBlockStates.getBlockState(world, pos, flag); blockState.setData(block); BlockFormEvent event = (entity == null) ? new BlockFormEvent(blockState.getBlock(), blockState) : new EntityBlockFormEvent(((EntityBridge) entity).bridge$getBukkitEntity(), blockState.getBlock(), blockState); @@ -164,9 +165,9 @@ public class CraftEventFactoryMixin { public static BlockFadeEvent callBlockFadeEvent(LevelAccessor world, BlockPos pos, net.minecraft.world.level.block.state.BlockState newBlock) { // Suppress during worldgen if (!(world instanceof Level) || !DistValidate.isValid(world)) { - return new BlockFadeEvent(CraftBlock.at(world, pos), new CraftBlockState(CraftMagicNumbers.getMaterial(newBlock.getBlock()))); + return new BlockFadeEvent(CraftBlock.at(world, pos), CraftBlockStates.getBlockState(CraftMagicNumbers.getMaterial(newBlock.getBlock()), null)); } - CraftBlockState state = CraftBlockState.getBlockState(world, pos); + CraftBlockState state = CraftBlockStates.getBlockState(world, pos); state.setData(newBlock); BlockFadeEvent event = new BlockFadeEvent(state.getBlock(), state);