Package morph.common.morph

Examples of morph.common.morph.MorphState


                    nextTag.setTag("ActiveEffects", nbttaglist);
                }
            }
        }

        MorphState prevState = new MorphState(mc.theWorld, playerName, "", null, true);
        MorphState nextState = new MorphState(mc.theWorld, playerName, "", null, true);

        prevState.readTag(mc.theWorld, prevTag);
        nextState.readTag(mc.theWorld, nextTag);

        //TODO check for mc.theplayer morphstate
        //          prevState = MorphHandler.addOrGetMorphState(Morph.proxy.tickHandlerClient.getPlayerMorphs(event.entityPlayer.worldObj, event.entityPlayer.username), prevState);
        //          nextState = MorphHandler.addOrGetMorphState(Morph.proxy.tickHandlerClient.getPlayerMorphs(event.entityPlayer.worldObj, event.entityPlayer.username), nextState);
View Full Code Here


                                newSlide = true;
                            }

                            for(int j = 0; j < states.size(); j++)
                            {
                                MorphState state = states.get(j);
                                GL11.glPushMatrix();

                                GL11.glTranslated(newSlide && j == 0 ? 0.0D : ((selectorSelectedHori - selectorSelectedHoriPrev) * 42F) * (1.0F - progressH), 0.0D, 0.0D);

                                double dist = size * (j - selectorSelectedHori);

                                GL11.glTranslated(dist, 0.0D, 0.0D);

                                float entSize = state.entInstance.width > state.entInstance.height ? state.entInstance.width : state.entInstance.height;

                                float prog = j - selectorSelectedHori == 0 ? (!selectorShow ? scrollTimerHori - renderTick : (3F - scrollTimerHori + renderTick)) / 3F : 0.0F;
                                prog = MathHelper.clamp_float(prog, 0.0F, 1.0F);

                                float scaleMag = ((2.5F + (entSize - 2.5F) * prog) / entSize) ;

                                drawEntityOnScreen(state, state.entInstance, 20, height1, entSize > 2.5F ? 16F * scaleMag : 16F, 2, 2, renderTick, true, j == states.size() - 1);

                                GL11.glPopMatrix();
                            }
                        }
                        else
                        {
                            MorphState state = states.get(0);
                            float entSize = state.entInstance.width > state.entInstance.height ? state.entInstance.width : state.entInstance.height;

                            float prog = selectorSelected == i ? (!selectorShow ? scrollTimer - renderTick : (3F - scrollTimer + renderTick)) / 3F : 0.0F;
                            prog = MathHelper.clamp_float(prog, 0.0F, 1.0F);

View Full Code Here

                    selectorSelected = 0;

                    MorphInfoClient info = playerMorphInfo.get(mc.thePlayer.getCommandSenderName());
                    if(info != null)
                    {
                        MorphState state = info.nextState;
                        String entName = state.entInstance.getCommandSenderName();

                        int i = 0;

                        Iterator<Entry<String, ArrayList<MorphState>>> ite = playerMorphCatMap.entrySet().iterator();
View Full Code Here

                final int stencilBit = MinecraftForgeClient.reserveStencilBit();

                if(stencilBit >= 0 && abilitiesSize > 3)
                {
                    MorphState selectedState = null;

                    int i = 0;

                    Iterator<Entry<String, ArrayList<MorphState>>> ite = playerMorphCatMap.entrySet().iterator();
View Full Code Here

    {
        MorphInfo info = Morph.proxy.tickHandlerServer.getPlayerMorphInfo(player);

        if(!(info != null && info.getMorphing()) || input == 2)
        {
            MorphState state = MorphHandler.getMorphState((EntityPlayerMP)player, identifier);

            if(state != null)
            {
                switch(input)
                {
                    case 0:
                    {
                        //select
                        MorphState old = info != null ? info.nextState : Morph.proxy.tickHandlerServer.getSelfState(player.worldObj, player);

                        MorphInfo info2 = new MorphInfo(player.getCommandSenderName(), old, state);
                        info2.setMorphing(true);
                        info2.healthOffset = player.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() - 20D;
                        info2.preMorphHealth = player.getHealth();
View Full Code Here

        }

        boolean requireReorder = false;
        for(NBTTagCompound tag : stateTags)
        {
            MorphState state = new MorphState(mc.theWorld, mc.thePlayer.getCommandSenderName(), "", null, true);

            if(tag != null)
            {
                state.readTag(mc.theWorld, tag);

                String name = state.entInstance.getCommandSenderName();

                if(name != null)
                {
View Full Code Here

                    {
                        EntityPlayerMP player1 = new EntityPlayerMP(FMLCommonHandler.instance().getMinecraftServerInstance(), DimensionManager.getWorld(0), EntityHelperBase.getSimpleGameProfileFromName(args[1]), new ItemInWorldManager(DimensionManager.getWorld(0)));
                        FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().readPlayerDataFromFile(player1);
                        if(Morph.proxy.tickHandlerServer.getMorphDataFromPlayer(player1).hasKey("morphData"))
                        {
                            MorphState state = Morph.proxy.tickHandlerServer.getSelfState(DimensionManager.getWorld(0), player1);

                            MorphInfo info = new MorphInfo(args[1], state, state);
                            info.morphProgress = 80;
                            info.healthOffset = Morph.proxy.tickHandlerServer.getMorphDataFromPlayer(player1).getDouble("healthOffset");

                            Morph.proxy.tickHandlerServer.getMorphDataFromPlayer(player1).removeTag("morphData");

                            PacketHandler.sendToAll(Morph.channels, info.getMorphInfoAsPacket());

                            Morph.proxy.tickHandlerServer.setPlayerMorphInfo(player1, null);

                            func_152373_a(icommandsender, this, "morph.command.forcingDemorph", args[1]);

                            //Workaround to force save.
                            FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList.add(player1);
                            FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().saveAllPlayerData();
                            FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList.remove(player1);
                        }
                        else
                        {
                            icommandsender.addChatMessage(new ChatComponentTranslation("morph.command.noMorphData", args[1]));
                        }
                    }
                    catch(Exception e)
                    {
                        icommandsender.addChatMessage(new ChatComponentTranslation("morph.command.cannotReadMorphData", args[1]));
                    }
                }
                else
                {
                    icommandsender.addChatMessage(new ChatComponentTranslation("morph.command.notOnline", args[1]));
                }
            }
            else if(args[0].equalsIgnoreCase("clear"))
            {
                EntityPlayer player;
                if(args.length > 1)
                {
                    player = PlayerSelector.matchOnePlayer(icommandsender, args[1]);
                }
                else
                {
                    player = getCommandSenderAsPlayer(icommandsender);
                }
                if (player == null)
                {
                    player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(args[1]);
                }
                if(player != null)
                {
                    MorphInfo info = Morph.proxy.tickHandlerServer.getPlayerMorphInfo(player);

                    MorphState state1;

                    MorphState state2 = Morph.proxy.tickHandlerServer.getSelfState(player.worldObj, player);

                    if(info != null)
                    {
                        state1 = info.nextState;
                        MorphInfo info2 = new MorphInfo(player.getCommandSenderName(), state1, state2);
                        info2.setMorphing(true);
                        info2.healthOffset = info.healthOffset;
                        info2.preMorphHealth = player.getHealth();

                        Morph.proxy.tickHandlerServer.setPlayerMorphInfo(player, info2);

                        PacketHandler.sendToAll(Morph.channels, info2.getMorphInfoAsPacket());

                        player.worldObj.playSoundAtEntity(player, "morph:morph", 1.0F, 1.0F);
                    }
                    Morph.proxy.tickHandlerServer.removeAllPlayerMorphsExcludingCurrentMorph(player);

                    MorphHandler.updatePlayerOfMorphStates((EntityPlayerMP)player, null, true);

                    func_152373_a(icommandsender, this, "morph.command.clearingMorphs", args[1]);
                }
                else
                {
                    try
                    {
                        EntityPlayerMP player1 = new EntityPlayerMP(FMLCommonHandler.instance().getMinecraftServerInstance(), DimensionManager.getWorld(0), EntityHelperBase.getSimpleGameProfileFromName(args[1]), new ItemInWorldManager(DimensionManager.getWorld(0)));
                        FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().readPlayerDataFromFile(player1);

                        if(Morph.proxy.tickHandlerServer.getMorphDataFromPlayer(player1).hasKey("morphData"))
                        {
                            MorphState state = Morph.proxy.tickHandlerServer.getSelfState(DimensionManager.getWorld(0), player1);

                            MorphInfo info = new MorphInfo(args[1], state, state);
                            info.morphProgress = 80;
                            info.healthOffset = Morph.proxy.tickHandlerServer.getMorphDataFromPlayer(player1).getDouble("healthOffset");
View Full Code Here

    NBTTagCompound nextTag = new NBTTagCompound();

    info.nextState.entInstance.writeToNBTOptional(prevTag);
    living.writeToNBTOptional(nextTag);
   
    MorphState prevState = new MorphState(player.worldObj, player.getCommandSenderName(), username1, prevTag, false);
    MorphState nextState = new MorphState(player.worldObj, player.getCommandSenderName(), username2, nextTag, false);

        if(Morph.proxy.tickHandlerServer.hasMorphState(player, nextState) || !forced && MinecraftForge.EVENT_BUS.post(new MorphAcquiredEvent(player, nextState.entInstance)))
    {
      return false;
    }
View Full Code Here

 
  public static boolean demorphPlayer(EntityPlayerMP player)
  {
    MorphInfo info = Morph.proxy.tickHandlerServer.getPlayerMorphInfo(player);
   
    MorphState state1;
   
    MorphState state2 = Morph.proxy.tickHandlerServer.getSelfState(player.worldObj, player);
   
    if(info != null)
    {
      state1 = info.nextState;
      MorphInfo info2 = new MorphInfo(player.getCommandSenderName(), state1, state2);
View Full Code Here

                tag.setInteger("morphStatesCount", e.getValue().size());

                for(int i = 0; i < e.getValue().size(); i++)
                {
                    MorphState state = e.getValue().get(i);
                    tag.setTag("morphState" + i, state.getTag());
                }

                ite1.remove();
            }
            if(purgeSession)
View Full Code Here

TOP

Related Classes of morph.common.morph.MorphState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.