1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-11 03:31:19 +03:00

Better replacement

This commit is contained in:
Anuken 2019-10-10 16:47:46 -04:00
parent 6e7baf42b1
commit 80a4e67ddf
2 changed files with 8 additions and 3 deletions

View File

@ -62,7 +62,7 @@ public class UnitTypes implements ContentList{
range = 70f;
itemCapacity = 70;
health = 400;
buildPower = 1f;
buildPower = 0.4f;
engineOffset = 6.5f;
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
weapon = new Weapon("heal-blaster"){{

View File

@ -195,9 +195,9 @@ public class ContentParser{
T item;
if(Vars.content.getByName(type, name) != null){
item = (T)Vars.content.getByName(type, name);
readBundle(type, name, value);
}else{
readBundle(type, name, value);
item = constructor.get(mod + "-" + name);
}
currentContent = item;
@ -207,17 +207,22 @@ public class ContentParser{
}
private void readBundle(ContentType type, String name, JsonValue value){
String entryName = type + "." + currentMod.name + "-" + name + ".";
UnlockableContent cont = Vars.content.getByName(type, name) instanceof UnlockableContent ?
Vars.content.getByName(type, name) : null;
String entryName = cont == null ? type + "." + currentMod.name + "-" + name + "." : type + "." + cont.name + ".";
I18NBundle bundle = Core.bundle;
while(bundle.getParent() != null) bundle = bundle.getParent();
if(value.has("name")){
bundle.getProperties().put(entryName + "name", value.getString("name"));
if(cont != null) cont.localizedName = value.getString("name");
value.remove("name");
}
if(value.has("description")){
bundle.getProperties().put(entryName + "description", value.getString("description"));
if(cont != null) cont.description = value.getString("description");
value.remove("description");
}
}