@SubscribeEvent
public void onClientTick(ClientTickEvent event)
{
final Minecraft minecraft = FMLClientHandler.instance().getClient();
final WorldClient world = minecraft.theWorld;
final EntityClientPlayerMP player = minecraft.thePlayer;
if (event.phase == Phase.START)
{
if (TickHandlerClient.tickCount >= Long.MAX_VALUE)
{
TickHandlerClient.tickCount = 0;
}
TickHandlerClient.tickCount++;
if (TickHandlerClient.tickCount % 20 == 0)
{
if (player != null && player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() instanceof ItemSensorGlasses)
{
ClientProxyCore.valueableBlocks.clear();
for (int i = -4; i < 5; i++)
{
for (int j = -4; j < 5; j++)
{
for (int k = -4; k < 5; k++)
{
int x = MathHelper.floor_double(player.posX + i);
int y = MathHelper.floor_double(player.posY + j);
int z = MathHelper.floor_double(player.posZ + k);
final Block block = player.worldObj.getBlock(x, y, z);
if (block.getMaterial() != Material.air)
{
int metadata = world.getBlockMetadata(x, y, z);
boolean isDetectable = false;
for (BlockMetaList blockMetaList : ClientProxyCore.detectableBlocks)
{
if (blockMetaList.getBlock() == block && blockMetaList.getMetaList().contains(metadata))
{
isDetectable = true;
break;
}
}
if (isDetectable)
{
if (!this.alreadyContainsBlock(x, y, z))
{
ClientProxyCore.valueableBlocks.add(new Vector3(x, y, z));
}
}
else if (block instanceof IDetectableResource && ((IDetectableResource) block).isValueable(metadata))
{
if (!this.alreadyContainsBlock(x, y, z))
{
ClientProxyCore.valueableBlocks.add(new Vector3(x, y, z));
}
List<Integer> metaList = null;
for (BlockMetaList blockMetaList : ClientProxyCore.detectableBlocks)
{
if (blockMetaList.getBlock() == block)
{
metaList = blockMetaList.getMetaList();
if (!metaList.contains(metadata))
{
metaList.add(metadata);
}
break;
}
}
if (metaList == null)
{
metaList = Lists.newArrayList();
metaList.add(metadata);
ClientProxyCore.detectableBlocks.add(new BlockMetaList(block, metaList));
}
}
}
}
}
}
}
}
if (minecraft.currentScreen != null && minecraft.currentScreen instanceof GuiMainMenu)
{
ClientProxyCore.playerItemData.clear();
if (TickHandlerClient.missingRequirementThread == null)
{
TickHandlerClient.missingRequirementThread = new ThreadRequirementMissing(FMLCommonHandler.instance().getEffectiveSide());
TickHandlerClient.missingRequirementThread.start();
}
}
if (world != null && TickHandlerClient.spaceRaceGuiScheduled && minecraft.currentScreen == null)
{
player.openGui(GalacticraftCore.instance, GuiIdsCore.SPACE_RACE_START, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
TickHandlerClient.spaceRaceGuiScheduled = false;
}
if (world != null && TickHandlerClient.checkedVersion)
{