I have this class:
public class PetAssembly extends Global
{
public Socket socket;
public ConnectionManager user;
public PetAssembly(Socket socket, ConnectionManager user)
{
this.socket = socket;
this.user = user;
}
public void initPet()
{
sendPacket(socket, "0|PET|I|0|0|1");
sendPacket(socket, "0|PET|S|1000|1|0|8000|50000|50000|1000|1000|50000|50000|" + (((user.user.getSpeed() * 30) / 100) + user.user.getSpeed()) + "|testPet");
}
}
I want to use it:
case "/pet":
PetAssembly.this.initPet();
break;
But it gives me this error, how to fix it? I'm a beginner : No enclosing instance of the type PetAssembly is accessible in scope
new PetAssembly().initPet()?