Search in sources :

Example 86 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project BloodMagic by WayofTime.

the class EntityDemon method sendSittingMessageToPlayer.

public void sendSittingMessageToPlayer(EntityPlayer owner, boolean isSitting) {
    if (owner != null && owner.worldObj.isRemote) {
        ChatComponentTranslation chatmessagecomponent;
        if (isSitting) {
            chatmessagecomponent = new ChatComponentTranslation("message.demon.willstay");
        } else {
            chatmessagecomponent = new ChatComponentTranslation("message.demon.shallfollow");
        }
        owner.addChatComponentMessage(chatmessagecomponent);
    }
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation)

Example 87 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project BloodMagic by WayofTime.

the class TEMasterStone method activateRitual.

public void activateRitual(World world, int crystalLevel, ItemStack activationCrystal, EntityPlayer player, String crystalOwner) {
    if (world.isRemote) {
        return;
    }
    String testRitual = Rituals.checkValidRitual(world, xCoord, yCoord, zCoord);
    if (testRitual.equals("")) {
        player.addChatMessage(new ChatComponentTranslation("message.masterstone.nothinghappened"));
        return;
    }
    // TODO
    RitualActivatedEvent event = new RitualActivatedEvent(this, crystalOwner, testRitual, player, activationCrystal, crystalLevel);
    if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY) {
        player.addChatMessage(new ChatComponentTranslation("message.masterstone.somethingstoppedyou"));
        return;
    }
    int eventCrystalTier = event.crystalTier;
    String eventRitualKey = event.ritualKey;
    String eventOwnerKey = event.ownerKey;
    boolean testLevel = Rituals.canCrystalActivate(eventRitualKey, eventCrystalTier);
    if (!testLevel) {
        player.addChatMessage(new ChatComponentTranslation("message.masterstone.crystalvibrates"));
        return;
    }
    int currentEssence = SoulNetworkHandler.getCurrentEssence(eventOwnerKey);
    if (currentEssence < Rituals.getCostForActivation(testRitual)) {
        player.addChatMessage(new ChatComponentTranslation("message.masterstone.youfeelapull"));
        return;
    }
    if (!world.isRemote) {
        if (!Rituals.startRitual(this, testRitual, player)) {
            player.addChatMessage(new ChatComponentTranslation("message.masterstone.ritualresistyou"));
            return;
        } else {
            int drain = SoulNetworkHandler.syphonFromNetwork(eventOwnerKey, Rituals.getCostForActivation(testRitual));
            if (drain > 0) {
                player.addChatMessage(new ChatComponentTranslation("message.masterstone.energyflows"));
                for (int i = 0; i < 12; i++) {
                    SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord);
                }
            } else {
                player.addChatMessage(new ChatComponentTranslation("message.masterstone.somethingstoppedyou"));
                return;
            }
        }
    }
    if (!this.currentRitualString.equals("")) {
        Rituals.onRitualBroken(this, this.currentRitualString, RitualBreakMethod.ACTIVATE);
    }
    this.setOwner(eventOwnerKey);
    cooldown = Rituals.getInitialCooldown(testRitual);
    var1 = 0;
    currentRitualString = testRitual;
    storage = Rituals.getLocalStorage(currentRitualString);
    storage.setLocation(new Int3(xCoord, yCoord, zCoord));
    isActive = true;
    isRunning = true;
    direction = Rituals.getDirectionOfRitual(world, xCoord, yCoord, zCoord, testRitual);
    worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) Int3(WayofTime.alchemicalWizardry.api.Int3) RitualActivatedEvent(WayofTime.alchemicalWizardry.api.event.RitualActivatedEvent)

Example 88 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project BloodMagic by WayofTime.

the class TEAltar method sendMoreChatInfoToPlayer.

public void sendMoreChatInfoToPlayer(EntityPlayer player) {
    if (getStackInSlot(0) != null) {
        int stackSize = getStackInSlot(0).stackSize;
        player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.progress") + " " + progress + "LP/" + liquidRequired * stackSize + "LP"));
        player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.consumptionrate") + " " + (int) (consumptionRate * (1 + consumptionMultiplier)) + "LP/t"));
    }
    player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currentessence"), this.fluid.amount));
    player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.inputtank"), this.fluidInput.amount));
    player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.outputtank"), this.fluidOutput.amount));
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 89 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project BloodMagic by WayofTime.

the class ItemDestinationClearer method onItemRightClick.

@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
    if (world.isRemote) {
        return itemStack;
    }
    MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
    if (movingobjectposition == null) {
        return itemStack;
    } else {
        if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
            int x = movingobjectposition.blockX;
            int y = movingobjectposition.blockY;
            int z = movingobjectposition.blockZ;
            TileEntity tile = world.getTileEntity(x, y, z);
            if (!(tile instanceof TEReagentConduit)) {
                return itemStack;
            }
            TEReagentConduit relay = (TEReagentConduit) tile;
            relay.reagentTargetList.clear();
            player.addChatComponentMessage(new ChatComponentTranslation("message.destinationclearer.cleared"));
        }
    }
    return itemStack;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) MovingObjectPosition(net.minecraft.util.MovingObjectPosition) ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) TEReagentConduit(WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit)

Aggregations

ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)89 ItemStack (net.minecraft.item.ItemStack)21 TileEntity (net.minecraft.tileentity.TileEntity)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)14 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)11 ChatComponentText (net.minecraft.util.ChatComponentText)6 ArrayList (java.util.ArrayList)5 Block (net.minecraft.block.Block)4 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)4 World (net.minecraft.world.World)4 Item1N4148 (club.nsdn.nyasamarailway.item.tool.Item1N4148)3 ItemNTP32Bit (club.nsdn.nyasamarailway.item.tool.ItemNTP32Bit)3 ItemNTP8Bit (club.nsdn.nyasamarailway.item.tool.ItemNTP8Bit)3 TileEntityActuator (club.nsdn.nyasamatelecom.api.tileentity.TileEntityActuator)3 BufferedImage (java.awt.image.BufferedImage)3 IChatComponent (net.minecraft.util.IChatComponent)3 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)3 Int3 (WayofTime.alchemicalWizardry.api.Int3)2 TEReagentConduit (WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit)2 TrainPacket (club.nsdn.nyasamarailway.network.TrainPacket)2