use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.
the class ChatUtils method sendClientNoSpamMessages.
//Credit goes to WayOfFlowingTime
@SideOnly(Side.CLIENT)
public static void sendClientNoSpamMessages(ITextComponent[] messages) {
GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
for (int i = DELETION_ID + messages.length - 1; i <= lastAdded; i++) chat.deleteChatLine(i);
for (int i = 0; i < messages.length; i++) chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
lastAdded = DELETION_ID + messages.length - 1;
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.
the class ItemJerrycan method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
FluidStack fs = FluidUtil.getFluidContained(stack);
if (fs != null) {
TextFormatting rarity = fs.getFluid().getRarity() == EnumRarity.COMMON ? TextFormatting.GRAY : fs.getFluid().getRarity().rarityColor;
list.add(rarity + fs.getLocalizedName() + TextFormatting.GRAY + ": " + fs.amount + "/" + 10000 + "mB");
} else
list.add(I18n.format(Lib.DESC_FLAVOUR + "drill.empty"));
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.
the class ItemCoresample method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
if (ItemNBTHelper.hasKey(stack, "coords")) {
if (ItemNBTHelper.hasKey(stack, "mineral")) {
String mineral = ItemNBTHelper.getString(stack, "mineral");
String unloc = Lib.DESC_INFO + "mineral." + mineral;
String loc = I18n.format(unloc);
list.add(I18n.format(Lib.CHAT_INFO + "coresample.mineral", (unloc.equals(loc) ? mineral : loc)));
} else
list.add(I18n.format(Lib.CHAT_INFO + "coresample.noMineral"));
int[] coords = ItemNBTHelper.getIntArray(stack, "coords");
World world = DimensionManager.getWorld(coords[0]);
String s0 = (coords[1] * 16) + ", " + (coords[2] * 16);
String s1 = (coords[1] * 16 + 16) + ", " + (coords[2] * 16 + 16);
String s2;
if (world != null && world.provider != null) {
String name = world.provider.getDimensionType().getName();
if (name.toLowerCase(Locale.ENGLISH).startsWith("the "))
name = name.substring(4);
s2 = name;
} else
s2 = "Dimension " + coords[0];
list.add(s2);
list.add(I18n.format(Lib.CHAT_INFO + "coresample.pos", s0, s1, ""));
if (ItemNBTHelper.hasKey(stack, "infinite"))
list.add(I18n.format(Lib.CHAT_INFO + "coresample.infinite"));
else if (ItemNBTHelper.hasKey(stack, "depletion"))
list.add(I18n.format(Lib.CHAT_INFO + "coresample.yield", ExcavatorHandler.mineralVeinCapacity - ItemNBTHelper.getInt(stack, "depletion")));
if (ItemNBTHelper.hasKey(stack, "timestamp") && world != null) {
long timestamp = ItemNBTHelper.getLong(stack, "timestamp");
long dist = world.getTotalWorldTime() - timestamp;
if (dist < 0)
list.add("Somehow this sample is dated in the future...are you a time traveller?!");
else
list.add(I18n.format(Lib.CHAT_INFO + "coresample.timestamp", ClientUtils.fomatTimestamp(dist, ClientUtils.TimestampFormat.DHM)));
} else
list.add(I18n.format(Lib.CHAT_INFO + "coresample.noTimestamp"));
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.
the class ItemDrill method applyTransformations.
@SideOnly(Side.CLIENT)
@Override
public Optional<TRSRTransformation> applyTransformations(ItemStack stack, String group, Optional<TRSRTransformation> transform) {
if (transform.isPresent()) {
NBTTagCompound upgrades = this.getUpgrades(stack);
if (group.equals("drill_head") && upgrades.getInteger("damage") <= 0) {
Matrix4 mat = new Matrix4(transform.get().getMatrix());
mat.translate(-.25f, 0, 0);
return Optional.of(new TRSRTransformation(mat.toMatrix4f()));
}
if (group.equals("upgrade_damage1") || group.equals("upgrade_damage2") || group.equals("upgrade_damage3") || group.equals("upgrade_damage4")) {
Matrix4 mat = new Matrix4(transform.get().getMatrix());
mat.translate(.441f, 0, 0);
return Optional.of(new TRSRTransformation(mat.toMatrix4f()));
}
}
return transform;
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ImmersiveEngineering by BluSunrize.
the class ItemBullet method addInformation.
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
if (stack.getItemDamage() == 2) {
String key = ItemNBTHelper.getString(stack, "bullet");
IBullet bullet = BulletHandler.getBullet(key);
if (bullet != null)
bullet.addTooltip(stack, player, list, advanced);
}
}
Aggregations