Added localisation to microblock classes

This commit is contained in:
Chicken Bones committed 2013-09-10 19:07:00 +10:00
1 parent 5747fd9bdf
commit f17fa03f98
9 files changed
+35 -29

No files matched your search

@@ -49,13 +49,6 @@ object CornerMicroClass extends MicroblockClass
new CornerMicroblock(size, slot, material)
def placementProperties = CornerPlacement
def getDisplayName(size:Int):String = size match
{
case 1 => "Nook"
case 2 => "Corner"
case 4 => "Notch"
}
}
class CornerMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends CornerMicroblock(shape$, material$) with CommonMicroblockClient
@@ -102,13 +102,6 @@ object EdgeMicroClass extends MicroblockClass
new EdgeMicroblock(size, slot, material)
def placementProperties = EdgePlacement
def getDisplayName(size:Int):String = size match
{
case 1 => "Strip"
case 2 => "Post"
case 4 => "Pillar"
}
}
class EdgeMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends EdgeMicroblock(shape$, material$) with CommonMicroblockClient
@@ -70,13 +70,6 @@ object FaceMicroClass extends MicroblockClass
new FaceMicroblock(size, slot, material)
def placementProperties = FacePlacement
def getDisplayName(size:Int):String = size match
{
case 1 => "Cover"
case 2 => "Panel"
case 4 => "Slab"
}
}
class FaceMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends FaceMicroblock(shape$, material$) with CommonMicroblockClient
@@ -74,8 +74,6 @@ object HollowMicroClass extends MicroblockClass
new HollowMicroblock(size, slot, material)
def placementProperties = HollowPlacement
def getDisplayName(size:Int) = "Hollow "+FaceMicroClass.getDisplayName(size)
}
class HollowMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends HollowMicroblock(shape$, material$) with CommonMicroblockClient
+2 -1
View File
@@ -23,6 +23,7 @@ import codechicken.lib.raytracer.RayTracer
import net.minecraft.util.EnumMovingObjectType
import codechicken.lib.vec.Vector3
import codechicken.lib.render.TextureUtils
import codechicken.lib.lang.LangUtil
class ItemMicroPart(id:Int) extends Item(id)
{
@@ -36,7 +37,7 @@ class ItemMicroPart(id:Int) extends Item(id)
if(material == null || mcrClass == null)
return "Unnamed"
return material.getLocalizedName+" "+mcrClass.getDisplayName(size)
return LangUtil.translateG(mcrClass.getName+"."+size+".name", material.getLocalizedName)
}
override def getSubItems(id:Int, tab:CreativeTabs, list$:List[_])
-2
View File
@@ -16,8 +16,6 @@ trait MicroblockClass
{
var classID:Int = _
def getDisplayName(size:Int):String
def itemSlot() = 3
@SideOnly(Side.CLIENT)
@@ -1,5 +1,6 @@
package codechicken.multipart.nei;
import codechicken.lib.lang.LangUtil;
import codechicken.microblock.MicroblockClass;
import codechicken.microblock.MicroblockClassRegistry;
import codechicken.microblock.handler.MicroblockProxy;
@@ -29,7 +30,8 @@ public class NEI_MicroblockConfig implements IConfigureNEI
private void addSubset(MicroblockClass mcrClass, int microID, int i)
{
API.addSetRange("Microblocks."+mcrClass.getDisplayName(i&0xFF), new MultiItemRange().add(microID, i, i));
API.addSetRange("Microblocks."+LangUtil.translateG(mcrClass.getName()+"."+(i&0xFF)+".subset"),
new MultiItemRange().add(microID, i, i));
}
@Override