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