Seer Sigil should display tranquility data (#1234)

This commit is contained in:
Nicholas Ignoffo 2018-02-19 14:04:32 -08:00
parent 7a288a7292
commit 0beef19ba1
5 changed files with 12 additions and 78 deletions

View file

@ -1,8 +1,8 @@
package WayofTime.bloodmagic.client.hud;
import WayofTime.bloodmagic.client.Sprite;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.sigil.ItemSigilDivination;
import WayofTime.bloodmagic.item.sigil.ItemSigilSeer;
import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
@ -71,12 +71,12 @@ public abstract class HUDElementCornerTile<T extends TileEntity> extends HUDElem
flag = true;
}
} else {
if (sigilStack.getItem() instanceof ItemSigilSeer)
if (sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
flag = true;
if (!flag) {
sigilStack = player.getHeldItem(EnumHand.OFF_HAND);
if (sigilStack.getItem() instanceof ItemSigilSeer)
if (sigilStack.getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
flag = true;
}
}

View file

@ -4,7 +4,6 @@ import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.util.Constants;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.sigil.ItemSigilDivination;
import WayofTime.bloodmagic.item.sigil.ItemSigilSeer;
import WayofTime.bloodmagic.tile.TileAltar;
import WayofTime.bloodmagic.util.helper.TextHelper;
import mcp.mobius.waila.api.IWailaConfigHandler;
@ -102,10 +101,10 @@ public class DataProviderBloodAltar implements IWailaDataProvider {
}
private static boolean holdingSeerSigil(EntityPlayer player) {
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilSeer)
if (player.getHeldItemMainhand().getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
return true;
if (player.getHeldItemOffhand().getItem() instanceof ItemSigilSeer)
if (player.getHeldItemOffhand().getItem() == RegistrarBloodMagicItems.SIGIL_SEER)
return true;
return false;

View file

@ -144,7 +144,7 @@ public class RegistrarBloodMagicItems {
new ItemBoundPickaxe().setRegistryName("bound_pickaxe"),
new ItemBoundAxe().setRegistryName("bound_axe"),
new ItemBoundShovel().setRegistryName("bound_shovel"),
new ItemSigilDivination().setRegistryName("sigil_divination"),
new ItemSigilDivination(true).setRegistryName("sigil_divination"),
new ItemSigilAir().setRegistryName("sigil_air"),
new ItemSigilWater().setRegistryName("sigil_water"),
new ItemSigilLava().setRegistryName("sigil_lava"),
@ -156,7 +156,7 @@ public class RegistrarBloodMagicItems {
new ItemSigilSuppression().setRegistryName("sigil_suppression"),
new ItemSigilHaste().setRegistryName("sigil_haste"),
new ItemSigilFastMiner().setRegistryName("sigil_fast_miner"),
new ItemSigilSeer().setRegistryName("sigil_seer"),
new ItemSigilDivination(false).setRegistryName("sigil_seer"),
new ItemSigilPhantomBridge().setRegistryName("sigil_phantom_bridge"),
new ItemSigilWhirlwind().setRegistryName("sigil_whirlwind"),
new ItemSigilCompression().setRegistryName("sigil_compression"),

View file

@ -19,39 +19,25 @@ import java.util.ArrayList;
import java.util.List;
public class ItemSigilDivination extends ItemSigilBase implements IAltarReader {
public ItemSigilDivination() {
super("divination");
public ItemSigilDivination(boolean simple) {
super(simple ? "divination" : "seer");
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
// if (world instanceof WorldServer)
// {
// System.out.println("Testing...");
//// BuildTestStructure s = new BuildTestStructure();
//// s.placeStructureAtPosition(new Random(), Rotation.CLOCKWISE_180, (WorldServer) world, player.getPosition(), 0);
// DungeonTester.testDungeonElementWithOutput((WorldServer) world, player.getPosition());
// }
// if (!world.isRemote)
// {
// EntityCorruptedSheep fred = new EntityCorruptedSheep(world, EnumDemonWillType.DESTRUCTIVE);
// fred.setPosition(player.posX, player.posY, player.posZ);
// world.spawnEntityInWorld(fred);
// }
ItemStack stack = player.getHeldItem(hand);
if (stack.getItem() instanceof ISigil.Holding)
stack = ((Holding) stack.getItem()).getHeldItem(stack, player);
if (PlayerHelper.isFakePlayer(player))
return ActionResult.newResult(EnumActionResult.FAIL, stack);
if (!world.isRemote) {
super.onItemRightClick(world, player, hand);
RayTraceResult position = rayTrace(world, player, false);
RayTraceResult rayTrace = rayTrace(world, player, false);
if (position == null) {
if (rayTrace == null) {
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
List<ITextComponent> toSend = new ArrayList<ITextComponent>();
if (!getOwnerName(stack).equals(PlayerHelper.getUsernameFromPlayer(player)))

View file

@ -1,51 +0,0 @@
package WayofTime.bloodmagic.item.sigil;
import WayofTime.bloodmagic.iface.IAltarReader;
import WayofTime.bloodmagic.iface.ISigil;
import WayofTime.bloodmagic.util.helper.NetworkHelper;
import WayofTime.bloodmagic.util.helper.PlayerHelper;
import WayofTime.bloodmagic.util.ChatUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class ItemSigilSeer extends ItemSigilBase implements IAltarReader {
public ItemSigilSeer() {
super("seer");
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
ItemStack stack = player.getHeldItem(hand);
if (stack.getItem() instanceof ISigil.Holding)
stack = ((Holding) stack.getItem()).getHeldItem(stack, player);
if (PlayerHelper.isFakePlayer(player))
return ActionResult.newResult(EnumActionResult.FAIL, stack);
if (!world.isRemote) {
super.onItemRightClick(world, player, hand);
RayTraceResult rayTrace = rayTrace(world, player, false);
if (rayTrace == null) {
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
List<ITextComponent> toSend = new ArrayList<ITextComponent>();
if (!getOwnerName(stack).equals(PlayerHelper.getUsernameFromPlayer(player)))
toSend.add(new TextComponentTranslation(tooltipBase + "otherNetwork", getOwnerName(stack)));
toSend.add(new TextComponentTranslation(tooltipBase + "currentEssence", currentEssence));
ChatUtil.sendNoSpam(player, toSend.toArray(new ITextComponent[toSend.size()]));
}
}
return super.onItemRightClick(world, player, hand);
}
}