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;
}
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);
}
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;
}
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);
}
}
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;
}
}
Aggregations