Update mappings to 20151122.

This commit is contained in:
cpw 2015-11-23 23:18:52 -05:00
parent 84c3ef0f5c
commit 68dfcccd57
15 changed files with 65 additions and 65 deletions

View File

@ -28,7 +28,7 @@ apply plugin: "net.minecraftforge.gradle.launch4j"
minecraft { minecraft {
version = "1.8.8" version = "1.8.8"
//mappings = 'stable_16' //mappings = 'stable_16'
mappings = "snapshot_nodoc_20141130" mappings = "snapshot_nodoc_20151122"
workspaceDir = "projects" workspaceDir = "projects"
versionJson = "jsons/1.8.8-dev.json" versionJson = "jsons/1.8.8-dev.json"
buildUserdev = true buildUserdev = true

View File

@ -57,7 +57,7 @@ public class ClientCommandHandler extends CommandHandler
return 0; return 0;
} }
if (icommand.canCommandSenderUse(sender)) if (icommand.canCommandSenderUseCommand(sender))
{ {
CommandEvent event = new CommandEvent(icommand, sender, args); CommandEvent event = new CommandEvent(icommand, sender, args);
if (MinecraftForge.EVENT_BUS.post(event)) if (MinecraftForge.EVENT_BUS.post(event))
@ -69,7 +69,7 @@ public class ClientCommandHandler extends CommandHandler
return 0; return 0;
} }
icommand.execute(sender, args); icommand.processCommand(sender, args);
return 1; return 1;
} }
else else

View File

@ -113,7 +113,7 @@ public class GuiIngameForge extends GuiIngame
if (Minecraft.isFancyGraphicsEnabled()) if (Minecraft.isFancyGraphicsEnabled())
{ {
func_180480_a(mc.thePlayer.getBrightness(partialTicks), res); renderVignette(mc.thePlayer.getBrightness(partialTicks), res);
} }
else else
{ {
@ -163,16 +163,16 @@ public class GuiIngameForge extends GuiIngame
Scoreboard scoreboard = this.mc.theWorld.getScoreboard(); Scoreboard scoreboard = this.mc.theWorld.getScoreboard();
ScoreObjective objective = null; ScoreObjective objective = null;
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.thePlayer.getName()); ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.thePlayer.getCommandSenderName());
if (scoreplayerteam != null) if (scoreplayerteam != null)
{ {
int slot = scoreplayerteam.func_178775_l().getColorIndex(); int slot = scoreplayerteam.getChatFormat().getColorIndex();
if (slot >= 0) objective = scoreboard.getObjectiveInDisplaySlot(3 + slot); if (slot >= 0) objective = scoreboard.getObjectiveInDisplaySlot(3 + slot);
} }
ScoreObjective scoreobjective1 = objective != null ? objective : scoreboard.getObjectiveInDisplaySlot(1); ScoreObjective scoreobjective1 = objective != null ? objective : scoreboard.getObjectiveInDisplaySlot(1);
if (renderObjective && scoreobjective1 != null) if (renderObjective && scoreobjective1 != null)
{ {
this.func_180475_a(scoreobjective1, res); this.renderScoreboard(scoreobjective1, res);
} }
GlStateManager.enableBlend(); GlStateManager.enableBlend();
@ -234,7 +234,7 @@ public class GuiIngameForge extends GuiIngame
{ {
if (itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) if (itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))
{ {
func_180476_e(res); renderPumpkinOverlay(res);
} }
else else
{ {
@ -345,28 +345,28 @@ public class GuiIngameForge extends GuiIngame
EntityPlayer player = (EntityPlayer)this.mc.getRenderViewEntity(); EntityPlayer player = (EntityPlayer)this.mc.getRenderViewEntity();
int health = MathHelper.ceiling_float_int(player.getHealth()); int health = MathHelper.ceiling_float_int(player.getHealth());
boolean highlight = field_175191_F > (long)updateCounter && (field_175191_F - (long)updateCounter) / 3L %2L == 1L; boolean highlight = healthUpdateCounter > (long)updateCounter && (healthUpdateCounter - (long)updateCounter) / 3L %2L == 1L;
if (health < this.field_175194_C && player.hurtResistantTime > 0) if (health < this.playerHealth && player.hurtResistantTime > 0)
{ {
this.lastSystemTime = Minecraft.getSystemTime(); this.lastSystemTime = Minecraft.getSystemTime();
this.field_175191_F = (long)(this.updateCounter + 20); this.healthUpdateCounter = (long)(this.updateCounter + 20);
} }
else if (health > this.field_175194_C && player.hurtResistantTime > 0) else if (health > this.playerHealth && player.hurtResistantTime > 0)
{ {
this.lastSystemTime = Minecraft.getSystemTime(); this.lastSystemTime = Minecraft.getSystemTime();
this.field_175191_F = (long)(this.updateCounter + 10); this.healthUpdateCounter = (long)(this.updateCounter + 10);
} }
if (Minecraft.getSystemTime() - this.lastSystemTime > 1000L) if (Minecraft.getSystemTime() - this.lastSystemTime > 1000L)
{ {
this.field_175194_C = health; this.playerHealth = health;
this.field_175189_D = health; this.lastPlayerHealth = health;
this.lastSystemTime = Minecraft.getSystemTime(); this.lastSystemTime = Minecraft.getSystemTime();
} }
this.field_175194_C = health; this.playerHealth = health;
int healthLast = this.field_175189_D; int healthLast = this.lastPlayerHealth;
IAttributeInstance attrMaxHealth = player.getEntityAttribute(SharedMonsterAttributes.maxHealth); IAttributeInstance attrMaxHealth = player.getEntityAttribute(SharedMonsterAttributes.maxHealth);
float healthMax = (float)attrMaxHealth.getAttributeValue(); float healthMax = (float)attrMaxHealth.getAttributeValue();
@ -748,11 +748,11 @@ public class GuiIngameForge extends GuiIngame
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.scale(4.0F, 4.0F, 4.0F); GlStateManager.scale(4.0F, 4.0F, 4.0F);
int l = opacity << 24 & -16777216; int l = opacity << 24 & -16777216;
this.func_175179_f().drawString(this.field_175201_x, (float)(-this.func_175179_f().getStringWidth(this.field_175201_x) / 2), -10.0F, 16777215 | l, true); this.getFontRenderer().drawString(this.field_175201_x, (float)(-this.getFontRenderer().getStringWidth(this.field_175201_x) / 2), -10.0F, 16777215 | l, true);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.scale(2.0F, 2.0F, 2.0F); GlStateManager.scale(2.0F, 2.0F, 2.0F);
this.func_175179_f().drawString(this.field_175200_y, (float)(-this.func_175179_f().getStringWidth(this.field_175200_y) / 2), 5.0F, 16777215 | l, true); this.getFontRenderer().drawString(this.field_175200_y, (float)(-this.getFontRenderer().getStringWidth(this.field_175200_y) / 2), 5.0F, 16777215 | l, true);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
@ -784,16 +784,16 @@ public class GuiIngameForge extends GuiIngame
ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0); ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0);
NetHandlerPlayClient handler = mc.thePlayer.sendQueue; NetHandlerPlayClient handler = mc.thePlayer.sendQueue;
if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.func_175106_d().size() > 1 || scoreobjective != null)) if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null))
{ {
this.overlayPlayerList.func_175246_a(true); this.overlayPlayerList.updatePlayerList(true);
if (pre(PLAYER_LIST)) return; if (pre(PLAYER_LIST)) return;
this.overlayPlayerList.func_175249_a(width, this.mc.theWorld.getScoreboard(), scoreobjective); this.overlayPlayerList.renderPlayerlist(width, this.mc.theWorld.getScoreboard(), scoreobjective);
post(PLAYER_LIST); post(PLAYER_LIST);
} }
else else
{ {
this.overlayPlayerList.func_175246_a(false); this.overlayPlayerList.updatePlayerList(false);
} }
} }

View File

