From 97b0461d7ff8b05afb459cc508f7149b65d8062a Mon Sep 17 00:00:00 2001 From: DeltaNedas Date: Fri, 16 Oct 2020 23:00:06 +0100 Subject: [PATCH] allow modded planets to customize drawing --- core/src/mindustry/graphics/g3d/PlanetRenderer.java | 4 +++- core/src/mindustry/type/Planet.java | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/graphics/g3d/PlanetRenderer.java b/core/src/mindustry/graphics/g3d/PlanetRenderer.java index e3eb74a7b5..75e9989232 100644 --- a/core/src/mindustry/graphics/g3d/PlanetRenderer.java +++ b/core/src/mindustry/graphics/g3d/PlanetRenderer.java @@ -110,8 +110,10 @@ public class PlanetRenderer implements Disposable{ } private void renderPlanet(Planet planet){ + if(!planet.visible()) return; + //render planet at offsetted position in the world - planet.mesh.render(cam.combined, planet.getTransform(mat)); + planet.render(cam.combined, planet.getTransform(mat)); renderOrbit(planet); diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index 6153aa4721..47c8bc1750 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -264,4 +264,12 @@ public class Planet extends UnlockableContent{ public ContentType getContentType(){ return ContentType.planet; } + + public boolean visible(){ + return true; + } + + public void draw(Mat3D projection, Mat3d Transform){ + mesh.render(projection, transform); + } }