SteamWar/SpigotCore
Archiviert
13
0

Fixing player.playSound in 1.8

Dieser Commit ist enthalten in:
Chaoscaot 2020-11-15 11:22:45 +01:00
Ursprung 05e8a83228
Commit fb59bf4317
3 geänderte Dateien mit 66 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,30 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.comms;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
public class BungeeReceiver_8 {
public static void playPling(Player player) {
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1, 1);
}
}

Datei anzeigen

@ -0,0 +1,30 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.comms;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
public class BungeeReceiver_9 {
public static void playpling(Player player) {
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
}
}

Datei anzeigen

@ -23,9 +23,9 @@ import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
import de.steamwar.comms.handlers.BungeeHandler;
import de.steamwar.comms.handlers.InventoryHandler;
import de.steamwar.core.Core;
import de.steamwar.sql.SteamwarUser;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
@ -46,7 +46,11 @@ public class BungeeReceiver implements PluginMessageListener {
UUID uuid = SteamwarUser.get(byteArrayDataInput.readInt()).getUUID();
if(Bukkit.getPlayer(uuid).isOnline()) {
Player player = Bukkit.getPlayer(uuid);
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
if (Core.getVersion() == 8) {
BungeeReceiver_8.playPling(player);
} else {
BungeeReceiver_9.playpling(player);
}
}
});