Update code style

This commit is contained in:
nossr50
2019-04-24 22:52:53 -07:00
parent dc758a6dfc
commit 02a69cbb05
334 changed files with 4660 additions and 5158 deletions

View File

@@ -11,47 +11,43 @@ import org.bukkit.entity.Player;
public class SoundManager {
/**
* Sends a sound to the player
*
* @param soundType the type of sound
*/
public static void sendSound(Player player, Location location, SoundType soundType)
{
if(SoundConfig.getInstance().getIsEnabled(soundType))
public static void sendSound(Player player, Location location, SoundType soundType) {
if (SoundConfig.getInstance().getIsEnabled(soundType))
player.playSound(location, getSound(soundType), SoundCategory.MASTER, getVolume(soundType), getPitch(soundType));
}
public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory)
{
if(SoundConfig.getInstance().getIsEnabled(soundType))
public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory) {
if (SoundConfig.getInstance().getIsEnabled(soundType))
player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), getPitch(soundType));
}
public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory, float pitchModifier)
{
public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory, float pitchModifier) {
float totalPitch = Math.min(2.0F, (getPitch(soundType) + pitchModifier));
if(SoundConfig.getInstance().getIsEnabled(soundType))
if (SoundConfig.getInstance().getIsEnabled(soundType))
player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), totalPitch);
}
public static void worldSendSound(World world, Location location, SoundType soundType)
{
if(SoundConfig.getInstance().getIsEnabled(soundType))
public static void worldSendSound(World world, Location location, SoundType soundType) {
if (SoundConfig.getInstance().getIsEnabled(soundType))
world.playSound(location, getSound(soundType), getVolume(soundType), getPitch(soundType));
}
/**
* All volume is multiplied by the master volume to get its final value
*
* @param soundType target soundtype
* @return the volume for this soundtype
*/
private static float getVolume(SoundType soundType)
{
private static float getVolume(SoundType soundType) {
return SoundConfig.getInstance().getVolume(soundType) * SoundConfig.getInstance().getMasterVolume();
}
private static float getPitch(SoundType soundType)
{
if(soundType == SoundType.FIZZ)
private static float getPitch(SoundType soundType) {
if (soundType == SoundType.FIZZ)
return getFizzPitch();
else if (soundType == SoundType.POP)
return getPopPitch();
@@ -59,10 +55,8 @@ public class SoundManager {
return SoundConfig.getInstance().getPitch(soundType);
}
private static Sound getSound(SoundType soundType)
{
switch(soundType)
{
private static Sound getSound(SoundType soundType) {
switch (soundType) {
case ANVIL:
return Sound.BLOCK_ANVIL_PLACE;
case ITEM_BREAK:

View File

@@ -16,9 +16,8 @@ public enum SoundType {
BLEED,
TIRED;
public boolean usesCustomPitch()
{
switch(this){
public boolean usesCustomPitch() {
switch (this) {
case POP:
case FIZZ:
return true;