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

I18n adaption for IWC #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ dependencies {
compile "mezz.jei:jei_${mcVersion}:4.14.4.251"

compile "redstone-flux:RedstoneFlux-1.12:2.1.0.6:universal"
compile "cofhcore:CoFHCore-1.12.2:4.6.1.22:universal"
compile "cofh-core:CoFHCore-1.12.2:4.6.1.22:universal"
compile "cofh-world:CoFHWorld-1.12.2:1.3.0.6:universal"
compile "thermal-foundation:ThermalFoundation-1.12.2:2.6.1.22:universal"

compile "thermal-foundation:ThermalFoundation-1.12.2:2.6.1.22:universal"
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -42,7 +43,7 @@ public String getUid() {

@Override
public String getTitle() {
return "Burning Items";
return I18n.format(InWorldCrafting.MODID+".jei.burn_item.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import xt9.inworldcrafting.InWorldCrafting;
import xt9.inworldcrafting.common.recipe.BurnItemRecipe;
import xt9.inworldcrafting.common.util.IngredientHelper;
import net.minecraft.client.resources.I18n;

/**
* Created by xt9 on 2019-01-20.
Expand All @@ -27,6 +30,8 @@ public void getIngredients(IIngredients ingredients) {
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
FontRenderer renderer = minecraft.fontRenderer;
renderer.drawStringWithShadow("Recipe time: " + recipe.getTicks() + " ticks", 1, 30, 0xFFFFFF);
renderer.drawStringWithShadow(
I18n.format(InWorldCrafting.MODID+".jei.burn_item.description", String.valueOf(recipe.getTicks())),
1,30,0xFFFFFF);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -42,7 +43,7 @@ public String getUid() {

@Override
public String getTitle() {
return "Exploding Blocks";
return I18n.format(InWorldCrafting.MODID+".jei.explode_blocks.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import xt9.inworldcrafting.InWorldCrafting;
import xt9.inworldcrafting.common.recipe.ExplodeBlockRecipe;

/**
Expand All @@ -26,6 +28,6 @@ public void getIngredients(IIngredients ingredients) {
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
FontRenderer renderer = minecraft.fontRenderer;
renderer.drawStringWithShadow("Success chance: " + recipe.getItemSpawnChance() + "%", 1, 30, 0xFFFFFF);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.explode_blocks.description", String.valueOf(recipe.getItemSpawnChance())), 1, 30, 0xFFFFFF);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -42,7 +43,7 @@ public String getUid() {

@Override
public String getTitle() {
return "Exploding Items";
return I18n.format(InWorldCrafting.MODID+".jei.explode_items.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import xt9.inworldcrafting.InWorldCrafting;
import xt9.inworldcrafting.common.recipe.ExplodeItemRecipe;
import xt9.inworldcrafting.common.util.IngredientHelper;

Expand All @@ -27,6 +29,6 @@ public void getIngredients(IIngredients ingredients) {
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
FontRenderer renderer = minecraft.fontRenderer;
renderer.drawStringWithShadow("Success chance: " + recipe.getSurviveChance() + "%", 1, 30, 0xFFFFFF);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.explode_items.description",String.valueOf(recipe.getSurviveChance())), 1, 30, 0xFFFFFF);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -56,7 +57,7 @@ public String getUid() {

@Override
public String getTitle() {
return "Fluid to Fluid Transformation";
return I18n.format(InWorldCrafting.MODID+".jei.fluid_to_fluid.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import xt9.inworldcrafting.InWorldCrafting;
import xt9.inworldcrafting.common.recipe.FluidToFluidRecipe;
import xt9.inworldcrafting.common.util.IngredientHelper;

Expand All @@ -30,12 +32,12 @@ public void getIngredients(IIngredients ingredients) {
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
FontRenderer renderer = minecraft.fontRenderer;
renderer.drawStringWithShadow("Consumes Item: ", 2, 26, 0xFFFFFF);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.if_consumes_item"), 2, 26, 0xFFFFFF);

if(recipe.willConsume()) {
renderer.drawStringWithShadow("Yes", 80, 26, 0xcc0036);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.yes"), 80, 26, 0xcc0036);
} else {
renderer.drawStringWithShadow("No", 80, 26, 0xc9f26a);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.no"), 80, 26, 0xc9f26a);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -56,7 +57,7 @@ public String getUid() {

@Override
public String getTitle() {
return "Fluid to Item Transformation";
return I18n.format(InWorldCrafting.MODID+".jei.fluid_to_item.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import xt9.inworldcrafting.InWorldCrafting;
import xt9.inworldcrafting.common.recipe.FluidToItemRecipe;
import xt9.inworldcrafting.common.util.IngredientHelper;

Expand All @@ -30,12 +32,12 @@ public void getIngredients(IIngredients ingredients) {
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
FontRenderer renderer = minecraft.fontRenderer;
renderer.drawStringWithShadow("Consumes Fluid: ", 2, 26, 0xFFFFFF);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.if_consumes_liquid"), 2, 26, 0xFFFFFF);

if(recipe.willConsume()) {
renderer.drawStringWithShadow("Yes", 84, 26, 0xcc0036);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.yes"), 84, 26, 0xcc0036);
} else {
renderer.drawStringWithShadow("No", 84, 26, 0xc9f26a);
renderer.drawStringWithShadow(I18n.format(InWorldCrafting.MODID+".jei.no"), 84, 26, 0xc9f26a);
}
}
}
12 changes: 12 additions & 0 deletions src/main/resources/assets/inworldcrafting/lang/en_us.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
inworldcrafting.jei.burn_item.description=Recipe Time: %s Ticks
inworldcrafting.jei.burn_item.title=Burning Recipe
inworldcrafting.jei.explode_blocks.title=Exploding Blocks
inworldcrafting.jei.explode_blocks.description=Success chance: %s %%
inworldcrafting.jei.explode_items.title=Exploding Items
inworldcrafting.jei.explode_items.description=Success chance: %s %%
inworldcrafting.jei.fluid_to_fluid.title=Fluid to Fluid Transformation
inworldcrafting.jei.fluid_to_item.title=Fluid to Item Transformation
inworldcrafting.jei.if_consumes_item=Consumes Item:
inworldcrafting.jei.if_consumes_liquid=Consumes Liquid:
inworldcrafting.jei.yes=Yes
inworldcrafting.jei.no=No
12 changes: 12 additions & 0 deletions src/main/resources/assets/inworldcrafting/lang/zh_cn.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
inworldcrafting.jei.burn_item.description=燃烧时间: %s 游戏刻
inworldcrafting.jei.burn_item.title=燃烧配方
inworldcrafting.jei.explode_blocks.title=爆破方块
inworldcrafting.jei.explode_blocks.description=成功率: %s %%
inworldcrafting.jei.explode_items.title=爆破物品
inworldcrafting.jei.explode_items.description=成功率: %s %%
inworldcrafting.jei.fluid_to_fluid.title=流体-流体 转化配方
inworldcrafting.jei.fluid_to_item.title=流体-物品 转换配方
inworldcrafting.jei.if_consumes_item=是否消耗物品:
inworldcrafting.jei.if_consumes_liquid=是否消耗流体:
inworldcrafting.jei.yes=是
inworldcrafting.jei.no=否