added support for blueprints with no name, fix #1476

This commit is contained in:
SpaceToad 2014-03-06 08:55:47 +01:00
parent cc4a0eb7db
commit 824396f989
4 changed files with 14 additions and 8 deletions

View file

@ -126,6 +126,7 @@ item.redstone_pulsating_chipset.name=Pulsating Chipset
item.redstone_quartz_chipset.name=Quartz Chipset
item.redstone_comp_chipset.name=Redstone Comp Chipset
item.blueprintItem.name=Blueprint
item.blueprint.unnamed=<unnamed>
item.blueprint.author=by
item.blueprint.blank=Blank
item.PipeItemsWood.name=Wooden Transport Pipe

View file

@ -33,10 +33,17 @@ public abstract class ItemBlueprint extends ItemBuildCraft {
BlueprintBase blueprint = getBlueprint(stack);
if (blueprint != null) {
list.add(String.format(blueprint.id.name));
if (blueprint.id.name.equals("")) {
list.add(String.format(StringUtils.localize("item.blueprint.unnamed")));
} else {
list.add(String.format(blueprint.id.name));
}
list.add(String.format(StringUtils.localize("item.blueprint.author") + " " + blueprint.author));
} else
} else {
list.add(StringUtils.localize("item.blueprint.blank"));
}
}
public static ItemStack getBlueprintItem(BlueprintBase blueprint) {

View file

@ -98,11 +98,9 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
context = result.getContext(worldObj, box);
}
if (!name.equals("")) {
result.id.name = name;
result.author = currentAuthorName;
}
result.id.name = name;
result.author = currentAuthorName;
result.anchorX = xCoord - box.xMin;
result.anchorY = yCoord - box.yMin;
result.anchorZ = zCoord - box.zMin;

View file

@ -25,7 +25,7 @@ public final class BlueprintId implements Comparable<BlueprintId> {
public byte[] uniqueId;
@NetworkData
public String name;
public String name = "";
public String completeId;