Exemple #1
0
 public static void setup() {
   captionOptions = ModOptionsAPI.addMod("captionapi", "Caption API").setClientMode();
   ModOptionBoolean option =
       (ModOptionBoolean)
           captionOptions
               .addBooleanOption(
                   "Captioning", CaptionAPI.getCaption("button.text"), CaptionAPI.getCaptioning())
               .setCallback(instance);
   option.setLabels(CaptionAPI.getCaption("button.on"), CaptionAPI.getCaption("button.off"));
 }
  public void updateTick(World world, int i, int j, int k, Random random) {
    if ((!world.multiplayerWorld)
        && ((this.blockID == Block.plantYellow.blockID)
            || (this.blockID == Block.plantRed.blockID))) {
      // ATTEMPT REPRODUCTION
      ModOptions flowers = mod_AutoForest.flowers;
      boolean grow = ((ModBooleanOption) flowers.getOption("FlowersGrow")).getValue();
      if (grow) {
        attemptGrowth(world, i, j, k);
      }

      // ATTEMPT DEATH
      boolean death = mod_AutoForest.flowerDeath.getValue();
      if (death && hasDied(world, i, j, k)) {
        death(world, i, j, k);
      }
    }

    if (world.getBlockId(i, j, k) != 0) {
      checkFlowerChange(world, i, j, k);
    }
  }