use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.
the class EntityBuilderKeeper method interact.
@Override
public boolean interact(EntityPlayer player) {
if (this.canInteractWith(player)) {
if (PlayerProvider.get(player).getGlory() < 10000 && !Buildings.INSTANCE.kingdomCreated) {
if (!worldObj.isRemote) {
player.addChatMessage(new ChatComponentTranslation("npc.cityBuilder.dialog_1"));
}
}
if (PlayerProvider.get(player).getGlory() >= 10000.0F && !setted) {
if (!worldObj.isRemote) {
player.addChatMessage(new ChatComponentTranslation("npc.cityBuilder.dialog_2"));
this.follow = true;
this.setted = true;
}
player.openGui(TaleOfKingdoms.instance, GUI_BUILD, worldObj, (int) this.posX, (int) this.posY, (int) this.posZ);
} else if (PlayerProvider.get(player).getGlory() >= 10000.0F && this.follow && !Buildings.INSTANCE.kingdomCreated && !setted) {
if (!worldObj.isRemote) {
player.addChatMessage(new ChatComponentTranslation("npc.cityBuilder.dialog_3"));
this.follow = false;
}
}
}
return true;
}
use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.
the class GuiHunter method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) {
switch(button.id) {
case 1:
this.player.addChatMessage(!HunterHandler.INSTANCE.getHunter() ? new ChatComponentTranslation("gui.guildMaster.killMobs") : new ChatComponentTranslation("gui.guildMaster.discarded"));
this.player.addChatMessage(new ChatComponentTranslation("gui.guildMaster.await"));
this.initGui();
break;
case 2:
if (1500 <= playerProvider.getGoldTotal()) {
EntityLiving entityLiving = (EntityLiving) UltimateHelper.INSTANCE.getEntity("Hired", world);
entityLiving.setLocationAndAngles(this.player.posX, this.player.posY, this.player.posZ, 0.0F, 0.0F);
this.world.spawnEntityInWorld(entityLiving);
playerProvider.decreaseGold(1500);
} else {
this.goldchecker = true;
}
break;
case 3:
this.mc.displayGuiScreen(null);
this.goldchecker = false;
break;
case 4:
InventoryPlayer inventoryPlayer = this.player.inventory;
boolean entity = false;
if (inventoryPlayer.hasItem(Item.getItemFromBlock(Blocks.log))) {
for (ItemStack stack : inventoryPlayer.mainInventory) {
if (stack != null && stack.getItem() == Item.getItemFromBlock(Blocks.log)) {
if (stack.stackSize == stack.getMaxStackSize() && !entity) {
inventoryPlayer.setItemStack(null);
entity = true;
}
}
}
}
if (!entity) {
if (!this.world.isRemote) {
this.player.addChatMessage(new ChatComponentTranslation("gui.guildMaster.needMore"));
}
} else if (!this.world.isRemote) {
this.player.addChatMessage(new ChatComponentTranslation("gui.guildMaster.fixed"));
}
break;
case 5:
IntStream.range(0, this.world.loadedEntityList.size()).mapToObj(var7 -> (Entity) this.world.loadedEntityList.get(var7)).filter(entity1 -> entity1 instanceof EntityHired).map(entity1 -> (EntityHired) entity1).forEach(var9 -> {
var9.setDead();
playerProvider.addGold(1000);
});
break;
}
}
use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.
the class GuiQuarry method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) {
switch(button.id) {
case 1:
if (ResourcesHandler.INSTANCE.getCobblePool() >= 64) {
ItemStack itemstack = new ItemStack(Blocks.cobblestone, 64, 0);
EntityItem entityitem = new EntityItem(this.world, this.player.posX, this.player.posY, this.player.posZ, itemstack);
this.world.spawnEntityInWorld(entityitem);
this.goldchecker = false;
ResourcesHandler.INSTANCE.decreaseCobblePool(64);
} else
this.player.addChatMessage(new ChatComponentTranslation("gui.foreman.notResources"));
break;
case 2:
if (playerProvider.getGoldTotal() >= 1500) {
if (WorkersHandler.INSTANCE.getQuarryMembers() < 12) {
if (!this.world.isRemote) {
WorkersHandler.INSTANCE.addQuarryMember((byte) 1);
playerProvider.decreaseGold(1500);
this.player.addChatMessage(new ChatComponentTranslation("gui.foreman.boughtWorker"));
}
} else if (!this.world.isRemote) {
this.player.addChatMessage(new ChatComponentTranslation("gui.foreman.limitWorkers"));
}
} else
this.goldchecker = true;
break;
case 3:
this.mc.displayGuiScreen(null);
break;
}
}
use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.
the class EntityPriestKeeper method interact.
@Override
public boolean interact(EntityPlayer player) {
if (this.canInteractWith(player)) {
if (!this.worldObj.isRemote) {
this.heal(100.0F);
player.addChatMessage(new ChatComponentTranslation("npc.headPriest.dialog"));
}
player.openGui(TaleOfKingdoms.instance, GUI_PRIEST, worldObj, 0, 0, 0);
}
return true;
}
use of net.minecraft.util.ChatComponentTranslation 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);
}
Aggregations