mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-16 18:44:44 +00:00
Fixed some baubles not working after their slots were changed.
This commit is contained in:
1 parent
f8688ef471
commit
806b324d81
5 files changed
+8
-8
No files matched your search
@@ -89,10 +89,10 @@ public final class HUDHandler {
|
||||
if(event.getType() == ElementType.HEALTH) {
|
||||
profiler.startSection("botania-hud");
|
||||
IInventory baublesInv = BaublesApi.getBaubles(mc.thePlayer);
|
||||
ItemStack amulet = baublesInv.getStackInSlot(0);
|
||||
if(amulet != null && amulet.getItem() == ModItems.flightTiara) {
|
||||
ItemStack headpiece = baublesInv.getStackInSlot(4);
|
||||
if(headpiece != null && headpiece.getItem() == ModItems.flightTiara) {
|
||||
profiler.startSection("flugelTiara");
|
||||
ItemFlightTiara.renderHUD(event.getResolution(), mc.thePlayer, amulet);
|
||||
ItemFlightTiara.renderHUD(event.getResolution(), mc.thePlayer, headpiece);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble
|
||||
public void onEntityDamaged(LivingHurtEvent event) {
|
||||
if(event.getSource().getEntity() instanceof EntityPlayer && event.getEntityLiving() instanceof EntityLiving && !event.getEntityLiving().worldObj.isRemote && Math.random() < 0.6F) {
|
||||
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||
ItemStack amulet = BaublesApi.getBaubles(player).getStackInSlot(0);
|
||||
ItemStack amulet = BaublesApi.getBaubles(player).getStackInSlot(6);
|
||||
if(amulet != null && amulet.getItem() == this) {
|
||||
final int cost = 250;
|
||||
if(ManaItemHandler.requestManaExact(amulet, player, cost, false)) {
|
||||
|
||||
@@ -213,7 +213,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
|
||||
public void updatePlayerFlyStatus(LivingUpdateEvent event) {
|
||||
if(event.getEntityLiving() instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
|
||||
ItemStack tiara = BaublesApi.getBaubles(player).getStackInSlot(0);
|
||||
ItemStack tiara = BaublesApi.getBaubles(player).getStackInSlot(4);
|
||||
int left = ItemNBTHelper.getInt(tiara, TAG_TIME_LEFT, MAX_FLY_TIME);
|
||||
|
||||
if(playersWithFlight.contains(playerStr(player))) {
|
||||
@@ -311,7 +311,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
|
||||
}
|
||||
|
||||
private boolean shouldPlayerHaveFlight(EntityPlayer player) {
|
||||
ItemStack armor = BaublesApi.getBaubles(player).getStackInSlot(0);
|
||||
ItemStack armor = BaublesApi.getBaubles(player).getStackInSlot(4);
|
||||
if(armor != null && armor.getItem() == this) {
|
||||
int left = ItemNBTHelper.getInt(armor, TAG_TIME_LEFT, MAX_FLY_TIME);
|
||||
boolean flying = ItemNBTHelper.getBoolean(armor, TAG_FLYING, false);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ItemGoldenLaurel extends ItemBauble implements IBaubleRender {
|
||||
public void onPlayerDeath(LivingDeathEvent event) {
|
||||
if(event.getEntityLiving() instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
|
||||
ItemStack amulet = BaublesApi.getBaubles(player).getStackInSlot(0);
|
||||
ItemStack amulet = BaublesApi.getBaubles(player).getStackInSlot(4);
|
||||
|
||||
if(amulet != null && amulet.getItem() == this) {
|
||||
event.setCanceled(true);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ItemHolyCloak extends ItemBauble implements IBaubleRender {
|
||||
if(event.getEntityLiving() instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
|
||||
IInventory baubles = BaublesApi.getBaubles(player);
|
||||
ItemStack belt = baubles.getStackInSlot(3);
|
||||
ItemStack belt = baubles.getStackInSlot(5);
|
||||
if(belt != null && belt.getItem() instanceof ItemHolyCloak && !isInEffect(belt)) {
|
||||
ItemHolyCloak cloak = (ItemHolyCloak) belt.getItem();
|
||||
int cooldown = getCooldown(belt);
|
||||
|
||||
Reference in new issue
Block a user