Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public enum ModItems {
PRECISION_SHEARS(PrecisionShearsConfig.enable, new ItemPrecisionShears(), "precision_shears"),
ETHERIC_SWORD(EthericSwordConfig.enable, new ItemEthericSword(), "etheric_sword"),
REVERSING_HOE(ReversingHoeConfig.enable, new ItemReversingHoe(), "reversing_hoe"),
HEAVENLY_RING(ItemConfig.enableHeavenlyRing, new ItemHeavenlyRing(), "heavenly_ring"),
HEAVENLY_RING_FEATHER(ItemConfig.enableHeavenlyRing, new ItemHeavenlyRing("feather", 8), "heavenly_ring_feather"),
HEAVENLY_RING_DRAGON(ItemConfig.enableHeavenlyRing, new ItemHeavenlyRing("dragon", 8), "heavenly_ring_dragon"),
HEAVENLY_RING_FAIRY(ItemConfig.enableHeavenlyRing, new ItemHeavenlyRing("fairy", 8), "heavenly_ring_fairy"),
HEAVENLY_RING_METAL(ItemConfig.enableHeavenlyRing, new ItemHeavenlyRing("metal", 8), "heavenly_ring_metal"),
HEAVENLY_RING_MAGIC(ItemConfig.enableHeavenlyRing, new ItemHeavenlyRing("magic", 8), "heavenly_ring_magic"),
MOB_JAR(ItemConfig.enableMobJar, new ItemMobJar(), "mob_jar"),
WATERING_CAN_BASIC(WateringCanConfig.wateringCan.Tier.enableWateringCanBasic, new ItemWateringCan(1,3), "watering_can_basic"),
WATERING_CAN_ADVANCED(WateringCanConfig.wateringCan.Tier.enableWateringCanAdvanced, new ItemWateringCan(2,5), "watering_can_advanced"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ public static void IMCSender() {
"nei.infopage.uie.watering_can.1");

if (Mods.Baubles.isLoaded()) {
sendInfoPage("<utilitiesinexcess:heavenly_ring>", "nei.infopage.uie.heavenly_ring.2");
sendInfoPage(
"<utilitiesinexcess:heavenly_ring_feather>,<utilitiesinexcess:heavenly_ring_dragon>,<utilitiesinexcess:heavenly_ring_fairy>,<utilitiesinexcess:heavenly_ring_metal>,<utilitiesinexcess:heavenly_ring_magic>",
"nei.infopage.uie.heavenly_ring.2");
} else {
sendInfoPage("<utilitiesinexcess:heavenly_ring>", "nei.infopage.uie.heavenly_ring.1");
sendInfoPage(
"<utilitiesinexcess:heavenly_ring_feather>,<utilitiesinexcess:heavenly_ring_dragon>,<utilitiesinexcess:heavenly_ring_fairy>,<utilitiesinexcess:heavenly_ring_metal>,<utilitiesinexcess:heavenly_ring_magic>",
"nei.infopage.uie.heavenly_ring.1");
}

sendInfoPage("<utilitiesinexcess:trash_can_item>", "nei.infopage.uie.trash_can_item.1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import java.util.Map;

import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.common.util.FakePlayer;

Expand All @@ -33,48 +34,56 @@
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles")
public class ItemHeavenlyRing extends Item implements IBauble {

private static final int RING_COUNT = 5;
private final int RING_COUNT;
private final String SUFFIX;

private static IIcon[] itemIcons = new IIcon[RING_COUNT];
public static IIcon[] wingIcons = new IIcon[RING_COUNT];
public final IIcon[] wingIcons;

public ItemHeavenlyRing() {
setTextureName("utilitiesinexcess:heavenly_ring");
setUnlocalizedName("heavenly_ring");
public ItemHeavenlyRing(String suffix, int variants) {
RING_COUNT = variants;
SUFFIX = suffix;

wingIcons = new IIcon[RING_COUNT];

setTextureName("utilitiesinexcess:heavenly_ring_" + suffix);
setUnlocalizedName("heavenly_ring_" + suffix);
setMaxDamage(0);
setHasSubtypes(true);
setMaxStackSize(1);
}

@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> itemList) {
for (int i = 0; i < RING_COUNT; ++i) {
itemList.add(new ItemStack(item, 1, i));
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
int meta = stack.getItemDamage();
if (meta == RING_COUNT - 1) {
stack.setItemDamage(0);
} else {
stack.setItemDamage(meta + 1);
}
if (world.isRemote) {
player.addChatMessage(
new ChatComponentTranslation(
"chat.heavenly_ring_modify",
StatCollector.translateToLocal("item.heavenly_ring_" + SUFFIX + ".type." + stack.getItemDamage())));
}
return super.onItemRightClick(stack, world, player);
}

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
for (int i = 0; i < RING_COUNT; ++i) {
itemIcons[i] = register.registerIcon(this.getIconString() + "." + i);
wingIcons[i] = register.registerIcon(this.getIconString() + ".wing." + i);
}
this.itemIcon = itemIcons[0];
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
return itemIcons[meta];
super.registerIcons(register);
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean p_77624_4_) {
tooltip.add(
EnumChatFormatting.GRAY
+ StatCollector.translateToLocal("item.heavenly_ring.type." + stack.getItemDamage()));
+ StatCollector.translateToLocal("item.heavenly_ring_" + SUFFIX + ".type." + stack.getItemDamage()));
tooltip.add(StatCollector.translateToLocal("item.heavenly_ring.desc"));
super.addInformation(stack, player, tooltip, p_77624_4_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;

Expand Down Expand Up @@ -120,16 +121,74 @@ public static void run() {
'o',
Blocks.obsidian);

// Heavenly Ring
// Heavenly Rings
addShapedRecipe(
ModItems.HEAVENLY_RING,
ModItems.HEAVENLY_RING_FEATHER,
"#f#",
"f*f",
"ifi",
'#',
Blocks.glass,
'f',
Items.feather,
'*',
Items.nether_star,
'i',
ModItems.INVERTED_INGOT.newItemStack(1, OreDictionary.WILDCARD_VALUE));
addShapedRecipe(
ModItems.HEAVENLY_RING_DRAGON,
"#b#",
"b*b",
"ibi",
'#',
Blocks.glass,
'b',
Items.blaze_powder,
'*',
Items.nether_star,
'i',
ModItems.INVERTED_INGOT.newItemStack(1, OreDictionary.WILDCARD_VALUE));
addShapedRecipe(
ModItems.HEAVENLY_RING_FAIRY,
"#d#",
"p*p",
"idi",
'#',
Blocks.glass,
'd',
Blocks.yellow_flower,
'p',
new ItemStack(ItemBlock.getItemFromBlock(Blocks.red_flower), 1, 0),
'*',
Items.nether_star,
'i',
ModItems.INVERTED_INGOT.newItemStack(1, OreDictionary.WILDCARD_VALUE));
addShapedRecipe(
ModItems.HEAVENLY_RING_METAL,
"#g#",
"g*g",
"t*t",
"igi",
'#',
Blocks.glass,
'g',
Items.gold_ingot,
't',
Items.iron_ingot,
'*',
Items.nether_star,
'i',
ModItems.INVERTED_INGOT.newItemStack(1, OreDictionary.WILDCARD_VALUE));
addShapedRecipe(
ModItems.HEAVENLY_RING_MAGIC,
"#g#",
"r*r",
"igi",
'#',
Blocks.glass,
'g',
Items.glowstone_dust,
'r',
Items.redstone,
'*',
Items.nether_star,
'i',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static float getNextAngle(float curAngle, boolean isFlying) {
return UIEUtils.lerp(curAngle, (float) ((Math.sin(time * 0.001 * speed) + 1) * max), 0.1F);
}

public static void render(int meta, float angle) {
public static void render(ItemHeavenlyRing ring, int meta, float angle) {
Tessellator t = Tessellator.instance;

int boundTexIndex = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
Expand All @@ -48,7 +48,7 @@ public static void render(int meta, float angle) {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

IIcon icon = ItemHeavenlyRing.wingIcons[meta];
IIcon icon = ring.wingIcons[meta];

// Derive scale
float scaleX = icon.getIconWidth() / 16.0F;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.fouristhenumber.utilitiesinexcess.mixins.early.minecraft;

import java.util.Objects;

import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -74,15 +76,16 @@ public class MixinModelBiped_Baubles {
if (ring == null) {
ring = UIEUtils.getBauble(player, ItemHeavenlyRing.class);
}
// meta 4 is the invisible ring, no rendering
if (ring != null && ring.getItemDamage() != 4) {
if (ring != null) {
final ItemStack finalRing = ring;
uie$heavenlyRingWing = HeavenlyRingRenderer
.getNextAngle(uie$heavenlyRingWing, player.capabilities.isFlying);
ModelPartRenderHelper.renderBipedPart(
p_78088_7_,
thisObject.bipedBody,
() -> { HeavenlyRingRenderer.render(finalRing.getItemDamage(), uie$heavenlyRingWing); });
ModelPartRenderHelper.renderBipedPart(p_78088_7_, thisObject.bipedBody, () -> {
HeavenlyRingRenderer.render(
(ItemHeavenlyRing) Objects.requireNonNull(finalRing.getItem()),
finalRing.getItemDamage(),
uie$heavenlyRingWing);
});
}
}
}
62 changes: 54 additions & 8 deletions src/main/resources/assets/utilitiesinexcess/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,60 @@ nei.infopage.uie.iron_spike.1=Iron spikes will kill enemies that walk on them, d
nei.infopage.uie.gold_spike.1=Gold spikes will kill enemies that walk on them, dropping their experience and non-"player-only" loot.
nei.infopage.uie.diamond_spike.1=Diamond spikes will kill enemies that walk on them, dropping experience and "player-only" loot.

item.heavenly_ring.name=Heavenly Ring
nei.infopage.uie.heavenly_ring.1=Grants the bearer the power of creative flight while in the inventory.
nei.infopage.uie.heavenly_ring.2=Grants the bearer the power of creative flight while equipped in a baubles slot.
item.heavenly_ring.type.0=Angelic
item.heavenly_ring.type.1=Demonic
item.heavenly_ring.type.2=Fae
item.heavenly_ring.type.3=Metallic
item.heavenly_ring.type.4=Invisible
item.heavenly_ring_feather.name=Heavenly Ring (Feathered)
item.heavenly_ring_dragon.name=Heavenly Ring (Draconic)
item.heavenly_ring_fairy.name=Heavenly Ring (Fairy)
item.heavenly_ring_metal.name=Heavenly Ring (Metallic)
item.heavenly_ring_magic.name=Heavenly Ring (Magical)
item.heavenly_ring.desc=Use in hand to cycle through different appearances.
nei.infopage.uie.heavenly_ring.1=Grants the bearer the power of creative flight while in the inventory. There are many different wing appearances for each type. Use the item in your hand to cycle between different appearances!
nei.infopage.uie.heavenly_ring.2=Grants the bearer the power of creative flight while equipped in a baubles slot. There are many different wing appearances for each type. Use the item in your hand to cycle between different appearances!

item.heavenly_ring_feather.type.0=Chibi
item.heavenly_ring_feather.type.1=Angelic
item.heavenly_ring_feather.type.2=Storm
item.heavenly_ring_feather.type.3=Phoenix
item.heavenly_ring_feather.type.4=Swan
item.heavenly_ring_feather.type.5=Raven
item.heavenly_ring_feather.type.6=Falcon
item.heavenly_ring_feather.type.7=Macaw

item.heavenly_ring_dragon.type.0=Red
item.heavenly_ring_dragon.type.1=Ebony
item.heavenly_ring_dragon.type.2=Golden
item.heavenly_ring_dragon.type.3=Leviathan
item.heavenly_ring_dragon.type.4=Green
item.heavenly_ring_dragon.type.5=Flower
item.heavenly_ring_dragon.type.6=Purple
item.heavenly_ring_dragon.type.7=Moon

item.heavenly_ring_fairy.type.0=Rainbow
item.heavenly_ring_fairy.type.1=Pixie
item.heavenly_ring_fairy.type.2=Monarch
item.heavenly_ring_fairy.type.3=Lunamoth
item.heavenly_ring_fairy.type.4=Autumn
item.heavenly_ring_fairy.type.5=Blacklight
item.heavenly_ring_fairy.type.6=Jeweled Wasp
item.heavenly_ring_fairy.type.7=Leaf

item.heavenly_ring_magic.type.0=Invisible
item.heavenly_ring_magic.type.1=Ice
item.heavenly_ring_magic.type.2=Fire
item.heavenly_ring_magic.type.3=Lightning
item.heavenly_ring_magic.type.4=End
item.heavenly_ring_magic.type.5=Plasma
item.heavenly_ring_magic.type.6=Crackling
item.heavenly_ring_magic.type.7=Jelly

item.heavenly_ring_metal.type.0=Golden
item.heavenly_ring_metal.type.1=Silver
item.heavenly_ring_metal.type.2=Copper
item.heavenly_ring_metal.type.3=Glass
item.heavenly_ring_metal.type.4=Neonblade
item.heavenly_ring_metal.type.5=Nanotech
item.heavenly_ring_metal.type.6=Mayfly
item.heavenly_ring_metal.type.7=Steampunk
chat.heavenly_ring_modify=Ring appearance is now %s.

item.watering_can_basic.name=Basic Watering Can
item.watering_can_advanced.name=Advanced Watering Can
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading