SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'Fixing player.playSound in 1.12' (#70) from fixing-1.12 into master

Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2020-11-16 17:36:39 +01:00
Commit 7bd5f2e2a0
3 geänderte Dateien mit 66 neuen und 3 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,10 +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.SoundCategory;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
@ -47,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, SoundCategory.MASTER, 1, 1);
if (Core.getVersion() == 8) {
BungeeReceiver_8.playPling(player);
} else {
BungeeReceiver_9.playpling(player);
}
}
});