I need help! UpdateSigns

Discussion in 'Plugins for Nukkit' started by LucGamesHD, 8/2/16.

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
We welcome you on our site. This site is devoted to the Nukkit project and all that is connected with him. Here you can communicate, download plugins, also many other things get acquainted! Register the account right now :3
  1. LucGamesHD

    LucGamesHD Developer

    Messages:
    26
    Likes Received:
    10
    Minecraft:
    LucGamesYT
    Hey i have a problem...
    I keep getting errors from the level in the console :/





    Code:
    package de.lucgameshd.gungame.scheduler;
    
    
    
    import cn.nukkit.blockentity.BlockEntitySign;
    import cn.nukkit.scheduler.PluginTask;
    import de.lucgameshd.gungame.GunGame;
    
    public class SignUpdate extends PluginTask<GunGame> {
    
    [pre][code]GunGame pl;
    
    public SignUpdate(GunGame owner) {
        super(owner);
        this.owner = pl;
    
    }
    
    @Override
    public void onRun(int arg0) {
        for(int i = 0; i &lt; this.pl.getServer().getDefaultLevel().getBlockEntities().size(); i++){
            BlockEntitySign tile = (BlockEntitySign) this.pl.getServer().getDefaultLevel().getBlockEntities().get(i);
            if(tile instanceof BlockEntitySign){
                if(tile.getText()[0].equalsIgnoreCase("Test")){
                    tile.setText("Hallo", "Line2");
                }
            }
        }
    
    }
    [/pre]
    }[/code]
     
  2. fromgate

    fromgate Administrator

    Messages:
    665
    Likes Received:
    186
    Can you copy error message here too?
     
  3. LucGamesHD

    LucGamesHD Developer

    Messages:
    26
    Likes Received:
    10
    Minecraft:
    LucGamesYT
    Yes here


    18:21:02 [CRITICAL] Could not execute taskHandler Unknown: null
    18:21:02 [ALERT] java.lang.NullPointerException
    at de.lucgameshd.gungame.scheduler.SignUpdate.onRun(SignUpdate.java:20)
    at cn.nukkit.scheduler.ServerScheduler.lambda$addTask$46(ServerScheduler.java:147)
    at cn.nukkit.scheduler.TaskHandler.run(TaskHandler.java:93)
    at cn.nukkit.scheduler.ServerScheduler.mainThreadHeartbeat(ServerScheduler.java:185)
    at cn.nukkit.Server.tick(Server.java:951)
    at cn.nukkit.Server.tickProcessor(Server.java:756)
    at cn.nukkit.Server.start(Server.java:736)
    at cn.nukkit.Server.<init>(Server.java:440)
    at cn.nukkit.Nukkit.main(Nukkit.java:65)
     
  4. LucGamesHD

    LucGamesHD Developer

    Messages:
    26
    Likes Received:
    10
    Minecraft:
    LucGamesYT
    The error id here in this post line 21
     

Share This Page