コード例 #1
0
  public boolean canSetPreferred() {

    ItemStack input = lexiconInv.getStackInSlot(0);

    if (input == null) {
      return false;
    }
    return LexiconManager.validOre(input);
  }
コード例 #2
0
  public boolean doClearPreferred() {

    if (!hasPreferredOre()) {
      return false;
    }
    LexiconManager.clearPreferredStack(player, lexiconInv.getStackInSlot(0));
    hasPreferredStack = false;
    syncClient = true;

    return true;
  }
コード例 #3
0
  public boolean doSetPreferred() {

    if (!canSetPreferred()) {
      return false;
    }
    LexiconManager.setPreferredStack(player, lexiconInv.getStackInSlot(0));
    hasPreferredStack = true;
    syncClient = true;

    return true;
  }
コード例 #4
0
  @EventHandler
  public void loadComplete(FMLLoadCompleteEvent event) {

    LexiconManager.loadComplete();

    TFPlugins.loadComplete();

    cleanConfig(false);
    config.cleanUp(false, true);
    configClient.cleanUp(false, true);

    log.info("Load Complete.");
  }
コード例 #5
0
  public void handlePacket(PacketTFBase payload) {

    switch (payload.getByte()) {
      case ORE_PREV:
        prevOre();
        return;
      case ORE_NEXT:
        nextOre();
        return;
      case SET_PREFERRED:
        doSetPreferred();
        return;
      case CLEAR_PREFERRED:
        doClearPreferred();
        return;
      case SELECT_ORE:
        String oreName = payload.getString();
        oreList = OreDictionaryArbiter.getOres(oreName);
        if (LexiconManager.hasPreferredStack(player, oreName)) {
          ItemStack ore = LexiconManager.getPreferredStack(player, oreName);
          lexiconInv.setInventorySlotContents(0, ore);
          for (int i = 0; i < oreList.size(); i++) {
            if (oreList.get(i) == ore) {
              oreSelection = i;
              break;
            }
          }
          hasPreferredStack = true;
        } else {
          lexiconInv.setInventorySlotContents(0, OreDictionaryArbiter.getOres(oreName).get(0));
          oreSelection = 0;
          hasPreferredStack = false;
        }
        syncClient = true;
      default:
    }
  }
コード例 #6
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {

    UpdateManager.registerUpdater(new UpdateManager(this, releaseURL, CoFHProps.DOWNLOAD_URL));

    config.setConfiguration(
        new Configuration(
            new File(CoFHProps.configDir, "/cofh/thermalfoundation/common.cfg"), true));
    configClient.setConfiguration(
        new Configuration(
            new File(CoFHProps.configDir, "cofh/thermalfoundation/client.cfg"), true));

    tabCommon = new TFCreativeTab();

    cleanConfig(true);
    configOptions();

    TFFluids.preInit();
    TFItems.preInit();
    TFBlocks.preInit();
    TFPlugins.preInit();

    LexiconManager.preInit();
  }