mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-28 07:55:45 +00:00
Added the Flugel Tiara.
This commit is contained in:
1 parent
e4ca3ff245
commit
d8e1f4ca3b
6 files changed
+94
No files matched your search
@@ -108,6 +108,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.lavaPendant);
|
||||
addItem(ModItems.goldLaurel);
|
||||
addItem(ModItems.divaCharm);
|
||||
addItem(ModItems.flightTiara);
|
||||
|
||||
addItem(ModItems.manaTablet);
|
||||
addItem(ModItems.manaMirror);
|
||||
|
||||
@@ -25,6 +25,7 @@ import vazkii.botania.common.item.equipment.armor.ItemTerrasteelHelm;
|
||||
import vazkii.botania.common.item.equipment.armor.ItemTerrasteelLegs;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemAuraRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemDivaCharm;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemGoldenLaurel;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemGreaterAuraRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemGreaterManaRing;
|
||||
@@ -96,6 +97,7 @@ public final class ModItems {
|
||||
public static Item miningRing;
|
||||
public static Item terraPick;
|
||||
public static Item divaCharm;
|
||||
public static Item flightTiara;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -146,6 +148,7 @@ public final class ModItems {
|
||||
miningRing = new ItemMiningRing();
|
||||
terraPick = new ItemTerraPick();
|
||||
divaCharm = new ItemDivaCharm();
|
||||
flightTiara = new ItemFlightTiara();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* 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 a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [May 26, 2014, 4:05:50 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
|
||||
public class ItemFlightTiara extends ItemBauble {
|
||||
|
||||
public static List<String> playersWithFlight = new ArrayList();
|
||||
private static final int COST = 20;
|
||||
|
||||
public ItemFlightTiara() {
|
||||
super(LibItemNames.FLIGHT_TIARA);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.AMULET;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void updatePlayerFlyStatus(LivingUpdateEvent event) {
|
||||
if(event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
|
||||
ItemStack armor = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);
|
||||
if(playersWithFlight.contains(playerStr(player))) {
|
||||
if(shouldPlayerHaveFlight(player)) {
|
||||
player.capabilities.allowFlying = true;
|
||||
if(player.capabilities.isFlying)
|
||||
ManaItemHandler.requestManaExact(armor, player, COST, true);
|
||||
} else {
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
player.capabilities.allowFlying = false;
|
||||
player.capabilities.isFlying = false;
|
||||
player.capabilities.disableDamage = false;
|
||||
}
|
||||
playersWithFlight.remove(playerStr(player));
|
||||
}
|
||||
} else if(shouldPlayerHaveFlight(player)) {
|
||||
playersWithFlight.add(playerStr(player));
|
||||
player.capabilities.allowFlying = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
String username = event.player.getGameProfile().getName();
|
||||
ItemFlightTiara.playersWithFlight.remove(username + ":false");
|
||||
ItemFlightTiara.playersWithFlight.remove(username + ":true");
|
||||
}
|
||||
|
||||
public static String playerStr(EntityPlayer player) {
|
||||
return player.getGameProfile().getName() + ":" + player.worldObj.isRemote;
|
||||
}
|
||||
|
||||
private boolean shouldPlayerHaveFlight(EntityPlayer player) {
|
||||
ItemStack armor = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);
|
||||
return armor != null && armor.getItem() == this && ManaItemHandler.requestManaExact(armor, player, COST, false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public final class LibItemNames {
|
||||
public static final String MINING_RING = "miningRing";
|
||||
public static final String TERRA_PICK = "terraPick";
|
||||
public static final String DIVA_CHARM = "divaCharm";
|
||||
public static final String FLIGHT_TIARA = "flightTiara";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -337,6 +337,7 @@ item.botania:waterRing.name=Ring of Chordata
|
||||
item.botania:miningRing.name=Ring of the Mantle
|
||||
item.botania:terraPick.name=Terra Shatterer
|
||||
item.botania:divaCharm.name=Charm of the Diva
|
||||
item.botania:flightTiara.name=Flügel Tiara
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 313 B |
Reference in new issue
Block a user