remove remaining metadata from enums
This commit is contained in:
parent
c376d92790
commit
454e38d1ab
15 changed files with 87 additions and 259 deletions
|
@ -300,50 +300,27 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
|
||||
public static enum EnumPlantType implements Identifyable
|
||||
{
|
||||
SUNFLOWER(0, "sunflower", "Sonnenblume"),
|
||||
SYRINGA(1, "syringa", "Flieder"),
|
||||
GRASS(2, "large_tallgrass", "Hohes Gras"),
|
||||
FERN(3, "large_fern", "Großer Farn"),
|
||||
ROSE(4, "rose_bush", "Rosenstrauch"),
|
||||
PAEONIA(5, "paeonia", "Pfingstrose");
|
||||
SUNFLOWER("sunflower", "Sonnenblume"),
|
||||
SYRINGA("syringa", "Flieder"),
|
||||
GRASS("large_tallgrass", "Hohes Gras"),
|
||||
FERN("large_fern", "Großer Farn"),
|
||||
ROSE("rose_bush", "Rosenstrauch"),
|
||||
PAEONIA("paeonia", "Pfingstrose");
|
||||
|
||||
private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[values().length];
|
||||
private final int meta;
|
||||
private final String name;
|
||||
private final String display;
|
||||
|
||||
// private EnumPlantType(int meta, String name)
|
||||
// {
|
||||
// this(meta, name, name);
|
||||
// }
|
||||
|
||||
private EnumPlantType(int meta, String name, String display)
|
||||
private EnumPlantType(String name, String display)
|
||||
{
|
||||
this.meta = meta;
|
||||
this.name = name;
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
public int getMeta()
|
||||
{
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public static BlockDoublePlant.EnumPlantType byMetadata(int meta)
|
||||
{
|
||||
if (meta < 0 || meta >= META_LOOKUP.length)
|
||||
{
|
||||
meta = 0;
|
||||
}
|
||||
|
||||
return META_LOOKUP[meta];
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
|
@ -353,12 +330,5 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
{
|
||||
return this.display;
|
||||
}
|
||||
|
||||
static {
|
||||
for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : values())
|
||||
{
|
||||
META_LOOKUP[blockdoubleplant$enumplanttype.getMeta()] = blockdoubleplant$enumplanttype;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue