public void setOrder(Order order) { if (this.world.isRemote) { if (this.owner != null) { EntityPlayer player = this.world.getPlayerEntityByUUID(this.owner); if (player != null) { TextComponentString change = new TextComponentString(LangUtils.translate(LangUtils.SET_ORDER).replace("{order}", LangUtils.translate(LangUtils.ORDER_VALUE.get(order.name().toLowerCase(Locale.ENGLISH))))); change.getStyle().setColor(TextFormatting.GOLD); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, change); } } JurassiCraft.NETWORK_WRAPPER.sendToServer(new SetOrderMessage(this)); } }
@Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if(player.isSneaking()) { int mode = this.changeMode(stack); if (world.isRemote) { TextComponentString change = new TextComponentString(LangUtils.translate(LangUtils.GENDER_CHANGE.get("spawnegg")).replace("{mode}", LangUtils.getGenderMode(mode))); change.getStyle().setColor(TextFormatting.GOLD); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, change); } } return new ActionResult<>(EnumActionResult.SUCCESS, stack); }
@Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if (this.isSkeleton(stack)) { if (player.isSneaking()) { int oldVariant = this.getSkeletonType(stack); int variant = this.changeSkeletonVariant(stack); if (variant != oldVariant && world.isRemote) { TextComponentString change = new TextComponentString(LangUtils.translate(LangUtils.SKELETON_CHANGE.get("variant")).replace("{mode}", LangUtils.getSkeletonMode(EntityHandler.getDinosaurById(this.getDinosaurID(stack)), variant))); change.getStyle().setColor(TextFormatting.YELLOW); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, change); } } } return new ActionResult<>(EnumActionResult.SUCCESS, stack); } }
TextComponentString denied = new TextComponentString(LangUtils.translate("message.too_young.name")); denied.getStyle().setColor(TextFormatting.RED); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, denied); TextComponentString denied = new TextComponentString(LangUtils.translate("message.not_owned.name")); denied.getStyle().setColor(TextFormatting.RED); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, denied); TextComponentString denied = new TextComponentString(LangUtils.translate("message.not_owned.name")); denied.getStyle().setColor(TextFormatting.RED); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, denied);
TextComponentString change = new TextComponentString(LangUtils.translate(LangUtils.GENDER_CHANGE.get("actionfigure")).replace("{mode}", LangUtils.getGenderMode(mode))); change.getStyle().setColor(TextFormatting.GOLD); Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.GAME_INFO, change);