Fixed respawn anchor explode blocks underwater#6929
Fixed respawn anchor explode blocks underwater#6929b1zeyofficial wants to merge 8 commits intopmmp:minor-nextfrom
Conversation
| } | ||
| } | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Why isn't this checking the down face?
There was a problem hiding this comment.
I seem to have forgotten that the Java code checks for water under each horizontal block, since the existing code is similar to vanilla behavior.
P.S:
Apparently we should only check for horizontal blocks and not the Respawn Anchor itself, im confused
private static boolean isWaterThatWouldFlow(BlockPos blockPos, Level level) {
FluidState fluidState = level.getFluidState(blockPos);
if (!fluidState.is(FluidTags.WATER)) {
return false;
} else if (fluidState.isSource()) {
return true;
} else {
float f = fluidState.getAmount();
if (f < 2.0F) {
return false;
} else {
FluidState fluidState2 = level.getFluidState(blockPos.below());
return !fluidState2.is(FluidTags.WATER);
}
}
}
private void explode(BlockState blockState, Level level, BlockPos blockPos) {
level.removeBlock(blockPos, false);
boolean bl = Direction.Plane.HORIZONTAL.stream().map(blockPos::relative).anyMatch(blockPosx -> isWaterThatWouldFlow(blockPosx, level));|
It doesnt really mimic vanilla behavior, for example, when water flows and a respawn anchor is placed in place, it doesnt explode blocks like it does in vanilla. Can we measure the fluidity of water using the Liquid->getDecay method? |
|
Yes, but decay is opposite to the fluid height. 0 is source, 7 is the shallowest. |
|
everything remained the same, only the style changed and a couple of changes, it seems like I check that decay >= 1 but it still explodes after only 2 streams, maybe I miscalculated somewhere? |
As per title
Related issues & PRs
Behavioural changes
i think the servers behavior shouldnt change, but need to check
Tests
https://www.youtube.com/watch?v=FK-LLQQMVEo