You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple check comparing the radius with the distance between the rift block and the randomly selected block would suffice to fix the problem and make the decay pattern grow far better and less regular.
This suggestion is unique
Use the editor below to elaborate.
The applySpreadDecay method from the DetachedRiftBlockEntity class uses the raw output of the BlockPos.randomInCube method, which causes a cubic decay pattern far too regular.
A simple check comparing the radius with the distance between the rift block and the randomly selected block would suffice to fix the problem and make the decay pattern grow far better and less regular.
The code addition below would add such check
public void applySpreadDecay(ServerLevel world, BlockPos pos) { float chance = this.size / 100.0F; if (random.nextFloat() <= chance) { BlockPos selected = (BlockPos)BlockPos.randomInCube(world.getRandom(), 1, pos, (int)chance).iterator().next(); ++ if (pos.getCenter().distanceTo(selected.getCenter()) >= (int) chance) {return} Decay.decayBlock(world, selected, world.getBlockState(selected), DecaySource.RIFT); } }
Resulting in the following effect
The text was updated successfully, but these errors were encountered: