Search in sources :

Example 1 with GuiTitleSelector

use of com.mraof.minestuck.client.gui.GuiTitleSelector in project Minestuck by mraof.

the class PlayerDataPacket method execute.

@Override
public void execute(EntityPlayer player) {
    if (type == COLOR) {
        if (i1 == -2) {
            ColorCollector.playerColor = -1;
            ColorCollector.displaySelectionGui = true;
        } else
            ColorCollector.playerColor = i1;
    } else if (type == TITLE) {
        MinestuckPlayerData.title = new Title(EnumClass.getClassFromInt(i1), EnumAspect.getAspectFromInt(i2));
    } else if (type == ECHELADDER) {
        int prev = MinestuckPlayerData.rung;
        MinestuckPlayerData.rung = i1;
        MinestuckPlayerData.rungProgress = f;
        if (!b)
            for (prev++; prev <= i1; prev++) {
                String s = I18n.canTranslate("echeladder.rung" + prev) ? I18n.translateToLocal("echeladder.rung" + prev) : String.valueOf(prev + 1);
                player.sendMessage(new TextComponentString("You reached rung " + s + '!'));
            }
        else
            GuiEcheladder.animatedRung = GuiEcheladder.lastRung = i1;
    } else if (type == BOONDOLLAR) {
        MinestuckPlayerData.boondollars = i1;
    } else if (type == TITLE_SELECT) {
        Title title;
        if (i1 >= 0 && i1 < 12 && i2 >= 0 && i2 < 12)
            title = new Title(EnumClass.getClassFromInt(i1), EnumAspect.getAspectFromInt(i2));
        else
            title = null;
        if (player.world.isRemote) {
            FMLClientHandler.instance().showGuiScreen(new GuiTitleSelector(title));
        } else {
            SburbHandler.titleSelected(player, title);
        }
    }
}
Also used : GuiTitleSelector(com.mraof.minestuck.client.gui.GuiTitleSelector) Title(com.mraof.minestuck.util.Title) TextComponentString(net.minecraft.util.text.TextComponentString) TextComponentString(net.minecraft.util.text.TextComponentString)

Aggregations

GuiTitleSelector (com.mraof.minestuck.client.gui.GuiTitleSelector)1 Title (com.mraof.minestuck.util.Title)1 TextComponentString (net.minecraft.util.text.TextComponentString)1