Skip to content

Commit

Permalink
Fixed mobs instant sinking
Browse files Browse the repository at this point in the history
  • Loading branch information
KekeCreations committed May 6, 2024
1 parent 774c73d commit 55d4eea
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ public void onRemove(BlockState blockState, Level pLevel, BlockPos blockPos, Blo
@Override
public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity pEntity) {
BlockEntity blockEntity = pLevel.getBlockEntity(pPos);
BlockEntity blockEntityBelow = pLevel.getBlockEntity(pPos.below());
if (blockEntity instanceof AmberBE amber) {
if (!amber.hasStuckEntity() && amber.isBlockMelted()) {
if (!(pEntity instanceof LivingEntity) || pEntity.getFeetBlockState().is(this)) {
if (pEntity instanceof Player) {
pEntity.makeStuckInBlock(pState, new Vec3(0.8F, 0.1D, 0.8F));
} else if (pEntity instanceof Mob mob) {
mob.makeStuckInBlock(pState, new Vec3(0.0F, 0.1D, 0.0F));
if (!mob.getBlockStateOn().is(SMBlocks.AMBER.get()) || (blockEntityBelow instanceof AmberBE amberBE && amberBE.hasStuckEntity())) {
if (mob.onGround()) {
amber.makeEntityStuck(mob);
}
}
Expand Down

0 comments on commit 55d4eea

Please sign in to comment.