Configurable fireticks?

Discussion in 'Plugin Development' started by PolarCraft, Dec 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    PolarCraft

    So i am trying to make it so you can do 'x' ticks in the config.yml.

    I am trying this.
    Code:java
    1. String fire = plugin.getConfig().getString("fire");
    2. int fire2 = fire;
    3. t.setFireTicks(fire);

    And i know i can not convert fire to an int. How else could I do this?
     
  2. Offline

    JoTyler

    You can convert fire to an int use

    Int fire2 = valueof(fire(

    Something like that
     
  3. Offline

    Dako

    PolarCraft

    plugin.getConfig().getInt();

    is also possible ;).

    greetz

    Dako, ruler of Icecrown
     
  4. Offline

    PolarCraft

    Dako ??
    Code:java
    1. int fire = plugin.getConfig().getInt("fire-time");
    2. t.setFireTicks(fire);
     
  5. Offline

    justcool393

    That looks like that'd be the way to do it.
     
  6. Offline

    random_username

    As the users above said, you can try:
    Code:java
    1. //Method 1
    2. String fire = plugin.getConfig().getString("fire");
    3. int fire2 = Integer.parseInt(fire);
    4. t.setFireTicks(fire);
    5. //Method 2
    6. int fire = plugin.getConfig().getInt("fire");
    7. t.setFireTicks(fire);
    8. //Method 3
    9. int fire = Integer.valueOf(plugin.getConfig().getString("fire"));
    10. t.setFireTicks(fire);
     
  7. Offline

    PolarCraft

Thread Status:
Not open for further replies.

Share This Page