Search in sources :

Example 21 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Armourers-Workshop by RiskyKen.

the class RenderBlockColourable method isPlayerHoldingPaintingTool.

private boolean isPlayerHoldingPaintingTool() {
    EntityClientPlayerMP player = mc.thePlayer;
    ItemStack stack = player.getCurrentEquippedItem();
    if (stack != null) {
        Item item = stack.getItem();
        if (item instanceof IBlockPainter) {
            return true;
        } else if (item == ModItems.colourPicker) {
            return true;
        } else if (item == ModItems.blockMarker) {
            return true;
        }
    }
    return false;
}
Also used : Item(net.minecraft.item.Item) IBlockPainter(riskyken.armourersWorkshop.common.painting.IBlockPainter) EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) ItemStack(net.minecraft.item.ItemStack)

Example 22 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Armourers-Workshop by RiskyKen.

the class RehostedJarHandler method onPlayerTick.

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
    if (validJar) {
        return;
    }
    if (event.side != Side.CLIENT) {
        return;
    }
    if (event.type != Type.PLAYER) {
        return;
    }
    if (event.phase != Phase.END) {
        return;
    }
    if (lastMessagePost + messagePostRate > System.currentTimeMillis()) {
        return;
    }
    lastMessagePost = System.currentTimeMillis();
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    ChatComponentTranslation downloadLink = new ChatComponentTranslation("chat.armourersworkshop:invalidJarDownload", (Object) null);
    downloadLink.getChatStyle().setUnderlined(true);
    downloadLink.getChatStyle().setColor(EnumChatFormatting.BLUE);
    downloadLink.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentTranslation("chat.armourersworkshop:invalidJarDownloadTooltip", (Object) null)));
    downloadLink.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, LibModInfo.DOWNLOAD_URL));
    ChatComponentTranslation stopModRepostsLink = new ChatComponentTranslation("chat.armourersworkshop:invalidJarStopModReposts", (Object) null);
    stopModRepostsLink.getChatStyle().setUnderlined(true);
    stopModRepostsLink.getChatStyle().setColor(EnumChatFormatting.BLUE);
    stopModRepostsLink.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentTranslation("chat.armourersworkshop:invalidJarStopModRepostsTooltip", (Object) null)));
    stopModRepostsLink.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, STOP_MOD_REPOSTS_URL));
    ChatComponentTranslation updateMessage = new ChatComponentTranslation("chat.armourersworkshop:invalidJar", downloadLink, stopModRepostsLink);
    updateMessage.getChatStyle().setColor(EnumChatFormatting.RED);
    player.addChatMessage(updateMessage);
}
Also used : HoverEvent(net.minecraft.event.HoverEvent) EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) ClickEvent(net.minecraft.event.ClickEvent) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 23 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Armourers-Workshop by RiskyKen.

the class MessageServerMiniArmourerCubeEdit method onMessage.

@Override
public IMessage onMessage(MessageServerMiniArmourerCubeEdit message, MessageContext ctx) {
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    Minecraft mc = Minecraft.getMinecraft();
    if (player == null) {
        return null;
    }
    GuiScreen screen = mc.currentScreen;
    if (screen != null && screen instanceof GuiMiniArmourerBuilding) {
        ((GuiMiniArmourerBuilding) screen).tileEntity.cubeUpdateFromServer(message.skinPartType, message.cube, message.remove);
    }
    return null;
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) GuiMiniArmourerBuilding(riskyken.armourersWorkshop.client.gui.miniarmourer.GuiMiniArmourerBuilding) GuiScreen(net.minecraft.client.gui.GuiScreen) Minecraft(net.minecraft.client.Minecraft)

Example 24 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project ForestryMC by ForestryMC.

the class PacketGuiInteger method readData.

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

Example 25 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project Minestuck by mraof.

the class ClientEditHandler method onClientPackage.

public static void onClientPackage(String target, int posX, int posZ, boolean[] items) {
    Minecraft mc = Minecraft.getMinecraft();
    EntityClientPlayerMP player = mc.thePlayer;
    if (target != null) {
        // Enable edit mode
        activated = true;
        givenItems = items;
        centerX = posX;
        centerZ = posZ;
        client = target;
    } else if (items != null) {
        givenItems = items;
    } else // Disable edit mode
    {
        player.fallDistance = 0;
        activated = false;
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) Minecraft(net.minecraft.client.Minecraft)

Aggregations

EntityClientPlayerMP (net.minecraft.client.entity.EntityClientPlayerMP)34 Minecraft (net.minecraft.client.Minecraft)8 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)7 ItemStack (net.minecraft.item.ItemStack)6 SideOnly (cpw.mods.fml.relauncher.SideOnly)5 Coordinate (mcjty.lib.varia.Coordinate)3 Tessellator (net.minecraft.client.renderer.Tessellator)3 Item (net.minecraft.item.Item)3 TileEntity (net.minecraft.tileentity.TileEntity)3 GlobalCoordinate (mcjty.lib.varia.GlobalCoordinate)2 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)2 GuiScreen (net.minecraft.client.gui.GuiScreen)2 ClickEvent (net.minecraft.event.ClickEvent)2 HoverEvent (net.minecraft.event.HoverEvent)2 ChatComponentText (net.minecraft.util.ChatComponentText)2 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)2 World (net.minecraft.world.World)2 Vector3 (WayofTime.alchemicalWizardry.api.Vector3)1 IMasterRitualStone (WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone)1 RitualComponent (WayofTime.alchemicalWizardry.api.rituals.RitualComponent)1