SteamWar/SpigotCore
Archiviert
13
0

Fixing player.playSound in 1.12 #70

Manuell gemergt
Lixfel hat 2 Commits von fixing-1.12 nach master 2020-11-16 17:36:41 +01:00 zusammengeführt
3 geänderte Dateien mit 66 neuen und 2 gelöschten Zeilen
Nur Änderungen aus Commit fb59bf4317 werden angezeigt - Alle Commits anzeigen

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) {
Veraltet
Review

Das fixt das Issue nicht, das Issue ist auch "ENTITY_EXPERIENCE_ORB_PICKUP". Stell doch mal in der SpigotCore_Main/pom.xml testweise auf Spigot 1.8 um und schau mal, was deine IDE dann zu diesem Codeschnipsel sagt.

Das fixt das Issue nicht, das Issue ist auch "ENTITY_EXPERIENCE_ORB_PICKUP". Stell doch mal in der SpigotCore_Main/pom.xml testweise auf Spigot 1.8 um und schau mal, was deine IDE dann zu diesem Codeschnipsel sagt.
BungeeReceiver_8.playPling(player);
} else {
BungeeReceiver_9.playpling(player);
}
}
});