Skip to content

Commit

Permalink
Simplified Chinese, API Fixes
Browse files Browse the repository at this point in the history
Fixed the API so adding custom JSON values during preInit and init actually works (oops)
ALSO fixed the API so it's actually independent (double oops)

Added zh_cn.lang by WeiEAL , thanks!
  • Loading branch information
Charles445 committed Aug 19, 2020
1 parent 70e1fe8 commit 4def985
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 18 deletions.
9 changes: 8 additions & 1 deletion CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

List of contributors

Charles445 - anything not specified below

- Assets -
tehmadtitaan - Ice Armor Model Textures, Cloth Armor Model Textures
Charles445 - everything else




- Translations -
WeiEAL - Chinese (Simplified) (zh_cn.lang)
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.forge'


version = "1.12.2-0.3.0"
version = "1.12.2-0.3.1"
group = "com.charles445.simpledifficulty" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "SimpleDifficulty"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SimpleDifficulty
{
public static final String MODID = "simpledifficulty";
public static final String NAME = "SimpleDifficulty";
public static final String VERSION = "0.3.0";
public static final String VERSION = "0.3.1";

@Mod.Instance(SimpleDifficulty.MODID)
public static SimpleDifficulty instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import javax.annotation.Nullable;

import com.charles445.simpledifficulty.SimpleDifficulty;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTException;
import net.minecraft.nbt.NBTTagCompound;

public class JsonItemIdentity
Expand Down Expand Up @@ -58,11 +55,7 @@ public void tryPopulateCompound()
}
catch (Exception e)
{
SimpleDifficulty.logger.error("Configuration failed with NBT string: "+nbt);

//Remove the NBT from the item
//TODO this could cause a problem and cause error spam

this.nbtCompound = null;
this.nbt = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class CommandSimpleDifficulty extends CommandBase
private final String warn_noItem = "Not holding an item!";
private final String exportJsonReminder = "(Don't forget to exportJson !)";

@Override
public List<String> getAliases()
{
return Arrays.asList(new String[]{"sd"});
Expand Down Expand Up @@ -645,6 +646,8 @@ private void updateJson(MinecraftServer server, ICommandSender sender, String[]
message(sender, "Reloading SimpleDifficulty JSON");
JsonConfigInternal.jsonErrors.clear();

//Clear the data containers
JsonConfigInternal.clearContainers();

//Reload the json (do the startup routine)
JsonConfigInternal.init(SimpleDifficulty.jsonDirectory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ public class JsonConfigInternal
//postInit
public static void init(File jsonDirectory)
{
//Clear the containers first (in case this isn't the first run)
JsonConfig.armorTemperatures.clear();
JsonConfig.blockTemperatures.clear();
JsonConfig.consumableTemperature.clear();
JsonConfig.consumableThirst.clear();
JsonConfig.fluidTemperatures.clear();
JsonConfig.heldItemTemperatures.clear();

//Setup default JSON

JsonConfig.registerArmorTemperature(new ItemStack(SDItems.wool_helmet), 2.0f);
Expand Down Expand Up @@ -101,6 +93,18 @@ public static void init(File jsonDirectory)
processAllJson(jsonDirectory);
}

/** Do NOT call this before load complete is finished!!**/
public static void clearContainers()
{
//Clear the containers (in case this isn't the first run)
JsonConfig.armorTemperatures.clear();
JsonConfig.blockTemperatures.clear();
JsonConfig.consumableTemperature.clear();
JsonConfig.consumableThirst.clear();
JsonConfig.fluidTemperatures.clear();
JsonConfig.heldItemTemperatures.clear();
}

public static void processAllJson(File jsonDirectory)
{
//Maps currently have defaults
Expand Down
77 changes: 77 additions & 0 deletions src/main/resources/assets/simpledifficulty/lang/zh_cn.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
effect.cold_resist=严寒抗性
effect.heat_resist=炎热抗性
effect.hyperthermia=中暑
effect.hypothermia=伤寒
effect.thirsty=脱水

enchantment.chilling=寒冷
enchantment.heating=炎热

enchantment.simpledifficulty.chilling.desc=穿戴时降低玩家体温
enchantment.simpledifficulty.heating.desc=穿戴时提高玩家体温

fluid.purifiedwater=纯净水

itemGroup.tabSimpleDifficulty=坚定意志

item.simpledifficulty:canteen_broken.name=破水壶
item.simpledifficulty:canteen_empty.name=空水壶
item.simpledifficulty:canteen_normal.name=水壶
item.simpledifficulty:canteen_purified.name=纯净水壶

item.simpledifficulty:charcoal_filter.name=木炭过滤器

item.simpledifficulty:ice_chunk.name=冰块

item.simpledifficulty:ice_helmet.name=冰头盔
item.simpledifficulty:ice_chestplate.name=冰胸甲
item.simpledifficulty:ice_leggings.name=冰护腿
item.simpledifficulty:ice_boots.name=冰靴子

item.simpledifficulty:juice_apple.name=苹果汁
item.simpledifficulty:juice_beetroot.name=甜菜汁
item.simpledifficulty:juice_cactus.name=仙人掌汁
item.simpledifficulty:juice_carrot.name=胡萝卜汁
item.simpledifficulty:juice_chorus_fruit.name=紫颂果汁
item.simpledifficulty:juice_golden_melon.name=金西瓜汁
item.simpledifficulty:juice_golden_apple.name=金苹果汁
item.simpledifficulty:juice_golden_carrot.name=金萝卜汁
item.simpledifficulty:juice_melon.name=西瓜汁
item.simpledifficulty:juice_pumpkin.name=南瓜汁

item.simpledifficulty:magma_chunk.name=岩浆块

item.simpledifficulty:purified_water_bottle.name=纯净水瓶

item.simpledifficulty:thermometer.name=温度计

item.simpledifficulty:wool_helmet.name=棉帽
item.simpledifficulty:wool_chestplate.name=棉衣
item.simpledifficulty:wool_leggings.name=棉裤
item.simpledifficulty:wool_boots.name=棉鞋

lingering_potion.effect.cold_resist_type=滞留型抗寒药水
lingering_potion.effect.long_cold_resist_type=滞留型抗寒药水
lingering_potion.effect.heat_resist_type=滞留型耐热药水
lingering_potion.effect.long_heat_resist_type=滞留型耐热药水

potion.effect.cold_resist_type=抗寒药水
potion.effect.long_cold_resist_type=抗寒药水
potion.effect.heat_resist_type=耐热药水
potion.effect.long_heat_resist_type=耐热药水

splash_potion.effect.cold_resist_type=喷溅型抗寒药水
splash_potion.effect.long_cold_resist_type=喷溅型抗寒药水
splash_potion.effect.heat_resist_type=喷溅型耐热药水
splash_potion.effect.long_heat_resist_type=喷溅型耐热药水

tile.simpledifficulty:campfire.name=营火
tile.simpledifficulty:chiller.name=降温器
tile.simpledifficulty:heater.name=加热器
tile.simpledifficulty:purifiedwater.name=纯净水
tile.simpledifficulty:rain_collector.name=雨水收集器

tipped_arrow.effect.cold_resist_type=抗寒箭
tipped_arrow.effect.long_cold_resist_type=抗寒箭
tipped_arrow.effect.heat_resist_type=耐热箭
tipped_arrow.effect.long_heat_resist_type=耐热箭

0 comments on commit 4def985

Please sign in to comment.