NBTTagCompound fmData = held.stackTagCompound;
if (fmData != null && fmData.hasKey("linkedUUIDMost") && fmData.hasKey("linkedUUIDLeast"))
{
UUID uuid = new UUID(fmData.getLong("linkedUUIDMost"), fmData.getLong("linkedUUIDLeast"));
((TileEntityTelemetry) tile).addTrackedEntity(uuid);
player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.telemetrySucceed.message")));
}
else
{
player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.telemetryFail.message")));
if (fmData == null)
{
fmData = new NBTTagCompound();
held.setTagCompound(fmData);
}
}
fmData.setInteger("teCoordX", x);
fmData.setInteger("teCoordY", y);
fmData.setInteger("teCoordZ", z);
fmData.setInteger("teDim", world.provider.dimensionId);
return true;
}
ItemStack wearing = GCPlayerStats.get((EntityPlayerMP)player).frequencyModuleInSlot;
if (wearing != null)
{
if (wearing.hasTagCompound() && wearing.getTagCompound().hasKey("teDim")) return false;
player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.telemetryFailWearingIt.message")));
}
else
player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.telemetryFailNoFrequencyModule.message")));
}
}
return false;
}