@ -50,7 +50,7 @@ public class ForgeBlockStateV1 extends Marker
{ {
JsonObject json = element.getAsJsonObject(); JsonObject json = element.getAsJsonObject();
ForgeBlockStateV1 ret = new ForgeBlockStateV1(); ForgeBlockStateV1 ret = new ForgeBlockStateV1();
ret.forge_marker = JsonUtils.getJsonObjectIntegerFieldValue(json, "forge_marker"); ret.forge_marker = JsonUtils.getInt(json, "forge_marker");
if (json.has("defaults")) // Load defaults Variant. if (json.has("defaults")) // Load defaults Variant.
{ {
@ -146,13 +146,13 @@ public class ForgeBlockStateV1 extends Marker
part.state = state; part.state = state;
} }
} }
Iterator<List<Variant>> iter = v.submodels.values().iterator(); Iterator<List<Variant>> iter = v.submodels.values().iterator();
while (iter.hasNext()) while (iter.hasNext())
{ {
List<Variant> submodel = iter.next(); List<Variant> submodel = iter.next();
if (submodel == null) if (submodel == null)
iter.remove(); iter.remove();
} }
@ -430,7 +430,7 @@ public class ForgeBlockStateV1 extends Marker
if (json.get("model").isJsonNull()) if (json.get("model").isJsonNull())
ret.model = null; // Allow overriding base model to remove it from a state. ret.model = null; // Allow overriding base model to remove it from a state.
else else
ret.model = getBlockLocation(JsonUtils.getJsonObjectStringFieldValue(json, "model")); ret.model = getBlockLocation(JsonUtils.getString(json, "model"));
ret.modelSet = true; ret.modelSet = true;
} }
@ -447,8 +447,8 @@ public class ForgeBlockStateV1 extends Marker
if (json.has("x") || json.has("y")) if (json.has("x") || json.has("y"))
{ // Load rotation values. { // Load rotation values.
int x = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(json, "x", 0); int x = JsonUtils.getInt(json, "x", 0);
int y = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(json, "y", 0); int y = JsonUtils.getInt(json, "y", 0);
ret.state = Optional.<IModelState>of(new TRSRTransformation(ModelRotation.getModelRotation(x, y))); ret.state = Optional.<IModelState>of(new TRSRTransformation(ModelRotation.getModelRotation(x, y)));
if (!ret.state.isPresent()) if (!ret.state.isPresent())
throw new JsonParseException("Invalid BlockModelRotation x: " + x + " y: " + y); throw new JsonParseException("Invalid BlockModelRotation x: " + x + " y: " + y);
@ -589,12 +589,12 @@ public class ForgeBlockStateV1 extends Marker
if (json.has("uvlock")) if (json.has("uvlock"))
{ // Load uvlock. { // Load uvlock.
ret.uvLock = Optional.of(JsonUtils.getJsonObjectBooleanFieldValue(json, "uvlock")); ret.uvLock = Optional.of(JsonUtils.getBoolean(json, "uvlock"));
} }
if (json.has("weight")) if (json.has("weight"))
{ // Load weight. { // Load weight.
ret.weight = Optional.of(JsonUtils.getJsonObjectIntegerFieldValue(json, "weight")); ret.weight = Optional.of(JsonUtils.getInt(json, "weight"));
} }
if (json.has("submodel")) if (json.has("submodel"))

View File

@ -234,7 +234,7 @@ public class ChestGenHooks
public ItemStack getOneItem(Random rand) public ItemStack getOneItem(Random rand)
{ {
WeightedRandomChestContent item = (WeightedRandomChestContent)WeightedRandom.getRandomItem(rand, getItems(rand)); WeightedRandomChestContent item = (WeightedRandomChestContent)WeightedRandom.getRandomItem(rand, getItems(rand));
ItemStack[] stacks = ChestGenHooks.generateStacks(rand, item.theItemId, item.theMinimumChanceToGenerateItem, item.theMaximumChanceToGenerateItem); ItemStack[] stacks = ChestGenHooks.generateStacks(rand, item.theItemId, item.minStackSize, item.maxStackSize);
return (stacks.length > 0 ? stacks[0] : null); return (stacks.length > 0 ? stacks[0] : null);
} }

View File

