@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockConcretePowder.java
|
||||
+++ b/net/minecraft/world/level/block/BlockConcretePowder.java
|
||||
@@ -14,6 +14,12 @@
|
||||
@@ -16,6 +16,12 @@
|
||||
import net.minecraft.world.level.block.state.BlockBase;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BlockConcretePowder extends BlockFalling {
|
||||
|
||||
public static final MapCodec<BlockConcretePowder> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -36,7 +42,7 @@
|
||||
@@ -38,7 +44,7 @@
|
||||
@Override
|
||||
public void onLand(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, EntityFallingBlock entityfallingblock) {
|
||||
if (shouldSolidify(world, blockposition, iblockdata1)) {
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,7 +53,24 @@
|
||||
@@ -49,7 +55,24 @@
|
||||
BlockPosition blockposition = blockactioncontext.getClickedPos();
|
||||
IBlockData iblockdata = world.getBlockState(blockposition);
|
||||
|
||||
@@ -48,29 +48,29 @@
|
||||
}
|
||||
|
||||
private static boolean shouldSolidify(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -83,7 +106,25 @@
|
||||
@@ -85,7 +108,25 @@
|
||||
|
||||
@Override
|
||||
protected IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
- return touchesLiquid(generatoraccess, blockposition) ? this.concrete.defaultBlockState() : super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
protected IBlockData updateShape(IBlockData iblockdata, IWorldReader iworldreader, ScheduledTickAccess scheduledtickaccess, BlockPosition blockposition, EnumDirection enumdirection, BlockPosition blockposition1, IBlockData iblockdata1, RandomSource randomsource) {
|
||||
- return touchesLiquid(iworldreader, blockposition) ? this.concrete.defaultBlockState() : super.updateShape(iblockdata, iworldreader, scheduledtickaccess, blockposition, enumdirection, blockposition1, iblockdata1, randomsource);
|
||||
+ // CraftBukkit start
|
||||
+ if (touchesLiquid(generatoraccess, blockposition)) {
|
||||
+ if (touchesLiquid(iworldreader, blockposition)) {
|
||||
+ // Suppress during worldgen
|
||||
+ if (!(generatoraccess instanceof World)) {
|
||||
+ if (!(iworldreader instanceof World world)) {
|
||||
+ return this.concrete.defaultBlockState();
|
||||
+ }
|
||||
+ CraftBlockState blockState = CraftBlockStates.getBlockState(generatoraccess, blockposition);
|
||||
+ CraftBlockState blockState = CraftBlockStates.getBlockState(world, blockposition);
|
||||
+ blockState.setData(this.concrete.defaultBlockState());
|
||||
+
|
||||
+ BlockFormEvent event = new BlockFormEvent(blockState.getBlock(), blockState);
|
||||
+ ((World) generatoraccess).getCraftServer().getPluginManager().callEvent(event);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ return blockState.getHandle();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
+ return super.updateShape(iblockdata, iworldreader, scheduledtickaccess, blockposition, enumdirection, blockposition1, iblockdata1, randomsource);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user