public static void initUtilTab() { if (!useUnifiedTabs || ThermalFoundation.tabUtils != null) { return; } ThermalFoundation.tabUtils = new CreativeTabCore("thermalseries", "Utils") { int iconIndex = 0; TimeTracker iconTracker = new TimeTracker(); public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(utilList.size()); iconTracker.markTime(world); } } @Override @SideOnly (Side.CLIENT) public ItemStack getTabIconItem() { if (utilList.isEmpty()) { return ItemStack.EMPTY; } updateIcon(); return utilList.get(iconIndex); } }; }
public static void initCommonTab() { if (!useUnifiedTabs || ThermalFoundation.tabCommon != null) { return; } ThermalFoundation.tabCommon = new CreativeTabCore("thermalseries", "Blocks") { int iconIndex = 0; TimeTracker iconTracker = new TimeTracker(); public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(blockList.size()); iconTracker.markTime(world); } } @Override @SideOnly (Side.CLIENT) public ItemStack getTabIconItem() { if (blockList.isEmpty()) { return ItemStack.EMPTY; } updateIcon(); return blockList.get(iconIndex); } }; }
public static void initToolTab() { if (!useUnifiedTabs || ThermalFoundation.tabTools != null) { return; } ThermalFoundation.tabTools = new CreativeTabCore("thermalseries", "Tools") { int iconIndex = 0; TimeTracker iconTracker = new TimeTracker(); public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(toolList.size()); iconTracker.markTime(world); } } @Override @SideOnly (Side.CLIENT) public ItemStack getTabIconItem() { if (toolList.isEmpty()) { return ItemStack.EMPTY; } updateIcon(); return toolList.get(iconIndex); } }; }
public static void initItemTab() { if (!useUnifiedTabs || ThermalFoundation.tabItems != null) { return; } ThermalFoundation.tabItems = new CreativeTabCore("thermalseries", "Items") { int iconIndex = 0; TimeTracker iconTracker = new TimeTracker(); public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(itemList.size()); iconTracker.markTime(world); } } @Override @SideOnly (Side.CLIENT) public ItemStack getTabIconItem() { if (itemList.isEmpty()) { return ItemStack.EMPTY; } updateIcon(); return itemList.get(iconIndex); } }; }
public static void initMiscTab() { if (!useUnifiedTabs || ThermalFoundation.tabMisc != null) { return; } ThermalFoundation.tabMisc = new CreativeTabCore("thermalseries", "Misc") { int iconIndex = 0; TimeTracker iconTracker = new TimeTracker(); public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(miscList.size()); iconTracker.markTime(world); } } @Override @SideOnly (Side.CLIENT) public ItemStack getTabIconItem() { if (miscList.isEmpty()) { return ItemStack.EMPTY; } updateIcon(); return miscList.get(iconIndex); } }; }
TimeTracker iconTracker = new TimeTracker(); TimeTracker iconTracker = new TimeTracker();
TimeTracker iconTracker = new TimeTracker(); TimeTracker iconTracker = new TimeTracker();