mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-25 03:55:23 +01:00
Fixed support for below 1.10
This commit is contained in:
parent
f73192d729
commit
1406a86272
@ -28,7 +28,7 @@ public class WarpEffects {
|
||||
|
||||
}
|
||||
|
||||
public Sound findSound(AdvancedPortalsPlugin plugin, String newName, String oldName){
|
||||
public static Sound findSound(AdvancedPortalsPlugin plugin, String newName, String oldName){
|
||||
Sound soundFound = null;
|
||||
try{
|
||||
soundFound = Sound.valueOf(newName);
|
||||
|
@ -7,6 +7,7 @@ import com.sekwah.advancedportals.ConfigAccessor;
|
||||
import com.sekwah.advancedportals.PluginMessages;
|
||||
import com.sekwah.advancedportals.api.portaldata.PortalArg;
|
||||
import com.sekwah.advancedportals.destinations.Destination;
|
||||
import com.sekwah.advancedportals.effects.WarpEffects;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -30,6 +31,7 @@ public class Portal {
|
||||
private static boolean showBungeeMessage;
|
||||
private static int cooldelay;
|
||||
private static double throwback;
|
||||
private static Sound portalSound;
|
||||
|
||||
public Portal(AdvancedPortalsPlugin plugin) {
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
@ -37,6 +39,8 @@ public class Portal {
|
||||
cooldelay = config.getConfig().getInt("PortalCooldown", 5);
|
||||
throwback = config.getConfig().getDouble("ThrowbackAmount", 0.7);
|
||||
|
||||
this.portalSound = WarpEffects.findSound(plugin, "BLOCK_PORTAL_TRAVEL", "PORTAL_TRAVEL");
|
||||
|
||||
Portal.plugin = plugin;
|
||||
Portal.loadPortals();
|
||||
}
|
||||
@ -471,7 +475,7 @@ public class Portal {
|
||||
|
||||
private static void failSound(Player player, AdvancedPortal portal) {
|
||||
if(!(portal.getTrigger() == Material.PORTAL && player.getGameMode() == GameMode.CREATIVE)){
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_PORTAL_TRAVEL, 0.5f, new Random().nextFloat() * 0.4F + 0.8F);
|
||||
player.playSound(player.getLocation(), portalSound, 0.5f, new Random().nextFloat() * 0.4F + 0.8F);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user