@ -670,7 +670,7 @@ public class ForgeHooks
if (world.getTileEntity(pos) == null) if (world.getTileEntity(pos) == null)
{ {
S23PacketBlockChange packet = new S23PacketBlockChange(world, pos); S23PacketBlockChange packet = new S23PacketBlockChange(world, pos);
packet.field_148883_d = Blocks.air.getDefaultState(); packet.blockState = Blocks.air.getDefaultState();
entityPlayer.playerNetServerHandler.sendPacket(packet); entityPlayer.playerNetServerHandler.sendPacket(packet);
} }

View File

@ -23,7 +23,7 @@ public class FakePlayer extends EntityPlayerMP
} }
@Override public Vec3 getPositionVector(){ return new Vec3(0, 0, 0); } @Override public Vec3 getPositionVector(){ return new Vec3(0, 0, 0); }
@Override public boolean canUseCommand(int i, String s){ return false; } @Override public boolean canCommandSenderUseCommand(int i, String s){ return false; }
@Override public void addChatComponentMessage(IChatComponent chatmessagecomponent){} @Override public void addChatComponentMessage(IChatComponent chatmessagecomponent){}
@Override public void addStat(StatBase par1StatBase, int par2){} @Override public void addStat(StatBase par1StatBase, int par2){}
@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){} @Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}

View File

@ -64,7 +64,7 @@ public class ExplosionEvent extends Event
/** return the list of blocks affected by the explosion. */ /** return the list of blocks affected by the explosion. */
public List<BlockPos> getAffectedBlocks() public List<BlockPos> getAffectedBlocks()
{ {
return explosion.func_180343_e(); return explosion.getAffectedBlockPositions();
} }
/** return the list of entities affected by the explosion. */ /** return the list of entities affected by the explosion. */

View File

@ -579,7 +579,7 @@ public class GuiModList extends GuiScreen
k += GuiModList.this.fontRendererObj.getStringWidth(((ChatComponentText)part).getChatComponentText_TextValue()); k += GuiModList.this.fontRendererObj.getStringWidth(((ChatComponentText)part).getChatComponentText_TextValue());
if (k >= x) if (k >= x)
{ {
GuiModList.this.func_175276_a(part); GuiModList.this.handleComponentClick(part);
break; break;
} }
} }

View File

@ -90,7 +90,7 @@ public class FMLNetworkHandler
embeddedChannel.writeOutbound(openGui); embeddedChannel.writeOutbound(openGui);
entityPlayerMP.openContainer = remoteGuiContainer; entityPlayerMP.openContainer = remoteGuiContainer;
entityPlayerMP.openContainer.windowId = windowId; entityPlayerMP.openContainer.windowId = windowId;
entityPlayerMP.openContainer.addCraftingToCrafters(entityPlayerMP); entityPlayerMP.openContainer.onCraftGuiOpened(entityPlayerMP);
} }
} }
else if (entityPlayer instanceof FakePlayer) else if (entityPlayer instanceof FakePlayer)

View File

