set 1 day time(tic)

Discussion in 'Plugin Development' started by nongman1, Jan 27, 2015.

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

    nongman1

    put
    Code:
    public int con = getConfig().getInt("time");
    
    public int time1 =  24000 /getConfig().getInt("time");
    
    public int time2 =  24000 /getConfig().getInt("time");
    
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
    
    
    Player player = (Player) sender;
    
    if (label.equalsIgnoreCase("start")) {
    
    this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    
    
    
    public void run() {
    
    if(time1!=0){
    
    int now = (int)player.getWorld().getTime();
    
    player.getWorld().setTime(now+time2*20);
    
    time1--; 
    
    }
    
    
    }
    
    
    
    }, 0L, 20L);
    
    }
    
    
    
    returnfalse; }
    
    }
    



    put
    Code:
    22:59:36 [심각] Could not load 'plugins/timer.jar' in folder 'plugins'
    
    org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: File cannot be null
    
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:182)
    
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
    
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
    
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugins(CraftServer.java:241)
    
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.<init>(CraftServer.java:219)
    
    at net.minecraft.server.v1_6_R3.PlayerList.<init>(PlayerList.java:56)
    
    at net.minecraft.server.v1_6_R3.DedicatedPlayerList.<init>(SourceFile:11)
    
    at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:107)
    
    at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393)
    
    at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    
    Caused by: java.lang.IllegalArgumentException: File cannot be null
    
    at org.apache.commons.lang.Validate.notNull(Validate.java:203)
    
    at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:170)
    
    at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:117)
    
    at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:111)
    
    at timer.timer.<init>(timer.java:18)
    
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:178)
    
    ... 9 more
    

    what am i wrong?

    where is null?
     
  2. Offline

    Laxer21117

    I am seeing 2 things
    "java.lang.IllegalArgumentException: File cannot be null"
    "org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: File cannot be null"
     
  3. Offline

    drpk

    @nongman1 you aren't generating the config, use saveConfig() or saveDefaultConfig() in your onEnable.
     
Thread Status:
Not open for further replies.

Share This Page