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 void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(blockList.size()); iconTracker.markTime(world); } }
protected void processOff() { isActive = false; wasActive = true; tracker.markTime(world); }
protected void updateIfChanged(boolean curActive) { if (curActive != isActive && !wasActive) { updateLighting(); sendTilePacket(Side.CLIENT); } else if (wasActive && tracker.hasDelayPassed(world, CoreProps.tileUpdateDelay)) { wasActive = false; updateLighting(); sendTilePacket(Side.CLIENT); } }
protected void processOff() { processRem = 0; isActive = false; wasActive = true; clearRecipe(); if (world != null) { tracker.markTime(world); } }
protected void updateIfChanged(boolean curActive) { if (curActive != isActive && !wasActive) { if (LIGHT_VALUES[getType()] != 0) { updateLighting(); } sendTilePacket(Side.CLIENT); } else if (wasActive && tracker.hasDelayPassed(world, CoreProps.tileUpdateDelay)) { wasActive = false; if (LIGHT_VALUES[getType()] != 0) { updateLighting(); } sendTilePacket(Side.CLIENT); } }
public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(toolList.size()); iconTracker.markTime(world); } }
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); } }; }
@Override public void setInventorySlotContents(int slot, ItemStack stack) { if (ServerHelper.isServerWorld(world) && slot == 1) { if (isActive && !inventory[slot].isEmpty()) { if (stack.isEmpty() || !stack.isItemEqual(inventory[slot]) || !hasValidInput()) { isActive = false; wasActive = true; tracker.markTime(world); processRem = 0; } } containerItem = null; hasContainerItem = false; handler = null; hasEnergyHandler = false; hasRepairItem = false; } inventory[slot] = stack; // if (!stack.isEmpty() && stack.getCount() > getInventoryStackLimit()) { // stack.setCount(getInventoryStackLimit()); // } markChunkDirty(); }
public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { int next = MathHelper.RANDOM.nextInt(ItemFlorb.florbList.size() - 1); iconIndex = next >= iconIndex ? next + 1 : next; iconTracker.markTime(world); } }
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 void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(itemList.size()); iconTracker.markTime(world); } }
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 void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { iconIndex = MathHelper.RANDOM.nextInt(miscList.size()); iconTracker.markTime(world); } }
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); } }; }
public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { int next = MathHelper.RANDOM.nextInt(TDDucts.ductList.size() - 1); iconIndex = next >= iconIndex ? next + 1 : next; iconTracker.markTime(world); } }
TimeTracker iconTracker = new TimeTracker(); TimeTracker iconTracker = new TimeTracker();
public void updateIcon() { World world = CoFHCore.proxy.getClientWorld(); if (CoreUtils.isClient() && iconTracker.hasDelayPassed(world, 80)) { int next = MathHelper.RANDOM.nextInt(ItemMorb.morbList.size() - 1); iconIndex = next >= iconIndex ? next + 1 : next; iconTracker.markTime(world); } }
TimeTracker iconTracker = new TimeTracker(); 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); } }