ImmersiveMC

ImmersiveMC

2M Downloads

API Methods Take `BlockState` and `BlockEntity`

hammy275 opened this issue ยท 0 comments

commented

I removed these earlier for performance reasons, but that was because I had written bad code.

Most API methods, such as checking if a block matches an Immersive, only take a position and a level. As a result, each one needs to separately getBlockState() or getBlockEntity().

This is wildly inefficient! We should be getting each once, then implementations just look at the provided BlockState/BlockEntity. If they want different data, the Level and BlockPos are still provided to get that info.