Closed pupnewfster closed 6 years ago
Another pointer actually points to ecomod.asm.EcomodASMHooks.itemEntityItemUpdateAddition(EcomodASMHooks.java:341)
Which then also points to the hasSurfaceAccess method.
@pupnewfster, thank you for the work you've done. This function both has a high performance cost and is enough frequent used, so I will consider implementing the algorithm in the next version.
What about your proposal, I'll gladly accept any help towards the mod development.
Ok. In fact when you are looping over
for(EnumFacing facing : EnumFacing.HORIZONTALS)
you probably also want to check to see if b is in was_at
I am working on a pull request that should improve how the method works. (I noticed a couple errors with how I suggested doing it as I was writing it from outside a compiler). I am also looking at other locations where things may be calculated more times than required.
I will also see about performance differences between just using the list of BlockPos and my suggested way of changing to a HashMap.
Recently I have run a mod called TickProfiler to try to find any sources of lag and it throws a lot of messages like the one at the bottom.
Looking at the method hasSurfaceAccess there are a few comments I have:
isBlockHollow(w, bp.up(), EnumFacing.UP)
and then call it again on line 102. Except that this method seems more costly. So it should most likely be more likeif(hollow && hasSurfaceAccess(w, bp.up(), was_at)) return true;
You could even use a set of some kind instead of a List, as the order does not matter as it is only for lookup.
If you want I may look at some point through the rest of the code and see if there are any other potential performance improvements throughout it, and then submit them as a pull request.
EcoMod version: 1.12.2 - 1.4.1.0