use of net.minecraftforge.fml.relauncher.SideOnly in project AgriCraft by AgriCraft.
the class ItemBlockCustomWood method addInformation.
/**
* Retrieves the block's displayable information. This method does not need to be overridden by
* most CustomWood blocks.
* <p>
* If the block name is not displaying correctly, check the language files and
* Names.Objects.[blockname]. If that does not correct the issue, ensure that the block
* overrides both getInternalName() and getTileEntityName() and returns
* Names.Objects.[blockname].
* </p>
* <p>
* All custom WOOD blocks have a MATERIAL that we want shown, so we make this method final. Some
* however, has more information they want to add, so we add a addMore() method to OVERRIDE in
* that event.
* </p>
*
* @param stack
* @param world
* @param tooltip
* @param flag
*/
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag) {
ItemStack material;
if (stack.getItemDamage() == 0 && stack.hasTagCompound() && stack.getTagCompound().hasKey(AgriNBT.MATERIAL) && stack.getTagCompound().hasKey(AgriNBT.MATERIAL_META)) {
NBTTagCompound tag = stack.getTagCompound();
String name = tag.getString(AgriNBT.MATERIAL);
int meta = tag.getInteger(AgriNBT.MATERIAL_META);
material = new ItemStack(Block.getBlockFromName(name), 1, meta);
} else {
material = new ItemStack(Blocks.PLANKS);
}
tooltip.add(AgriCore.getTranslator().translate("agricraft_tooltip.material") + ": " + material.getItem().getItemStackDisplayName(material));
}
use of net.minecraftforge.fml.relauncher.SideOnly in project AgriCraft by AgriCraft.
the class TileEntitySprinkler method spawnLiquidSpray.
@SideOnly(Side.CLIENT)
private void spawnLiquidSpray(double xOffset, double zOffset, Vec3d vector) {
LiquidSprayFX liquidSpray = new LiquidSprayFX(this.getWorld(), this.xCoord() + 0.5F + xOffset, this.yCoord() + 8 * Constants.UNIT, this.zCoord() + 0.5F + zOffset, 0.3F, 0.7F, vector);
Minecraft.getMinecraft().effectRenderer.addEffect(liquidSpray);
}
use of net.minecraftforge.fml.relauncher.SideOnly in project AgriCraft by AgriCraft.
the class TileEntitySprinkler method renderLiquidSpray.
@SideOnly(Side.CLIENT)
private void renderLiquidSpray() {
if (AgriCraftConfig.disableParticles) {
return;
}
this.angle = (this.angle + 5F) % 360;
// 0 = all, 1 = decreased; 2 = minimal;
int particleSetting = Minecraft.getMinecraft().gameSettings.particleSetting;
counter = (counter + 1) % (particleSetting + 1);
if (counter == 0) {
for (int i = 0; i < 4; i++) {
float alpha = -(this.angle + 90 * i) * ((float) Math.PI) / 180;
double xOffset = (4 * Constants.UNIT) * Math.cos(alpha);
double zOffset = (4 * Constants.UNIT) * Math.sin(alpha);
float radius = 0.3F;
for (int j = 0; j <= 4; j++) {
float beta = -j * ((float) Math.PI) / (8.0F);
Vec3d vector = new Vec3d(radius * Math.cos(alpha), radius * Math.sin(beta), radius * Math.sin(alpha));
this.spawnLiquidSpray(xOffset * (4 - j) / 4, zOffset * (4 - j) / 4, vector);
}
}
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project BetterWithAddons by DaedalusGame.
the class AssortedHandler method onToolTip.
@SubscribeEvent(priority = EventPriority.HIGHEST)
@SideOnly(Side.CLIENT)
public void onToolTip(ItemTooltipEvent event) {
ItemStack stack = event.getItemStack();
if (stack.getItem() == Items.ENCHANTED_BOOK && InteractionBWM.HIDDEN_ENCHANTS) {
event.getToolTip().clear();
event.getToolTip().add(TextFormatting.WHITE + I18n.format("item.ancient_manuscript.name"));
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project BetterWithAddons by DaedalusGame.
the class RenewablesHandler method renderQuartzTooltip.
@SubscribeEvent(priority = EventPriority.HIGH)
@SideOnly(Side.CLIENT)
public void renderQuartzTooltip(ItemTooltipEvent event) {
ItemStack stack = event.getItemStack();
if (stack == null)
return;
NBTTagCompound compound = stack.getTagCompound();
if (!stack.isEmpty() && compound != null && compound.hasKey("QuartzCrystal")) {
int growth = compound.getInteger("QuartzCrystalGrowth");
int souls = compound.getInteger("QuartzSouls");
event.getToolTip().add(TextFormatting.LIGHT_PURPLE + getSaturationString(growth, false));
if (souls > 0)
event.getToolTip().add(TextFormatting.DARK_RED + getSoulString(souls, 27, false));
}
}
Aggregations