FloatBuffer fb = BufferUtils.createFloatBuffer(16 * Float.SIZE);
HashMap<CelestialBody, Matrix4f> matrixMap = Maps.newHashMap();
for (SolarSystem solarSystem : GalaxyRegistry.getRegisteredSolarSystems().values())
{
Star star = solarSystem.getMainStar();
if (star != null && star.getBodyIcon() != null)
{
GL11.glPushMatrix();
Matrix4f worldMatrix0 = new Matrix4f(worldMatrix);
Matrix4f.translate(this.getCelestialBodyPosition(star), worldMatrix0, worldMatrix0);
Matrix4f worldMatrix1 = new Matrix4f();
Matrix4f.rotate((float) Math.toRadians(45), new Vector3f(0, 0, 1), worldMatrix1, worldMatrix1);
Matrix4f.rotate((float) Math.toRadians(-55), new Vector3f(1, 0, 0), worldMatrix1, worldMatrix1);
worldMatrix1 = Matrix4f.mul(worldMatrix0, worldMatrix1, worldMatrix1);
fb.rewind();
worldMatrix1.store(fb);
fb.flip();
GL11.glMultMatrix(fb);
float alpha = 1.0F;
if (this.selectedBody != null && this.selectedBody != star && this.selectionCount >= 2)
{
alpha = 1.0F - Math.min(this.ticksSinceSelection / 25.0F, 1.0F);
}
if (this.selectedBody != null && this.selectionCount >= 2)
{
if (star != this.selectedBody)
{
alpha = 1.0F - Math.min(this.ticksSinceSelection / 25.0F, 1.0F);
if (!(this.lastSelectedBody instanceof Star) && this.lastSelectedBody != null)
{
alpha = 0.0F;
}
}
}
if (alpha != 0)
{
CelestialBodyRenderEvent.Pre preEvent = new CelestialBodyRenderEvent.Pre(star, star.getBodyIcon(), 8);
MinecraftForge.EVENT_BUS.post(preEvent);
GL11.glColor4f(1, 1, 1, alpha);
if (preEvent.celestialBodyTexture != null)
{