Java Code Examples for org.spigotmc.SpigotConfig#bungee()

The following examples show how to use org.spigotmc.SpigotConfig#bungee() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PGMServer.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
protected void setupProperties() {
  propertyManager = new EnvPropertyManager(options);

  setSpawnAnimals(propertyManager.getBoolean("spawn-animals", true));
  setSpawnNPCs(propertyManager.getBoolean("spawn-npcs", true));
  setPVP(propertyManager.getBoolean("pvp", true));
  setAllowFlight(propertyManager.getBoolean("allow-flight", false));
  setResourcePack(
      propertyManager.getString("resource-pack", ""),
      propertyManager.getString("resource-pack-hash", ""));
  setGamemode(WorldSettings.EnumGamemode.getById(propertyManager.getInt("gamemode", 0)));
  setForceGamemode(propertyManager.getBoolean("force-gamemode", false));
  setIdleTimeout(propertyManager.getInt("player-idle-timeout", 0));
  setMotd(propertyManager.getString("motd", "A Minecraft 1.8 Server"));
  setWorld(propertyManager.getString("level-name", "world"));
  setPort(propertyManager.getInt("port", 25565));
  c(propertyManager.getInt("max-build-height", 256)); // setBuildHeight
  c(propertyManager.getString("server-ip", "0.0.0.0")); // setServerIp

  final String mode = propertyManager.getString("server-mode", "online");
  if (mode.equalsIgnoreCase("bungee")) {
    SpigotConfig.bungee = true;
  }
  final boolean online = mode.equalsIgnoreCase("online") || mode.equalsIgnoreCase("true");
  propertyManager.setProperty("online-mode", online);
  setOnlineMode(online);
}
 
Example 2
Source File: CraftPlayer.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
    StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
    if (getHandle().connection == null) return;

    if (channels.contains(channel) || SpigotConfig.bungee) {
        SPacketCustomPayload packet = new SPacketCustomPayload(channel, new PacketBuffer(Unpooled.wrappedBuffer(message)));
        getHandle().connection.sendPacket(packet);
    }
}
 
Example 3
Source File: CraftPlayerProfile.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean complete(boolean textures) {
    MinecraftServer server = MinecraftServer.getServerCB();

    boolean isOnlineMode = server.isServerInOnlineMode() || (SpigotConfig.bungee);
    boolean isCompleteFromCache = this.completeFromCache(true);
    if (isOnlineMode && (!isCompleteFromCache || textures && !hasTextures())) {
        GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true);
        if (result != null) {
            this.profile = result;
        }
    }
    return profile.isComplete() && (!isOnlineMode || !textures || hasTextures());
}
 
Example 4
Source File: SpigotMiscUtils.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public boolean isProxyEnabled() {
	return SpigotConfig.bungee;
}