版本更新至:3.76
调整:开发框架改为 Gradle 新增:Language2 工具新增 [book] 类型
This commit is contained in:
52
src/main/java/me/skymc/taboolib/sound/SoundUtils.java
Normal file
52
src/main/java/me/skymc/taboolib/sound/SoundUtils.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package me.skymc.taboolib.sound;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
|
||||
import me.skymc.taboolib.TabooLib;
|
||||
import me.skymc.taboolib.message.MsgUtils;
|
||||
|
||||
public class SoundUtils {
|
||||
|
||||
public static void sound(Location paramLocation, String paramString, float paramFloat1, float paramFloat2) {
|
||||
String str = getModifiedSound(paramString);
|
||||
try {
|
||||
paramLocation.getWorld().playSound(paramLocation, Sound.valueOf(str), paramFloat1, paramFloat2);
|
||||
}
|
||||
catch (Exception localException) {
|
||||
MsgUtils.send("§4Bug with " + paramString + ". No such sound found. Please report it to the plugin creator :)");
|
||||
}
|
||||
}
|
||||
|
||||
static String getModifiedSound(String str) {
|
||||
if (TabooLib.getVerint() < 10900) {
|
||||
str = str.replace("BLOCK_FIRE_EXTINGUISH", "FIZZ");
|
||||
str = str.replace("BLOCK_NOTE_HAT", "NOTE_STICKS");
|
||||
str = str.replace("ENTITY_SHEEP_DEATH", "SHEEP_IDLE");
|
||||
str = str.replace("ENTITY_LLAMA_ANGRY", "HORSE_HIT");
|
||||
str = str.replace("BLOCK_BREWING_STAND_BREW", "CREEPER_HISS");
|
||||
str = str.replace("ENTITY_SHULKER_TELEPORT", "ENDERMAN_TELEPORT");
|
||||
str = str.replace("ENTITY_ZOMBIE_ATTACK_IRON_DOOR", "ZOMBIE_METAL");
|
||||
str = str.replace("BLOCK_GRAVEL_BREAK", "DIG_GRAVEL");
|
||||
str = str.replace("BLOCK_SNOW_BREAK", "DIG_SNOW");
|
||||
str = str.replace("BLOCK_GRAVEL_BREAK", "DIG_GRAVEL");
|
||||
str = str.replace("ENTITY_PLAYER_LEVELUP", "LEVEL_UP");
|
||||
str = str.replace("ENTITY_SNOWBALL_THROW", "SHOOT_ARROW");
|
||||
|
||||
str = str.replace("ENTITY_", "");
|
||||
str = str.replace("GENERIC_", "");
|
||||
str = str.replace("BLOCK_", "");
|
||||
str = str.replace("_AMBIENT", "");
|
||||
str = str.replace("_BREAK", "");
|
||||
str = str.replace("PLAYER_ATTACK_CRIT", "ITEM_BREAK");
|
||||
str = str.replace("ENDERMEN", "ENDERMAN");
|
||||
str = str.replace("ARROW_SHOOT", "SHOOT_ARROW");
|
||||
str = str.replace("UI_BUTTON_", "");
|
||||
str = str.replace("ENDERMAN_HURT", "ENDERMAN_HIT");
|
||||
str = str.replace("BLAZE_HURT", "BLAZE_HIT");
|
||||
str = str.replace("_FLAP", "_WINGS");
|
||||
str = str.replace("EXPERIENCE_", "");
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user