Thread: 474 Event cannot be applied to int

Results 1 to 3 of 3
  1. #1 474 Event cannot be applied to int 
    Registered Member
    Join Date
    Sep 2008
    Posts
    84
    Thanks given
    2
    Thanks received
    3
    Rep Power
    1
    This is what i have in my Magic class:

    Code:
    package com.rs2hd.content;
    
    import com.rs2hd.packethandler.ActionButtonPacketHandler;
    import com.rs2hd.model.Player;
    import com.rs2hd.net.Packet;
    import com.rs2hd.event.Event;
    import com.rs2hd.model.World;
    
    public class Magic {
    
        Player p;
        ActionButtonPacketHandler ab;
        Packet packet;
    
        public static int homeTele = 0;
    
        /**
         *This is the constructor
         */
        public Magic(Player p) {
            this.p = p;
        }
    
        public void teleportButtons() {
            World.getInstance().registerEvent(new Event(homeTele) {
    
                @Override
                public void execute() {
                    if (homeTele == -1) {
                        this.stop();
                        return;
                    }
    
                    if (homeTele == 4) {
                        p.animate(4847);
                    } else if (homeTele == 3) {
                        p.animate(4850);
                    } else if (homeTele == 2) {
                        p.animate(4851);
                    } else if (homeTele == 1) {
                        p.animate(4852);
                        homeTele = 0;
                    }
                    if (homeTele > 0) {
                        homeTele--;
                    }
                }
            }, 600);
        }
    }
    and this is the error i am getting:

    Code:
    Preparing...
    A subdirectory or file bin already exists.
            1 file(s) copied.
            1 file(s) moved.
    Compiling core...
    src\com\rs2hd\content\Magic.java:27: registerEvent(com.rs2hd.event.Event) in com
    .rs2hd.model.World cannot be applied to (<anonymous com.rs2hd.event.Event>,int)
                    World.getInstance().registerEvent(new Event(homeTele) {
                                       ^
    1 error
    Compiling packet handlers...
    Reply With Quote  
     

  2. #2  
    brb ridin da storm

    blakeman8192's Avatar
    Join Date
    Dec 2012
    Age
    28
    Posts
    2,010
    Thanks given
    802
    Thanks received
    1,357
    Rep Power
    286
    change
    Code:
            }, 600);
    to
    Code:
            });
    and change
    Code:
    new Event(homeTele)
    to
    Code:
    new Event(600)
    what you are using as "homeTele" s the tick rate of the event
    rest in peace Qemist, Izzy, TeChNo PuNk, Impulser, & bootnecklad
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2008
    Posts
    84
    Thanks given
    2
    Thanks received
    3
    Rep Power
    1
    Cheers blakey poo
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •