use of net.minecraftforge.fml.relauncher.SideOnly in project GregTech by GregTechCE.
the class SimpleSidedRenderer method registerSprites.
@SideOnly(Side.CLIENT)
public void registerSprites(TextureMap textureMap) {
this.sprites = new HashMap<>();
for (RenderSide overlayFace : RenderSide.values()) {
String faceName = overlayFace.name().toLowerCase();
ResourceLocation resourceLocation = new ResourceLocation(GTValues.MODID, String.format("blocks/%s/%s", basePath, faceName));
sprites.put(overlayFace, textureMap.registerSprite(resourceLocation));
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project GregTech by GregTechCE.
the class GTUtility method addPotionTooltip.
/**
* Adds potion tooltip into given lines list
*
* @param potions potion effects to add to tooltip
* @param lines description lines
*/
@SideOnly(Side.CLIENT)
public static void addPotionTooltip(Iterable<PotionEffect> potions, List<String> lines) {
ArrayList<Tuple<String, AttributeModifier>> attributeLines = new ArrayList<>();
for (PotionEffect potionEffect : potions) {
String line = I18n.format(potionEffect.getEffectName());
Potion potion = potionEffect.getPotion();
Map<IAttribute, AttributeModifier> attributes = potionEffect.getPotion().getAttributeModifierMap();
if (!attributes.isEmpty()) {
for (Map.Entry<IAttribute, AttributeModifier> entry : attributes.entrySet()) {
AttributeModifier modifier = entry.getValue();
attributeLines.add(new Tuple<>(entry.getKey().getName(), new AttributeModifier(modifier.getName(), potion.getAttributeModifierAmount(potionEffect.getAmplifier(), modifier), modifier.getOperation())));
}
}
if (potionEffect.getAmplifier() > 0) {
line = line + " " + I18n.format("potion.potency." + potionEffect.getAmplifier());
}
if (potionEffect.getDuration() > 20) {
line = line + " (" + Potion.getPotionDurationString(potionEffect, 1.0f) + ")";
}
if (potion.isBadEffect()) {
lines.add(TextFormatting.RED + line);
} else {
lines.add(TextFormatting.BLUE + line);
}
}
if (!attributeLines.isEmpty()) {
lines.add("");
lines.add(TextFormatting.DARK_PURPLE + I18n.format("potion.whenDrank"));
for (Tuple<String, AttributeModifier> tuple : attributeLines) {
AttributeModifier modifier = tuple.getSecond();
double d0 = modifier.getAmount();
double d1;
if (modifier.getOperation() != 1 && modifier.getOperation() != 2) {
d1 = modifier.getAmount();
} else {
d1 = modifier.getAmount() * 100.0D;
}
if (d0 > 0.0D) {
lines.add(TextFormatting.BLUE + I18n.format("attribute.modifier.plus." + modifier.getOperation(), ItemStack.DECIMALFORMAT.format(d1), I18n.format("attribute.name." + tuple.getFirst())));
} else if (d0 < 0.0D) {
d1 = d1 * -1.0D;
lines.add(TextFormatting.RED + I18n.format("attribute.modifier.take." + modifier.getOperation(), ItemStack.DECIMALFORMAT.format(d1), I18n.format("attribute.name." + tuple.getFirst())));
}
}
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project GregTech by GregTechCE.
the class OreItemBlock method getItemStackDisplayName.
@Override
@SideOnly(Side.CLIENT)
public String getItemStackDisplayName(ItemStack stack) {
IBlockState blockState = getBlockState(stack);
boolean small = blockState.getValue(BlockOre.SMALL);
if (small) {
return OrePrefix.oreSmall.getLocalNameForItem(block.material);
} else {
StoneType stoneType = blockState.getValue(block.STONE_TYPE);
return stoneType.processingPrefix.getLocalNameForItem(block.material);
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project Gaia-Dimension by Andromander.
the class GDCrystalGrowth method registerModel.
@SideOnly(Side.CLIENT)
@Override
public void registerModel() {
for (int i = 0; i < CrystalGrowthVariant.values().length; i++) {
String variant = "inventory_" + CrystalGrowthVariant.values()[i].getName();
ModelResourceLocation mrl = new ModelResourceLocation(getRegistryName(), variant);
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), i, mrl);
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.
the class BlockReinforcedNewLog method getSubBlocks.
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
list.add(new ItemStack(this, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4));
list.add(new ItemStack(this, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4));
}
Aggregations