Skip to content

Commit

Permalink
Merge pull request #227 from gabrielgaudreault/1.19
Browse files Browse the repository at this point in the history
fix generaton bug + other
  • Loading branch information
MrScautHD authored Feb 11, 2023
2 parents 4100b20 + f3cd41d commit a51ee22
Show file tree
Hide file tree
Showing 125 changed files with 564 additions and 1,742 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mod_version=6.3e
mod_version=6.3j

mc_version=1.19.2
loader_version=43
forge_version=43.2.1
mixin_version=0.8.5

version_jei=238222:3969039
version_jei=238222:4128326
top_file=3965693
jade_file=4010505
mekanism_version=10.3.4.471
5 changes: 3 additions & 2 deletions src/main/java/net/mrscauthd/beyond_earth/BeyondEarth.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import net.minecraftforge.fml.config.ModConfig;
import net.mrscauthd.beyond_earth.common.config.Config;
import net.mrscauthd.beyond_earth.common.registries.*;
import net.mrscauthd.beyond_earth.common.world.ModConfiguredFeature;
import net.mrscauthd.beyond_earth.common.world.ModPlacedFeature;
import net.mrscauthd.beyond_earth.common.world.modifiers.ModBiomeModifiers;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -47,7 +47,8 @@ public BeyondEarth() {
StructureRegistry.STRUCTURES.register(bus);
FeatureRegistry.FEATURES.register(bus);
ModPlacedFeature.PLACED_FEATURE.register(bus);
ModBiomeModifiers.BIOME_MODIFIERS.register(bus);
ModConfiguredFeature.CONFIGURED_FEATURES.register(bus);
//ModBiomeModifiers.BIOME_MODIFIERS.register(bus);

MinecraftForge.EVENT_BUS.register(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ public PlanetSky(float cloudLevel, Planet planet) {

@Override
public Vec3 getBrightnessDependentFogColor(Vec3 colour, float brightness) {
// If we have no iar density, return nothing
if (planet.airDensity <= 0)
return colour;
// This is the default used by overworld
if (planet != null) {
// If we have no iar density, return nothing
if (planet.airDensity <= 0)
return colour;
// This is the default used by overworld
}
return colour.multiply(brightness * 0.94F + 0.06F, brightness * 0.94F + 0.06F, brightness * 0.91F + 0.09F);
}

@Nullable
@Override
public float[] getSunriseColor(float time, float partialTick) {
if (planet == null)
return null;
// No colour if planet has it disabled.
if (planet.airDensity <= 0 || planet.sunriseColour[0] < 0) {
sunriseCol[0] = 0;
Expand Down Expand Up @@ -101,20 +105,28 @@ public boolean isFoggyAt(int p_108874_, int p_108875_) {

@Override
public boolean renderClouds(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, double camX,
double camY, double camZ, Matrix4f projectionMatrix) {
double camY, double camZ, Matrix4f projectionMatrix) {
if (planet == null)
return false;
// If we return true, but do nothing, it disables cloud rendering!
return !planet.hasClouds;
}

@Override
public boolean tickRain(ClientLevel level, int ticks, Camera camera) {
if (planet == null)
return false;
// If we return true, but do nothing, it disables rain rendering!
return !planet.hasRain;
}

@Override
public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera,
Matrix4f projectionMatrix, boolean isFoggy, Runnable setupFog) {
Matrix4f projectionMatrix, boolean isFoggy, Runnable setupFog) {

if (planet == null)
return false;

Minecraft mc = Minecraft.getInstance();

setupFog.run();
Expand Down Expand Up @@ -190,7 +202,9 @@ public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseSt

@Override
public boolean renderSnowAndRain(ClientLevel level, int ticks, float partialTick, LightTexture lightTexture,
double camX, double camY, double camZ) {
double camX, double camY, double camZ) {
if (planet == null)
return false;

if (planet.hasDustStorms) {
Minecraft mc = Minecraft.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.HashMap;
import java.util.List;

import net.mrscauthd.beyond_earth.common.util.Methods;
import org.jetbrains.annotations.Nullable;

import com.google.common.collect.Maps;
Expand Down Expand Up @@ -54,9 +55,7 @@ public void fillItemCategory(CreativeModeTab tab, NonNullList<ItemStack> list) {
ItemStack itemStack = new ItemStack(this);
IOxygenStorage oxygen = OxygenUtil.getItemStackOxygenStorage(itemStack);

if (oxygen != null) {
oxygen.setOxygen(oxygen.getMaxCapacity());
}
oxygen.setOxygen(oxygen.getMaxCapacity());

list.add(itemStack);
}
Expand All @@ -66,10 +65,7 @@ public void fillItemCategory(CreativeModeTab tab, NonNullList<ItemStack> list) {
public void appendHoverText(ItemStack itemStack, Level level, List<Component> list, TooltipFlag tooltipFlag) {
super.appendHoverText(itemStack, level, list, tooltipFlag);
IOxygenStorage oxygen = OxygenUtil.getItemStackOxygenStorage(itemStack);

if (oxygen != null) {
list.add(Component.translatable("general." + BeyondEarth.MODID + ".oxygen").append(": ").withStyle(ChatFormatting.BLUE).append("\u00A76" + oxygen.getOxygen() + " mb" + "\u00A78" + " | " + "\u00A7c" + oxygen.getMaxCapacity() + " mb"));
}
list.add(Component.translatable("general." + BeyondEarth.MODID + ".oxygen").append(": ").withStyle(ChatFormatting.BLUE).append("\u00A76" + oxygen.getOxygen() + " mb" + "\u00A78" + " | " + "\u00A7c" + oxygen.getMaxCapacity() + " mb"));
}

@Override
Expand All @@ -80,6 +76,7 @@ public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundT
@Override
public void onArmorTick(ItemStack stack, Level level, Player player) {
super.onArmorTick(stack, level, player);

}

public abstract int getOxygenCapacity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public Suit(ArmorMaterial armorMaterial, EquipmentSlot equipmentSlot, Properties
//TODO FINISH ANIMATIONS
//TODO ADD ENERGY CAP
//TODO REWORK OVERLAY
//TODO ADD RECIPE

@Override
public void initializeClient(Consumer<IClientItemExtensions> consumer) {
Expand All @@ -93,7 +92,6 @@ public void initializeClient(Consumer<IClientItemExtensions> consumer) {
"body", new JetSuitModel.JetSuitP1<>(Minecraft.getInstance().getEntityModels().bakeLayer(JetSuitModel.JetSuitP1.LAYER_LOCATION)).body,
"right_arm", new JetSuitModel.JetSuitP1<>(Minecraft.getInstance().getEntityModels().bakeLayer(JetSuitModel.JetSuitP1.LAYER_LOCATION)).rightArm,
"left_arm", new JetSuitModel.JetSuitP1<>(Minecraft.getInstance().getEntityModels().bakeLayer(JetSuitModel.JetSuitP1.LAYER_LOCATION)).leftArm,

"head", new ModelPart(Collections.emptyList(), Collections.emptyMap()),
"right_leg", new ModelPart(Collections.emptyList(), Collections.emptyMap()),
"left_leg", new ModelPart(Collections.emptyList(), Collections.emptyMap())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import net.mrscauthd.beyond_earth.common.blocks.entities.machines.power.PowerSystemEnergyCommon;
import net.mrscauthd.beyond_earth.common.blocks.entities.machines.power.PowerSystemRegistry;
import net.mrscauthd.beyond_earth.common.capabilities.energy.EnergyStorageBasic;
import net.mrscauthd.beyond_earth.common.capabilities.oxygen.OxygenStorage;
import net.mrscauthd.beyond_earth.common.capabilities.oxygen.IOxygenStorage;
import net.mrscauthd.beyond_earth.common.capabilities.oxygen.OxygenUtil;
import net.mrscauthd.beyond_earth.common.config.Config;
import net.mrscauthd.beyond_earth.common.data.recipes.BeyondEarthRecipeType;
Expand Down Expand Up @@ -139,7 +139,7 @@ public boolean isSinkSlot(int slot) {
return slot == this.getOutputSinkSlot() || super.isSinkSlot(slot);
}

public OxygenStorage slotToOxygenTank(int slot) {
public IOxygenStorage slotToOxygenTank(int slot) {
if (slot == this.getOutputSourceSlot() || slot == this.getOutputSinkSlot()) {
return this.getOutputTank();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public boolean hasSpaceInOutput(int oxygen) {
return hasSpaceInOutput(oxygen, this.getOutputTank());
}

public boolean hasSpaceInOutput(int oxygen, OxygenStorage storage) {
public boolean hasSpaceInOutput(int oxygen, IOxygenStorage storage) {
return (oxygen + storage.getOxygen()) <= storage.getMaxCapacity();
}

Expand Down Expand Up @@ -253,7 +253,7 @@ public FluidTank slotToFluidTank(int slot) {
}
}

public OxygenStorage slotToOxygenTank(int slot) {
public IOxygenStorage slotToOxygenTank(int slot) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class ItemsRegistry {
public static final RegistryObject<BlockItem> GLACIO_GLOBE_ITEM = ITEMS.register("glacio_globe", () -> new GlobeItem(BlockRegistry.GLACIO_GLOBE_BLOCK.get(), new Item.Properties().tab(Tabs.tab_globes).rarity(Rarity.EPIC).stacksTo(1), new ResourceLocation(BeyondEarth.MODID, "textures/block/globes/glacio_globe.png")));

/** SPACE SUIT ITEMS */
//public static final RegistryObject<Item> OXYGEN_MASK = ITEMS.register("oxygen_mask", () -> new SpaceSuit.Helmet(SpaceSuitMaterial.ARMOR_MATERIAL, EquipmentSlot.HEAD, new Item.Properties().tab(Tabs.tab_normal)));
public static final RegistryObject<Item> SPACE_HELMET = ITEMS.register("space_helmet", () -> new SpaceSuit.Helmet(SpaceSuitMaterial.ARMOR_MATERIAL, EquipmentSlot.HEAD, new Item.Properties().tab(Tabs.tab_normal)));
public static final RegistryObject<Item> SPACE_SUIT = ITEMS.register("space_suit", () -> new SpaceSuit.Suit(SpaceSuitMaterial.ARMOR_MATERIAL, EquipmentSlot.CHEST, new Item.Properties().tab(Tabs.tab_normal)));
public static final RegistryObject<Item> SPACE_PANTS = ITEMS.register("space_pants", () -> new SpaceSuit.Pants(SpaceSuitMaterial.ARMOR_MATERIAL, EquipmentSlot.LEGS, new Item.Properties().tab(Tabs.tab_normal)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
package net.mrscauthd.beyond_earth.common.registries;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.mrscauthd.beyond_earth.BeyondEarth;
import net.mrscauthd.beyond_earth.common.util.Planets;

import static net.mrscauthd.beyond_earth.common.util.Planets.BY_DIMENSION;

public class PlanetsRegistry {

/** PLANET BAR TEXTURES */
private static final ResourceLocation MOON_PLANET_BAR = new ResourceLocation(BeyondEarth.MODID,
"textures/planet_bar/moon_planet_bar.png");
private static final ResourceLocation MARS_PLANET_BAR = new ResourceLocation(BeyondEarth.MODID,
"textures/planet_bar/mars_planet_bar.png");
private static final ResourceLocation MERCURY_PLANET_BAR = new ResourceLocation(BeyondEarth.MODID,
"textures/planet_bar/mercury_planet_bar.png");
private static final ResourceLocation VENUS_PLANET_BAR = new ResourceLocation(BeyondEarth.MODID,
"textures/planet_bar/venus_planet_bar.png");
private static final ResourceLocation GLACIO_PLANET_BAR = new ResourceLocation(BeyondEarth.MODID,
"textures/planet_bar/glacio_planet_bar.png");

private static final ResourceLocation SUN_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/sun.png");
private static final ResourceLocation MARS_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/mars.png");
private static final ResourceLocation PHOBOS_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/phobos.png");
private static final ResourceLocation DEIMOS_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/deimos.png");
private static final ResourceLocation EARTH_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/earth.png");
private static final ResourceLocation MOON_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/moon.png");
private static final ResourceLocation VENUS_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/venus.png");
private static final ResourceLocation MERCURY_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/mercury.png");
private static final ResourceLocation GLACIO_TEXTURE = new ResourceLocation(BeyondEarth.MODID,
"textures/environment/planet/glacio.png");





/**
* Here we register default planets. We are set to HIGHEST so that we fire
* first, and then addons can adjust things.
*
* @param event
*/
public static void registerDefaultPlanets() {
Planets.registerPlanet(Level.OVERWORLD, LevelRegistry.EARTH_ORBIT);
Planets.registerPlanet(LevelRegistry.MOON, LevelRegistry.MOON_ORBIT);
Planets.registerPlanet(LevelRegistry.MARS, LevelRegistry.MARS_ORBIT);
Planets.registerPlanet(LevelRegistry.PHOBOS, LevelRegistry.PHOBOS_ORBIT);
Planets.registerPlanet(LevelRegistry.DEIMOS, LevelRegistry.DEIMOS_ORBIT);
Planets.registerPlanet(LevelRegistry.MERCURY, LevelRegistry.MERCURY_ORBIT);
Planets.registerPlanet(LevelRegistry.VENUS, LevelRegistry.VENUS_ORBIT);
Planets.registerPlanet(LevelRegistry.GLACIO, LevelRegistry.GLACIO_ORBIT);

Planets.registerPlanetBar(LevelRegistry.MOON, MOON_PLANET_BAR);
Planets.registerPlanetBar(LevelRegistry.PHOBOS, MOON_PLANET_BAR);
Planets.registerPlanetBar(LevelRegistry.DEIMOS, MOON_PLANET_BAR);
Planets.registerPlanetBar(LevelRegistry.MARS, MARS_PLANET_BAR);
Planets.registerPlanetBar(LevelRegistry.MERCURY, MERCURY_PLANET_BAR);
Planets.registerPlanetBar(LevelRegistry.VENUS, VENUS_PLANET_BAR);
Planets.registerPlanetBar(LevelRegistry.GLACIO, GLACIO_PLANET_BAR);

Planets.StarSystem sol = new Planets.StarSystem();
sol.name = "sun";
sol.texture = SUN_TEXTURE;
Planets.Planet mercury = BY_DIMENSION.get(LevelRegistry.MERCURY);
mercury.orbitRadius = 0.39f * Planets.PLANET_ORBIT_SCALE;
mercury.mass = 0.055f * Planets.PLANET_MASS_SCALE;
mercury.texture = MERCURY_TEXTURE;
mercury.rotation = 270;
mercury.tier = 3;
mercury.g = 0.38f;
mercury.radius = 2439.7;
mercury.temperature = 430;
mercury.orbitColour = new int[] { 179, 49, 44 };
Planets.Planet venus = BY_DIMENSION.get(LevelRegistry.VENUS);
venus.orbitRadius = 0.72f * Planets.PLANET_ORBIT_SCALE;
venus.mass = 0.81f * Planets.PLANET_MASS_SCALE;
venus.texture = VENUS_TEXTURE;
venus.rotation = 180;
venus.tier = 3;
venus.g = 0.904f;
venus.radius = 6051.8;
venus.temperature = 482;
venus.airDensity = 100;
venus.orbitColour = new int[] { 235, 136, 68 };
Planets.Planet earth = BY_DIMENSION.get(LevelRegistry.EARTH);
earth.texture = EARTH_TEXTURE;
earth.rotation = 90;
earth.tier = 1;
earth.radius = 6371.0;
earth.airDensity = 1;
earth.hasOxygen = true;
earth.spaceLevel = false;
earth.hasRain = true;
earth.orbitColour = new int[] { 53, 163, 79 };
Planets.Planet mars = BY_DIMENSION.get(LevelRegistry.MARS);
mars.orbitRadius = 1.52f * Planets.PLANET_ORBIT_SCALE;
mars.mass = 0.107f * Planets.PLANET_MASS_SCALE;
mars.texture = MARS_TEXTURE;
mars.tier = 2;
mars.radius = 3389.5;
mars.g = 0.3794f;
mars.temperature = -63;
mars.airDensity = 0.001f;
mars.hasRain = true;
mars.hasDustStorms = true;
mars.orbitColour = new int[] { 37, 49, 146 };
mars.sunriseColour = new float[] { 0, 0.55f, 0.8f };

Planets.Planet phobos = BY_DIMENSION.get(LevelRegistry.PHOBOS);
phobos.g = 0.04f;
phobos.radius = 11.2;
phobos.mass = 10.6e15;
phobos.rotation = 180;
phobos.temperature = -160;
phobos.texture = PHOBOS_TEXTURE;
phobos.orbitRadius = 0.0244f * Planets.MOON_ORBIT_SCALE;
phobos.orbitColour = mars.orbitColour;
phobos.tidalLock = true;
mars.addChild(phobos);

Planets.Planet deimos = BY_DIMENSION.get(LevelRegistry.DEIMOS);
deimos.g = 0.04f;
deimos.radius = 6.2;
deimos.mass = 1.476e15;
deimos.temperature = -160;
deimos.texture = DEIMOS_TEXTURE;
deimos.orbitRadius = 0.0610f * Planets.MOON_ORBIT_SCALE;
deimos.orbitColour = mars.orbitColour;
deimos.tidalLock = true;
mars.addChild(deimos);

Planets.Planet moon = BY_DIMENSION.get(LevelRegistry.MOON);
moon.g = 0.1654f;
moon.radius = 1737.4;
moon.mass = Planets.MOON_MASS_SCALE;
moon.temperature = -160;
moon.texture = MOON_TEXTURE;
moon.orbitRadius = Planets.MOON_ORBIT_SCALE;
moon.orbitColour = earth.orbitColour;
moon.tidalLock = true;
moon.phaseTexture = new ResourceLocation(BeyondEarth.MODID, "textures/environment/planet/moon_phases.png");
earth.addChild(moon);
sol.addChild(mercury);
sol.addChild(venus);
sol.addChild(earth);
sol.addChild(mars);
sol.register();

Planets.StarSystem proxima_centauri = new Planets.StarSystem();
proxima_centauri.name = "proxima_centauri";
proxima_centauri.location[0] = 4.25f;
proxima_centauri.mass = 0.122f * Planets.STAR_MASS_SCALE;
proxima_centauri.colour = new int[] { 255, 127, 63 };
Planets.Planet glacio = BY_DIMENSION.get(LevelRegistry.GLACIO);
glacio.texture = GLACIO_TEXTURE;
glacio.mass = 0.08f * Planets.PLANET_MASS_SCALE;
glacio.orbitRadius = 0.39f * Planets.PLANET_ORBIT_SCALE;
glacio.rotation = 180;
glacio.tier = 4;
glacio.g = 0.3794f;
glacio.temperature = -20;
glacio.hasRain = true;
glacio.orbitColour = new int[] { 37, 49, 146 };
proxima_centauri.addChild(glacio);
proxima_centauri.register();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.mrscauthd.beyond_earth.common.registries;


import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
Expand All @@ -25,4 +26,5 @@ public class TagRegistry {
public static final TagKey<Biome> MERCURY_BIOMES_TAG = TagKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(BeyondEarth.MODID, "mercury"));
public static final TagKey<Biome> MOON_BIOMES_TAG = TagKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(BeyondEarth.MODID, "moon"));
public static final TagKey<Biome> VENUS_BIOMES_TAG = TagKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(BeyondEarth.MODID, "venus"));

}
Loading

0 comments on commit a51ee22

Please sign in to comment.