Jump to content

Andere Spielerzahl bei Client-Pingrequest senden


Dark_Lion64
 Share

Recommended Posts

Hallo Minecraftforum :)

Ich habe hier einen Java code. Wenn ich es dann exportiere, wird dann die Zahl der Spieler, die aktuell online sind, im Client als 1 angezeigt?

Srry falls die Frage dumm ist, aber ich kenne mich nicht gut mit Java- und Bukkitprogrammierung aus

Code:

package org.bukkit.event.server;

import java.net.InetAddress;

import org.bukkit.event.HandlerList;

public class ServerListPingEvent extends ServerEvent

{

private static final HandlerList handlers = new HandlerList();

private final InetAddress address;

private String motd;

private final int numPlayers;

private int maxPlayers;

public ServerListPingEvent(InetAddress address, String motd, int numPlayers, int maxPlayers)

{

this.address = address;

this.motd = motd;

this.numPlayers = numPlayers;

this.maxPlayers = maxPlayers;

}

public InetAddress getAddress()

{

return this.address;

}

public String getMotd()

{

return this.motd;

}

public void setMotd(String motd)

{

this.motd = motd;

}

public int getNumPlayers()

{

return this.numPlayers;

int this.numPlayers = 1;

}

public int getMaxPlayers()

{

return this.maxPlayers;

}

public void setMaxPlayers(int maxPlayers)

{

this.maxPlayers = maxPlayers;

}

public HandlerList getHandlers()

{

return handlers;

}

public static HandlerList getHandlerList() {

return handlers;

}

}

Danke für eure Hilfe und einen schönen Abend noch :)

Edited by Biber
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...
B
B