Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localization for vein custom names and ore vein jei page #2141

Merged
merged 5 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.gson.JsonObject;
import gregtech.api.util.GTLog;
import gregtech.api.util.LocalizationUtils;
import gregtech.api.worldgen.bedrockFluids.BedrockFluidVeinHandler;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.Biome;
Expand Down Expand Up @@ -55,7 +56,7 @@ public boolean initializeFromConfig(@Nonnull JsonObject configRoot) {
}
// vein name for JEI display
if (configRoot.has("name")) {
this.assignedName = configRoot.get("name").getAsString();
this.assignedName = LocalizationUtils.format(configRoot.get("name").getAsString());
}
// vein description for JEI display
if (configRoot.has("description")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.gson.JsonObject;
import gregtech.api.unification.ore.StoneType;
import gregtech.api.util.LocalizationUtils;
import gregtech.api.util.WorldBlockPredicate;
import gregtech.api.worldgen.filler.BlockFiller;
import gregtech.api.worldgen.populator.IVeinPopulator;
Expand Down Expand Up @@ -46,7 +47,7 @@ public boolean initializeFromConfig(@Nonnull JsonObject configRoot) {
this.weight = configRoot.get("weight").getAsInt();
this.density = configRoot.get("density").getAsFloat();
if (configRoot.has("name")) {
this.assignedName = configRoot.get("name").getAsString();
this.assignedName = LocalizationUtils.format(configRoot.get("name").getAsString());
}
if (configRoot.has("description")) {
this.description = configRoot.get("description").getAsString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;

import javax.annotation.Nonnull;

Expand Down Expand Up @@ -107,18 +108,18 @@ public void drawExtras(@Nonnull Minecraft minecraft) {
//Give room for 5 lines of 5 ores each, so 25 unique ores in the vein
//73 is SLOT_HEIGHT * (NUM_OF_SLOTS - 1) + 1
if (baseYPos >= SLOT_HEIGHT * NUM_OF_SLOTS) {
minecraft.fontRenderer.drawString("Spawn Range: " + minHeight + "-" + maxHeight, baseXPos, baseYPos + 1, 0x111111);
minecraft.fontRenderer.drawString(I18n.format("gregtech.jei.ore.spawn_range", minHeight, maxHeight), baseXPos, baseYPos + 1, 0x111111);
} else {
minecraft.fontRenderer.drawString("Spawn Range: " + minHeight + "-" + maxHeight, baseXPos, SLOT_HEIGHT * (NUM_OF_SLOTS - 1) + 1, 0x111111);
minecraft.fontRenderer.drawString(I18n.format("gregtech.jei.ore.spawn_range", minHeight, maxHeight), baseXPos, SLOT_HEIGHT * (NUM_OF_SLOTS - 1) + 1, 0x111111);
//Update the position at which the spawn information ends
baseYPos = 73;
}

//Create the Weight
minecraft.fontRenderer.drawString("Vein Weight: " + weight, baseXPos, baseYPos + FONT_HEIGHT, 0x111111);
minecraft.fontRenderer.drawString(I18n.format("gregtech.jei.ore.vein_weight", weight), baseXPos, baseYPos + FONT_HEIGHT, 0x111111);

//Create the Dimensions
minecraft.fontRenderer.drawString("Dimensions: ", baseXPos, baseYPos + (2 * FONT_HEIGHT), 0x111111);
minecraft.fontRenderer.drawString(I18n.format("gregtech.jei.ore.dimension"), baseXPos, baseYPos + (2 * FONT_HEIGHT), 0x111111);

JEIResourceDepositCategoryUtils.drawMultiLineCommaSeparatedDimensionList(WorldGenRegistry.getNamedDimensions(),
dimension,
Expand All @@ -128,6 +129,6 @@ public void drawExtras(@Nonnull Minecraft minecraft) {
dimDisplayPos);

//Label the Surface Identifier
minecraft.fontRenderer.drawSplitString("SurfaceMaterial", 15, 92, minecraft.fontRenderer.getStringWidth("Surface"), 0x111111);
minecraft.fontRenderer.drawSplitString(I18n.format("gregtech.jei.ore.surfacematerial"), 15, 92, baseXPos - 20, 0x111111);
}
}
56 changes: 56 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5263,6 +5263,10 @@ gregtech.jei.ore.between_1=Between Ore
gregtech.jei.ore.between_2=Spawns in the middle %d layers of the vein, with other ores
gregtech.jei.ore.sporadic_1=Sporadic Ore
gregtech.jei.ore.sporadic_2=Spawns anywhere in the vein
gregtech.jei.ore.spawn_range=Spawn Range: %d - %d
gregtech.jei.ore.vein_weight=Vein Weight: %d
gregtech.jei.ore.dimension=Dimensions:
gregtech.jei.ore.surfacematerial=Surface Material

fluid.spawnlocation.name=Fluid Vein Information
gregtech.jei.fluid.vein_weight=Vein Weight: %d
Expand All @@ -5283,6 +5287,58 @@ gregtech.jei.materials.average_mass=Average mass: %,d
gregtech.jei.materials.average_protons=Average protons: %,d
gregtech.jei.materials.average_neutrons=Average neutrons: %,d

gregtech.veins.ore.bauxite=Bauxite Vein
gregtech.veins.ore.magnetite=Magnetite Vein
gregtech.veins.ore.naquadah=Naquadah Vein
gregtech.veins.ore.pitchblende=Pitchblende Vein
gregtech.veins.ore.scheelite=Scheelite Vein
gregtech.veins.ore.sheldonite=Sheldonite Vein
gregtech.veins.ore.banded_iron=Banded Iron Vein
gregtech.veins.ore.beryllium=Beryllium Vein
gregtech.veins.ore.certus_quartz=Certus Quartz Vein
gregtech.veins.ore.manganese=Manganese Vein
gregtech.veins.ore.molybdenum=Molybdenum Vein
gregtech.veins.ore.monazite=Monazite Vein
gregtech.veins.ore.nether_quartz=Nether Quartz Vein
gregtech.veins.ore.redstone=Redstone Vein
gregtech.veins.ore.saltpeter=Saltpeter Vein
gregtech.veins.ore.sulfur=Sulfur Vein
gregtech.veins.ore.tetrahedrite=Tetrahedrite Vein
gregtech.veins.ore.topaz=Topaz Vein
gregtech.veins.ore.apatite=Apatite Vein
gregtech.veins.ore.basalt_sphere=Basalt Sphere
gregtech.veins.ore.black_granite_sphere=Black Granite Sphere
gregtech.veins.ore.cassiterite=Cassiterite Vein
gregtech.veins.ore.coal=Coal Vein
gregtech.veins.ore.copper_tin=Copper Tin Vein
gregtech.veins.ore.copper=Copper Vein
gregtech.veins.ore.diamond=Diamond Vein
gregtech.veins.ore.galena=Galena Vein
gregtech.veins.ore.garnet_tin=Garnet Tin Vein
gregtech.veins.ore.garnet=Garnet Vein
gregtech.veins.ore.iron=Iron Vein
gregtech.veins.ore.lapis=Lapis Vein
gregtech.veins.ore.lubricant=Lubricant Vein
gregtech.veins.ore.marble_sphere=Marble Sphere
gregtech.veins.ore.mica=Mica Vein
gregtech.veins.ore.mineral_sand=Mineral Sand Vein
gregtech.veins.ore.nickel=Nickel Vein
gregtech.veins.ore.oilsands=Oilsands Vein
gregtech.veins.ore.olivine=Olivine Vein
gregtech.veins.ore.raw_oil_sphere=Raw Oil Sphere
gregtech.veins.ore.red_granite_sphere=Red Granite Sphere
gregtech.veins.ore.salts=Salts Vein
gregtech.veins.ore.sapphire=Sapphire Vein

gregtech.veins.fluid.lava=Nether Lava Deposit
gregtech.veins.fluid.natural_gas_nether=Nether Natural Gas Deposit
gregtech.veins.fluid.heavy_oil=Overworld Heavy Oil Deposit
gregtech.veins.fluid.light_oil=Overworld Light Oil Deposit
gregtech.veins.fluid.natural_gas_overworld=Overworld Natural Gas Deposit
gregtech.veins.fluid.oil=Overworld Oil Deposit
gregtech.veins.fluid.raw_oil=Overworld Raw Oil Deposit
gregtech.veins.fluid.salt_water=Overworld Salt Water Deposit

gregtech.item_filter.empty_item=Empty (No Item)
gregtech.item_filter.footer=§eClick with item to override

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.lava",
"weight": 65,
"name": "Nether Lava Deposit",
"yield": {
"min": 125,
"max": 250
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.natural_gas_nether",
"weight": 35,
"name": "Nether Natural Gas Deposit",
"yield": {
"min": 150,
"max": 300
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.heavy_oil",
"weight": 15,
"name": "Heavy Oil Deposit",
"yield": {
"min": 100,
"max": 200
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.light_oil",
"weight": 25,
"name": "Overworld Light Oil Deposit",
"yield": {
"min": 175,
"max": 300
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.natural_gas_overworld",
"weight": 15,
"name": "Overworld Natural Gas Deposit",
"yield": {
"min": 100,
"max": 175
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.oil",
"weight": 20,
"name": "Overworld Oil Deposit",
"yield": {
"min": 175,
"max": 300
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.raw_oil",
"weight": 20,
"name": "Overworld Raw Oil Deposit",
"yield": {
"min": 200,
"max": 300
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gregtech.veins.fluid.salt_water",
"weight": 0,
"name": "Overworld Salt Water Deposit",
"yield": {
"min": 50,
"max": 100
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.bauxite",
"weight": 40,
"density": 0.25,
"min_height": 10,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.magnetite",
"weight": 30,
"density": 0.15,
"min_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.naquadah",
"weight": 30,
"density": 0.15,
"min_height": 10,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.pitchblende",
"weight": 20,
"density": 0.25,
"min_height": 30,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.scheelite",
"weight": 20,
"density": 0.2,
"min_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.sheldonite",
"weight": 10,
"density": 0.2,
"min_height": 5,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.banded_iron",
"weight": 30,
"density": 0.2,
"min_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.beryllium",
"weight": 30,
"density": 0.25,
"min_height": 5,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.certus_quartz",
"weight": 40,
"density": 0.25,
"min_height": 80,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.manganese",
"weight": 20,
"density": 0.25,
"min_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.molybdenum",
"weight": 5,
"density": 0.25,
"min_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.monazite",
"weight": 30,
"density": 0.25,
"min_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.nether_quartz",
"weight": 80,
"density": 0.2,
"min_height": 40,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.redstone",
"weight": 60,
"density": 0.2,
"min_height": 5,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.saltpeter",
"weight": 40,
"density": 0.25,
"min_height": 5,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.sulfur",
"weight": 100,
"density": 0.2,
"min_height": 10,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.tetrahedrite",
"weight": 70,
"density": 0.2,
"min_height": 80,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.topaz",
"weight": 40,
"density": 0.25,
"min_height": 80,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.apatite",
"weight": 40,
"density": 0.25,
"max_height": 60,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.basalt_sphere",
"weight": 120,
"priority": 100,
"density": 1.0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.black_granite_sphere",
"weight": 90,
"priority": 100,
"density": 1.0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.cassiterite",
"weight": 80,
"density": 0.2,
"max_height": 60,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.coal",
"weight": 80,
"density": 0.25,
"max_height": 80,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.copper_tin",
"weight": 50,
"density": 0.2,
"max_height": 160,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.copper",
"weight": 80,
"density": 0.2,
"max_height": 60,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.diamond",
"weight": 40,
"density": 0.25,
"max_height": 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.galena",
"weight": 40,
"density": 0.25,
"max_height": 45,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.garnet_tin",
"weight": 80,
"density": 0.2,
"max_height": 60,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.garnet",
"weight": 40,
"density": 0.25,
"max_height": 30,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.iron",
"weight": 120,
"density": 0.2,
"max_height": 40,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.lapis",
"weight": 40,
"density": 0.25,
"max_height": 50,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "gregtech.veins.ore.lubricant",
"weight": 40,
"density": 0.25,
"max_height": 50,
Expand Down
Loading