diff --git a/src/main/java/de/ellpeck/naturesaura/compat/BaublesCompat.java b/src/main/java/de/ellpeck/naturesaura/compat/BaublesCompat.java index cbe91c6d..3247cffb 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/BaublesCompat.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/BaublesCompat.java @@ -52,13 +52,13 @@ public class BaublesCompat { @SubscribeEvent public void onCapabilitiesAttach(AttachCapabilitiesEvent event) { Item item = event.getObject().getItem(); - if (item == ModItems.EYE) { + if (item == ModItems.EYE || item == ModItems.EYE_IMPROVED) this.addCap(event, this.eye); - } else if (item == ModItems.AURA_CACHE) { + else if (item == ModItems.AURA_CACHE) this.addCap(event, this.cache); - } else if (item == ModItems.SHOCKWAVE_CREATOR) { + else if (item == ModItems.SHOCKWAVE_CREATOR) this.addCap(event, this.shockwaveCreator); - } + } private void addCap(AttachCapabilitiesEvent event, IBauble type) { diff --git a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java index 14c74599..e2a94cc4 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java @@ -181,6 +181,7 @@ public class ClientEvents { if (mc.player != null) { ItemStack cache = ItemStack.EMPTY; ItemStack eye = ItemStack.EMPTY; + ItemStack eyeImproved = ItemStack.EMPTY; if (Compat.baubles) { IItemHandler baubles = BaublesApi.getBaublesHandler(mc.player); @@ -191,19 +192,21 @@ public class ClientEvents { cache = slot; else if (slot.getItem() == ModItems.EYE) eye = slot; + else if (slot.getItem() == ModItems.EYE_IMPROVED) + eyeImproved = slot; } } } - if (cache.isEmpty() || eye.isEmpty()) { - for (int i = 0; i < mc.player.inventory.getSizeInventory(); i++) { - ItemStack slot = mc.player.inventory.getStackInSlot(i); - if (!slot.isEmpty()) { - if (slot.getItem() == ModItems.AURA_CACHE) - cache = slot; - else if (slot.getItem() == ModItems.EYE && i <= 8) - eye = slot; - } + for (int i = 0; i < mc.player.inventory.getSizeInventory(); i++) { + ItemStack slot = mc.player.inventory.getStackInSlot(i); + if (!slot.isEmpty()) { + if (slot.getItem() == ModItems.AURA_CACHE) + cache = slot; + else if (slot.getItem() == ModItems.EYE && i <= 8) + eye = slot; + else if (slot.getItem() == ModItems.EYE_IMPROVED) + eyeImproved = slot; } } @@ -232,7 +235,7 @@ public class ClientEvents { GlStateManager.popMatrix(); } - if (!eye.isEmpty()) { + if (!eye.isEmpty() || !eyeImproved.isEmpty()) { GlStateManager.pushMatrix(); mc.getTextureManager().bindTexture(OVERLAYS); @@ -243,15 +246,33 @@ public class ClientEvents { float totalPercentage = totalAmount / (IAuraChunk.DEFAULT_AURA * 2F); int tHeight = MathHelper.ceil(MathHelper.clamp(totalPercentage, 0F, 1F) * 50); + int y = eyeImproved.isEmpty() ? 10 : 36; if (tHeight < 50) - Gui.drawModalRectWithCustomSizedTexture(3, 10, 6, 12, 6, 50 - tHeight, 256, 256); + Gui.drawModalRectWithCustomSizedTexture(3, y, 6, 12, 6, 50 - tHeight, 256, 256); if (tHeight > 0) - Gui.drawModalRectWithCustomSizedTexture(3, 10 + 50 - tHeight, 0, 12 + 50 - tHeight, 6, tHeight, 256, 256); + Gui.drawModalRectWithCustomSizedTexture(3, y + 50 - tHeight, 0, 12 + 50 - tHeight, 6, tHeight, 256, 256); - if (totalPercentage > 1F) - mc.fontRenderer.drawString("+", 10F, 9.5F, 0x53a008, true); - if (totalPercentage < 0F) - mc.fontRenderer.drawString("-", 10F, 53.5F, 0x53a008, true); + if (!eyeImproved.isEmpty()) { + GlStateManager.color(160 / 255F, 83 / 255F, 8 / 255F); + + int topHeight = MathHelper.ceil(MathHelper.clamp((totalPercentage - 1F) * 2F, 0F, 1F) * 25); + if (topHeight < 25) + Gui.drawModalRectWithCustomSizedTexture(3, 10, 18, 12, 6, 25 - topHeight, 256, 256); + if (topHeight > 0) + Gui.drawModalRectWithCustomSizedTexture(3, 10 + 25 - topHeight, 12, 12 + 25 - topHeight, 6, topHeight, 256, 256); + + int bottomHeight = MathHelper.ceil(MathHelper.clamp((totalPercentage + 1F) * 2F - 1F, 0F, 1F) * 25); + if (bottomHeight < 25) + Gui.drawModalRectWithCustomSizedTexture(3, 87, 18, 12, 6, 25 - bottomHeight, 256, 256); + if (bottomHeight > 0) + Gui.drawModalRectWithCustomSizedTexture(3, 87 + 25 - bottomHeight, 12, 12 + 25 - bottomHeight, 6, bottomHeight, 256, 256); + } + + int color = eyeImproved.isEmpty() ? 0x53a008 : 0xa05308; + if (totalPercentage > (eyeImproved.isEmpty() ? 1F : 1.5F)) + mc.fontRenderer.drawString("+", 10F, 9.5F, color, true); + if (totalPercentage < (eyeImproved.isEmpty() ? 0F : -0.5F)) + mc.fontRenderer.drawString("-", 10F, eyeImproved.isEmpty() ? 53.5F : 105.5F, color, true); GlStateManager.pushMatrix(); float scale = 0.75F; diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemEye.java b/src/main/java/de/ellpeck/naturesaura/items/ItemEye.java index c0720035..796bda15 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemEye.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemEye.java @@ -11,8 +11,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class ItemEye extends ItemImpl implements ITrinketItem { - public ItemEye() { - super("eye"); + public ItemEye(String name) { + super(name); this.setMaxStackSize(1); } diff --git a/src/main/java/de/ellpeck/naturesaura/items/ModItems.java b/src/main/java/de/ellpeck/naturesaura/items/ModItems.java index fe011baf..d962b613 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ModItems.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ModItems.java @@ -26,7 +26,8 @@ public final class ModItems { public static final Item INFUSED_PANTS = new ItemArmorNA("infused_iron_pants", ARMOR_INFUSED, EntityEquipmentSlot.LEGS); public static final Item INFUSED_SHOES = new ItemArmorNA("infused_iron_shoes", ARMOR_INFUSED, EntityEquipmentSlot.FEET); - public static final Item EYE = new ItemEye(); + public static final Item EYE = new ItemEye("eye"); + public static final Item EYE_IMPROVED = new ItemEye("eye_improved"); public static final Item GOLD_FIBER = new ItemGoldFiber(); public static final Item GOLD_LEAF = new ItemImpl("gold_leaf"); public static final Item INFUSED_IRON = new ItemImpl("infused_iron"); diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java index 231de24e..269653e2 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java @@ -34,6 +34,14 @@ public final class ModRecipes { Ingredient.fromItem(Items.GOLD_INGOT), Ingredient.fromItem(ModItems.GOLD_LEAF), Ingredient.fromItem(ModItems.GOLD_LEAF)).register(); + new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "eye_improved"), + Ingredient.fromStacks(new ItemStack(Blocks.SAPLING)), new ItemStack(ModItems.EYE_IMPROVED), 500, + Ingredient.fromItem(ModItems.EYE), + Ingredient.fromItem(ModItems.SKY_INGOT), + Ingredient.fromItem(ModItems.SKY_INGOT), + Helper.blockIng(ModBlocks.END_FLOWER), + Ingredient.fromItem(ModItems.GOLD_LEAF), + Ingredient.fromItem(ModItems.GOLD_LEAF)).register(); new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "nature_altar"), Helper.blockIng(Blocks.SAPLING), new ItemStack(ModBlocks.NATURE_ALTAR), 500, Helper.blockIng(Blocks.STONE), diff --git a/src/main/resources/assets/naturesaura/lang/en_US.lang b/src/main/resources/assets/naturesaura/lang/en_US.lang index c01e6682..1c4b2a0d 100644 --- a/src/main/resources/assets/naturesaura/lang/en_US.lang +++ b/src/main/resources/assets/naturesaura/lang/en_US.lang @@ -38,6 +38,7 @@ tile.naturesaura.animal_generator.name=Disentangler of Mortals tile.naturesaura.end_flower.name=Rose of Oblivion item.naturesaura.eye.name=Environmental Eye +item.naturesaura.eye_improved.name=Environmental Ocular item.naturesaura.gold_fiber.name=Brilliant Fiber item.naturesaura.gold_leaf.name=Gold Leaf item.naturesaura.infused_iron.name=Infused Iron diff --git a/src/main/resources/assets/naturesaura/models/item/eye_improved.json b/src/main/resources/assets/naturesaura/models/item/eye_improved.json new file mode 100644 index 00000000..8d587acb --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/item/eye_improved.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:items/eye_improved" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/items/eye_improved.json b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/items/eye_improved.json new file mode 100644 index 00000000..8157605b --- /dev/null +++ b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/items/eye_improved.json @@ -0,0 +1,21 @@ +{ + "name": "Environmental Ocular", + "icon": "naturesaura:eye_improved", + "category": "items", + "advancement": "naturesaura:end_flower", + "pages": [ + { + "type": "text", + "text": "The $(l:items/eye)Environmental Eye$() is very useful in theory; however, a lot of magical botanists struggle with its limited range of gauging $(aura) in the environment around them. A simple solution to this probem is the $(item)Environmental Ocular$().$(br)While working similarly to the $(item)Environmental Eye$(), the main difference is its much bigger gauge for $(aura) in the area: It is $(thing)twice as large$()." + }, + { + "type": "text", + "text": "An additional perk is that, while the $(item)Environmental Eye$() needs to be held in the hotbar, the $(item)Environmental Ocular$() can be anywhere in the user's inventory to work.$(p)It should be noted that all of the features of the $(item)Environmental Eye$() that were not mentioned also carry over to the $(item)Environmental Ocular$()." + }, + { + "type": "naturesaura:tree_ritual", + "text": "Creating the $(item)Environmental Ocular$() using the $(l:practices/tree_ritual)Ritual of the Forest$()", + "recipe": "naturesaura:eye_improved" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/textures/gui/overlays.png b/src/main/resources/assets/naturesaura/textures/gui/overlays.png index 5b6bdd2b..a93eac7c 100644 Binary files a/src/main/resources/assets/naturesaura/textures/gui/overlays.png and b/src/main/resources/assets/naturesaura/textures/gui/overlays.png differ diff --git a/src/main/resources/assets/naturesaura/textures/items/eye_improved.png b/src/main/resources/assets/naturesaura/textures/items/eye_improved.png new file mode 100644 index 00000000..874f3cc5 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/items/eye_improved.png differ