mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Third Eye.
This commit is contained in:
1 parent
2df0b7995b
commit
508b71a95f
11 files changed
+142
-1
No files matched your search
@@ -72,6 +72,7 @@ public class MiscellaneousIcons {
|
||||
public TextureAtlasSprite[] kingKeyWeaponIcons;
|
||||
public final Map<TriggerManaLevel.State, TextureAtlasSprite> manaLevelTriggerIcons = Maps.newEnumMap(TriggerManaLevel.State.class);
|
||||
public TextureAtlasSprite[] tiaraWingIcons;
|
||||
public TextureAtlasSprite[] thirdEyeLayers;
|
||||
|
||||
// begin dank_memes
|
||||
public TextureAtlasSprite tailIcon = null;
|
||||
@@ -147,6 +148,10 @@ public class MiscellaneousIcons {
|
||||
kingKeyWeaponIcons = new TextureAtlasSprite[ItemKingKey.WEAPON_TYPES];
|
||||
for(int i = 0; i < ItemKingKey.WEAPON_TYPES; i++)
|
||||
kingKeyWeaponIcons[i] = IconHelper.forName(evt.getMap(), "gateWeapon" + i, "items");
|
||||
|
||||
thirdEyeLayers = new TextureAtlasSprite[3];
|
||||
for(int i = 0; i < 3; i++)
|
||||
thirdEyeLayers[i] = IconHelper.forName(evt.getMap(), "thirdEye" + i, "items");
|
||||
|
||||
manaDetectorIcon = IconHelper.forName(evt.getMap(), "triggers/manaDetector", "items");
|
||||
runeAltarTriggerIcon = IconHelper.forName(evt.getMap(), "triggers/runeAltarCanCraft", "items");
|
||||
|
||||
@@ -257,6 +257,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.balanceCloak);
|
||||
addItem(ModItems.goldLaurel);
|
||||
addItem(ModItems.divaCharm);
|
||||
addItem(ModItems.thirdEye);
|
||||
addItem(ModItems.flightTiara);
|
||||
|
||||
addItem(ModItems.manaTablet);
|
||||
|
||||
@@ -64,6 +64,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemSuperCloudPendant;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSuperLavaPendant;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSuperTravelBelt;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSwapRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemThirdEye;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemTravelBelt;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemUnholyCloak;
|
||||
@@ -275,6 +276,7 @@ public final class ModItems {
|
||||
public static Item invisibilityCloak;
|
||||
public static Item cloudPendant;
|
||||
public static Item superCloudPendant;
|
||||
public static Item thirdEye;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -427,7 +429,8 @@ public final class ModItems {
|
||||
invisibilityCloak = new ItemInvisibilityCloak();
|
||||
cloudPendant = new ItemCloudPendant();
|
||||
superCloudPendant = new ItemSuperCloudPendant();
|
||||
|
||||
thirdEye = new ItemThirdEye();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [22/10/2016, 20:18:44 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import vazkii.botania.api.item.IBaubleRender;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemThirdEye extends ItemBauble implements IManaUsingItem, IBaubleRender {
|
||||
|
||||
private static final int COST = 2;
|
||||
|
||||
public ItemThirdEye() {
|
||||
super(LibItemNames.THIRD_EYE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||
super.onWornTick(stack, player);
|
||||
|
||||
if(!(player instanceof EntityPlayer))
|
||||
return;
|
||||
EntityPlayer eplayer = (EntityPlayer) player;
|
||||
|
||||
double range = 24;
|
||||
AxisAlignedBB aabb = new AxisAlignedBB(player.posX, player.posY, player.posZ, player.posX, player.posY, player.posZ).expand(range, range, range);
|
||||
List<EntityLivingBase> mobs = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, aabb, (Entity e) -> e instanceof IMob);
|
||||
|
||||
if(!mobs.isEmpty())
|
||||
for(EntityLivingBase e : mobs) {
|
||||
PotionEffect potion = e.getActivePotionEffect(MobEffects.GLOWING);
|
||||
if((potion == null || potion.getDuration() <= 2) && ManaItemHandler.requestManaExact(stack, eplayer, COST, true))
|
||||
e.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 12, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.BODY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
|
||||
if(type == RenderType.BODY) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
Helper.rotateIfSneaking(player);
|
||||
boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null;
|
||||
double scale = 0.6;
|
||||
GlStateManager.rotate(180, 0, 0, 1);
|
||||
GlStateManager.translate(-0.3, -0.6, armor ? -0.18 : -0.12);
|
||||
GlStateManager.scale(scale, scale, scale);
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
GlStateManager.pushMatrix();
|
||||
float width = 1F / 16F;
|
||||
switch(i) {
|
||||
case 0: break;
|
||||
case 1:
|
||||
double scale1 = 0.75;
|
||||
width /= 2F;
|
||||
|
||||
GlStateManager.translate(0.15, 0.15, -0.05);
|
||||
double time = ClientTickHandler.total * 0.12;
|
||||
double dist = 0.05;
|
||||
GlStateManager.translate(Math.sin(time) * dist, Math.cos(time * 0.5) * dist, 0);
|
||||
|
||||
GlStateManager.scale(scale1, scale1, scale1);
|
||||
break;
|
||||
case 2:
|
||||
GlStateManager.translate(0, 0, -0.05);
|
||||
break;
|
||||
}
|
||||
|
||||
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.thirdEyeLayers[i];
|
||||
float f = gemIcon.getMinU();
|
||||
float f1 = gemIcon.getMaxU();
|
||||
float f2 = gemIcon.getMinV();
|
||||
float f3 = gemIcon.getMaxV();
|
||||
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), width);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -164,6 +164,7 @@ public final class LibItemNames {
|
||||
public static final String INVISIBILITY_CLOAK = "invisibilityCloak";
|
||||
public static final String CLOUD_PENDANT = "cloudPendant";
|
||||
public static final String SUPER_CLOUD_PENDANT = "superCloudPendant";
|
||||
public static final String THIRD_EYE = "thirdEye";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
Reference in new issue
Block a user