mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
Transporter performance improvements (#5488)
* Improve performance of predicted insert. Don't copy stacks nearly as often * Cache what stack is in the slots and update comments * Cleanup up pathfinder code some * Clean up a bit more mainly TileComponentEjector * Fix crash caused by an earlier commit * Minor cleanup * Minor cleanup * Slightly clean up TileEntityBin and fix creative bin auto eject lowering item count * Partially cleanup getpaths, and prep work for better handling of AcceptorData with mulitple TransitResponses * Scratch previous attempted idea of combining responses * Use EnumMap instead of HashMap for keeping track of side data for Ejector and prep for an eventual change to TransitResponse of inserting into more than one slot at a time if the stack would be best split among multiple * Change some more HashMaps to EnumMaps * Make it easier to read component ejector for gas and fluids * Inline getStacksToDest so that it can bail even earlier in cases when destination is full * Don't create a copy of the stack if it won't be inserted AND also fix having broken inserting across multiple slots * Replace a bunch of other HashMap instances with EnumMap where possible * Make a couple sets more generic * Use Int2ObjectMap for int based cache & tidy clamping * ensure EnumMap doesnt throw NPE * FastUtil map changes
This commit is contained in:
1 parent
72951d2c66
commit
d19f1cd7eb
49 files changed
+557
-551
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package mekanism.client.render.tileentity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
@@ -18,15 +19,14 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderTeleporter extends TileEntitySpecialRenderer<TileEntityTeleporter> {
|
||||
|
||||
private HashMap<Integer, DisplayInteger> cachedOverlays = new HashMap<>();
|
||||
private Map<Integer, DisplayInteger> cachedOverlays = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void render(TileEntityTeleporter tileEntity, double x, double y, double z, float partialTick, int destroyStage, float alpha) {
|
||||
if (tileEntity.shouldRender) {
|
||||
push();
|
||||
|
||||
GL11.glColor4f(EnumColor.PURPLE.getColor(0), EnumColor.PURPLE.getColor(1), EnumColor.PURPLE.getColor(2),
|
||||
0.75F);
|
||||
GL11.glColor4f(EnumColor.PURPLE.getColor(0), EnumColor.PURPLE.getColor(1), EnumColor.PURPLE.getColor(2), 0.75F);
|
||||
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
GlStateManager.translate((float) x, (float) y, (float) z);
|
||||
|
||||
Reference in new issue
Block a user