@ -456,7 +456,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
for (I thing : this.typeSafeIterable()) for (I thing : this.typeSafeIterable())
{ {
if (!registry.field_148758_b.containsKey(thing)) if (!registry.inverseObjectRegistry.containsKey(thing))
{ {
if (!registry.activeSubstitutions.containsKey(getNameForObject(thing).toString())) if (!registry.activeSubstitutions.containsKey(getNameForObject(thing).toString()))
{ {

View File

@ -506,7 +506,7 @@ public class GameRegistry
NBTBase nbttag = null; NBTBase nbttag = null;
try try
{ {
nbttag = JsonToNBT.func_180713_a(nbtString); nbttag = JsonToNBT.getTagFromJson(nbtString);
} catch (NBTException e) } catch (NBTException e)
{ {
FMLLog.getLogger().log(Level.WARN, "Encountered an exception parsing ItemStack NBT string {}", nbtString, e); FMLLog.getLogger().log(Level.WARN, "Encountered an exception parsing ItemStack NBT string {}", nbtString, e);

View File

@ -180,7 +180,7 @@ public class FMLServerHandler implements IFMLSidedHandler
{ {
for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); ) for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); )
{ {
String cmd = it.next().input.trim().toLowerCase(); String cmd = it.next().command.trim().toLowerCase();
if (cmd.equals("/fml confirm")) if (cmd.equals("/fml confirm"))
{ {

View File

@ -25,7 +25,7 @@ public class ForgeCommand extends CommandBase {
} }
@Override @Override
public String getName() public String getCommandName()
{ {
return "forge"; return "forge";
} }
@ -42,7 +42,7 @@ public class ForgeCommand extends CommandBase {
return 2; return 2;
} }
@Override @Override
public void execute(ICommandSender sender, String[] args) throws CommandException public void processCommand(ICommandSender sender, String[] args) throws CommandException
{ {
if (args.length == 0) if (args.length == 0)
{ {
@ -80,7 +80,7 @@ public class ForgeCommand extends CommandBase {
else if (args.length == 2) else if (args.length == 2)
{ {
if ("tps".equals(args[0])) { if ("tps".equals(args[0])) {
return func_175762_a(args, getServer().worldTickTimes.keySet()); return getListOfStringsMatchingLastWord(args, getServer().worldTickTimes.keySet());
} }
else if ("track".equals(args[0])) else if ("track".equals(args[0]))
{ {
@ -89,7 +89,7 @@ public class ForgeCommand extends CommandBase {
} }
return null; return null;
} }
private void handleTracking(ICommandSender sender, String[] args) throws CommandException private void handleTracking(ICommandSender sender, String[] args) throws CommandException
{ {
if (args.length != 3) if (args.length != 3)

View File

@ -36,7 +36,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class ForgeBlockStatesLoaderDebug { public class ForgeBlockStatesLoaderDebug {
public static final String MODID = "ForgeBlockStatesLoader"; public static final String MODID = "ForgeBlockStatesLoader";
public static final String ASSETS = "forgeblockstatesloader:"; public static final String ASSETS = "forgeblockstatesloader:";
public static final Block blockCustom = new CustomMappedBlock(); public static final Block blockCustom = new CustomMappedBlock();
public static final String nameCustomWall = "custom_wall"; public static final String nameCustomWall = "custom_wall";
public static final BlockWall blockCustomWall = new BlockWall(Blocks.cobblestone); public static final BlockWall blockCustomWall = new BlockWall(Blocks.cobblestone);
@ -48,42 +48,42 @@ public class ForgeBlockStatesLoaderDebug {
return BlockWall.EnumType.byMetadata(stack.getMetadata()).getUnlocalizedName(); return BlockWall.EnumType.byMetadata(stack.getMetadata()).getUnlocalizedName();
} }
}); });
@EventHandler @EventHandler
public void preInit(FMLPreInitializationEvent event) public void preInit(FMLPreInitializationEvent event)
{ {
blockCustom.setUnlocalizedName(MODID + ".customBlock"); blockCustom.setUnlocalizedName(MODID + ".customBlock");
GameRegistry.registerBlock(blockCustom, "customBlock"); GameRegistry.registerBlock(blockCustom, "customBlock");
blockCustomWall.setUnlocalizedName(MODID + ".customWall"); blockCustomWall.setUnlocalizedName(MODID + ".customWall");
GameRegistry.registerBlock(blockCustomWall, null, nameCustomWall); GameRegistry.registerBlock(blockCustomWall, null, nameCustomWall);
GameRegistry.registerItem(itemCustomWall, nameCustomWall); GameRegistry.registerItem(itemCustomWall, nameCustomWall);
GameData.getBlockItemMap().put(blockCustomWall, itemCustomWall); GameData.getBlockItemMap().put(blockCustomWall, itemCustomWall);
if (event.getSide() == Side.CLIENT) if (event.getSide() == Side.CLIENT)
preInitClient(event); preInitClient(event);
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void preInitClient(FMLPreInitializationEvent event) public void preInitClient(FMLPreInitializationEvent event)
{ {
ModelLoader.setCustomStateMapper(blockCustom, new StateMap.Builder().setProperty(CustomMappedBlock.VARIANT).build()); ModelLoader.setCustomStateMapper(blockCustom, new StateMap.Builder().withName(CustomMappedBlock.VARIANT).build());
ModelLoader.setCustomStateMapper(blockCustomWall, new IStateMapper() ModelLoader.setCustomStateMapper(blockCustomWall, new IStateMapper()
{ {
StateMap stateMap = new StateMap.Builder().setProperty(BlockWall.VARIANT).setBuilderSuffix("_wall").build(); StateMap stateMap = new StateMap.Builder().withName(BlockWall.VARIANT).withSuffix("_wall").build();
@Override @Override
public Map putStateModelLocations(Block block) public Map putStateModelLocations(Block block)
{ {
Map<IBlockState, ModelResourceLocation> map = (Map<IBlockState, ModelResourceLocation>) stateMap.putStateModelLocations(block); Map<IBlockState, ModelResourceLocation> map = (Map<IBlockState, ModelResourceLocation>) stateMap.putStateModelLocations(block);
Map<IBlockState, ModelResourceLocation> newMap = Maps.newHashMap(); Map<IBlockState, ModelResourceLocation> newMap = Maps.newHashMap();
for (Entry<IBlockState, ModelResourceLocation> e : map.entrySet()) for (Entry<IBlockState, ModelResourceLocation> e : map.entrySet())
{ {
ModelResourceLocation loc = e.getValue(); ModelResourceLocation loc = e.getValue();
newMap.put(e.getKey(), new ModelResourceLocation(ASSETS + loc.getResourcePath(), loc.getVariant())); newMap.put(e.getKey(), new ModelResourceLocation(ASSETS + loc.getResourcePath(), loc.getVariant()));
} }
return newMap; return newMap;
} }
}); });
@ -92,41 +92,41 @@ public class ForgeBlockStatesLoaderDebug {
ModelLoader.setCustomModelResourceLocation(customWallItem, 1, new ModelResourceLocation(ASSETS + "mossy_cobblestone_wall", "inventory")); ModelLoader.setCustomModelResourceLocation(customWallItem, 1, new ModelResourceLocation(ASSETS + "mossy_cobblestone_wall", "inventory"));
ModelBakery.addVariantName(customWallItem, ASSETS + "cobblestone_wall", ASSETS + "mossy_cobblestone_wall"); ModelBakery.addVariantName(customWallItem, ASSETS + "cobblestone_wall", ASSETS + "mossy_cobblestone_wall");
} }
// this block is never actually used, it's only needed for the error message on load to see the variant it maps to // this block is never actually used, it's only needed for the error message on load to see the variant it maps to
public static class CustomMappedBlock extends Block { public static class CustomMappedBlock extends Block {
public static final PropertyEnum VARIANT = PropertyEnum.create("type", CustomVariant.class); public static final PropertyEnum VARIANT = PropertyEnum.create("type", CustomVariant.class);
protected CustomMappedBlock() { protected CustomMappedBlock() {
super(Material.rock); super(Material.rock);
this.setUnlocalizedName(MODID + ".customMappedBlock"); this.setUnlocalizedName(MODID + ".customMappedBlock");
} }
@Override @Override
protected BlockState createBlockState() { protected BlockState createBlockState() {
return new BlockState(this, VARIANT); return new BlockState(this, VARIANT);
} }
@Override @Override
public int getMetaFromState(IBlockState state) public int getMetaFromState(IBlockState state)
{ {
return ((CustomVariant)state.getValue(VARIANT)).ordinal(); return ((CustomVariant)state.getValue(VARIANT)).ordinal();
} }
@Override @Override
public IBlockState getStateFromMeta(int meta) public IBlockState getStateFromMeta(int meta)
{ {
if(meta > CustomVariant.values().length || meta < 0) if(meta > CustomVariant.values().length || meta < 0)
meta = 0; meta = 0;
return this.getDefaultState().withProperty(VARIANT, CustomVariant.values()[meta]); return this.getDefaultState().withProperty(VARIANT, CustomVariant.values()[meta]);
} }
public static enum CustomVariant implements IStringSerializable { public static enum CustomVariant implements IStringSerializable {
TypeA, TypeA,
TypeB; TypeB;
public String getName() { return this.toString(); }; public String getName() { return this.toString(); };
} }
} }