RocketEntity added. Uses RocketRenderer and RocketStructure to render blocks. RocketStructure supports volumes up to 128^3.

This commit is contained in:
XevianLight
2026-01-24 21:24:20 -07:00
parent 5500b78e53
commit 59062724ff
29 changed files with 769 additions and 52 deletions

View File

@@ -0,0 +1,43 @@
package net.xevianlight.aphelion.planet;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.mojang.serialization.JsonOps;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
import net.minecraft.util.GsonHelper;
import net.minecraft.util.profiling.ProfilerFiller;
import net.xevianlight.aphelion.Aphelion;
import net.xevianlight.aphelion.client.dimension.DimensionRenderer;
import net.xevianlight.aphelion.util.Constants;
import java.util.HashMap;
import java.util.Map;
public class AphelionPlanetJSONLoader extends SimpleJsonResourceReloadListener {
public AphelionPlanetJSONLoader() {
super(Constants.GSON, "planet");
}
@Override
protected void apply(Map<ResourceLocation, JsonElement> object,
ResourceManager resourceManager,
ProfilerFiller profiler) {
Map<ResourceLocation, Planet> planets = new HashMap<>();
object.forEach((key, value) -> {
JsonObject json = GsonHelper.convertToJsonObject(value, "planet");
Planet planet = Planet.CODEC.parse(JsonOps.INSTANCE, json).getOrThrow();
// IMPORTANT: use the *resource id* of the json as the lookup key
// so "effects": "aphelion:space" maps to space.json automatically.
planets.put(key, planet);
});
Aphelion.LOGGER.info("Loaded planets " + planets);
PlanetCache.registerPlanets(planets);
}
}