net.minecraft.entity.FallingBlockEntity Java Examples
The following examples show how to use
net.minecraft.entity.FallingBlockEntity.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FallingBlockMixin.java From carpet-extra with GNU Lesser General Public License v3.0 | 4 votes |
@SuppressWarnings("ConstantConditions") @Inject(method = "scheduledTick", at = @At("HEAD"), cancellable = true) private void onTryStartFalling(BlockState blockState_1, ServerWorld serverWorld_1, BlockPos blockPos_1, Random random_1, CallbackInfo ci) { if (CarpetExtraSettings.dragonEggBedrockBreaking && (FallingBlock)(Object)this instanceof DragonEggBlock) { if (canFallThrough(serverWorld_1.getBlockState(blockPos_1.down(1))) && blockPos_1.getY() >= 0) { if (!DragonEggBedrockBreaking.fallInstantly && serverWorld_1.getChunkManager().shouldTickChunk(new ChunkPos(blockPos_1))) { if (!serverWorld_1.isClient) { FallingBlockEntity fallingBlockEntity_1 = new FallingBlockEntity(serverWorld_1, (double) blockPos_1.getX() + 0.5D, (double) blockPos_1.getY(), (double) blockPos_1.getZ() + 0.5D, serverWorld_1.getBlockState(blockPos_1)); this.configureFallingBlockEntity(fallingBlockEntity_1); serverWorld_1.spawnEntity(fallingBlockEntity_1); } } else { if (serverWorld_1.getBlockState(blockPos_1).getBlock() == this) { serverWorld_1.removeBlock(blockPos_1, false); } BlockPos blockPos; int minY = CarpetExtraSettings.y0DragonEggBedrockBreaking ? -1 : 0; for (blockPos = blockPos_1.down(1); canFallThrough(serverWorld_1.getBlockState(blockPos)) && blockPos.getY() > minY; blockPos = blockPos.down(1)) { ; } if (blockPos.getY() > minY) { serverWorld_1.setBlockState(blockPos, this.getDefaultState()); } } } ci.cancel(); } }
Example #2
Source File: FallingBlockMixin.java From carpet-extra with GNU Lesser General Public License v3.0 | votes |
@Shadow protected abstract void configureFallingBlockEntity(FallingBlockEntity fallingBlockEntity_1);