Search in sources :

Example 26 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project ArsMagica2 by Mithion.

the class ItemSpellBook method onUpdate.

@Override
@SideOnly(Side.CLIENT)
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
    super.onUpdate(stack, world, entity, par4, par5);
    if (entity instanceof EntityPlayerSP) {
        EntityPlayerSP player = (EntityPlayerSP) entity;
        ItemStack usingItem = player.getItemInUse();
        if (usingItem != null && usingItem.getItem() == this) {
            if (SkillData.For(player).isEntryKnown(SkillTreeManager.instance.getSkillTreeEntry(SkillManager.instance.getSkill("SpellMotion")))) {
                player.movementInput.moveForward *= 2.5F;
                player.movementInput.moveStrafe *= 2.5F;
            }
        }
    }
}
Also used : EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 27 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project ArsMagica2 by Mithion.

the class ItemSpellStaff method onUpdate.

@Override
@SideOnly(Side.CLIENT)
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
    super.onUpdate(stack, world, entity, par4, par5);
    if (entity instanceof EntityPlayerSP) {
        EntityPlayerSP player = (EntityPlayerSP) entity;
        ItemStack usingItem = player.getItemInUse();
        if (usingItem != null && usingItem.getItem() == this) {
            if (SkillData.For(player).isEntryKnown(SkillTreeManager.instance.getSkillTreeEntry(SkillManager.instance.getSkill("SpellMotion")))) {
                player.movementInput.moveForward *= 2.5F;
                player.movementInput.moveStrafe *= 2.5F;
            }
        }
    }
}
Also used : EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 28 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project Railcraft by Railcraft.

the class PacketGuiString method readData.

@Override
public void readData(RailcraftInputStream data) throws IOException {
    windowId = data.readByte();
    dataId = data.readByte();
    str = data.readUTF();
    EntityPlayerSP player = FMLClientHandler.instance().getClient().thePlayer;
    if (player.openContainer instanceof RailcraftContainer && player.openContainer.windowId == windowId)
        ((RailcraftContainer) player.openContainer).updateString(dataId, str);
}
Also used : RailcraftContainer(mods.railcraft.common.gui.containers.RailcraftContainer) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP)

Example 29 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project Railcraft by Railcraft.

the class PacketGuiData method readData.

@Override
public void readData(RailcraftInputStream data) throws IOException {
    windowId = data.readByte();
    dataId = data.readByte();
    EntityPlayerSP player = FMLClientHandler.instance().getClient().thePlayer;
    if (player.openContainer instanceof RailcraftContainer && player.openContainer.windowId == windowId)
        ((RailcraftContainer) player.openContainer).updateData(dataId, data);
}
Also used : RailcraftContainer(mods.railcraft.common.gui.containers.RailcraftContainer) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP)

Example 30 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project Railcraft by Railcraft.

the class PacketGuiInteger method readData.

@Override
public void readData(RailcraftInputStream data) throws IOException {
    windowId = data.readByte();
    dataId = data.readByte();
    value = data.readInt();
    EntityPlayerSP player = FMLClientHandler.instance().getClient().thePlayer;
    if (player.openContainer != null && player.openContainer.windowId == windowId)
        player.openContainer.updateProgressBar(dataId, value);
}
Also used : EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP)

Aggregations

EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)44 ItemStack (net.minecraft.item.ItemStack)9 Entity (net.minecraft.entity.Entity)7 BlockPos (net.minecraft.util.math.BlockPos)6 Minecraft (net.minecraft.client.Minecraft)5 WorldClient (net.minecraft.client.multiplayer.WorldClient)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 ArrayList (java.util.ArrayList)3 RailcraftContainer (mods.railcraft.common.gui.containers.RailcraftContainer)3 World (net.minecraft.world.World)3 JsonObject (com.google.gson.JsonObject)2 DrawItem (com.microsoft.Malmo.Schemas.DrawItem)2 EntityTypes (com.microsoft.Malmo.Schemas.EntityTypes)2 List (java.util.List)2 UUID (java.util.UUID)2 IBlockState (net.minecraft.block.state.IBlockState)2 NetworkPlayerInfo (net.minecraft.client.network.NetworkPlayerInfo)2