瀏覽代碼

fix sound enum error on 1.8

MasterCake 2 年之前
父節點
當前提交
96c125633f
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/main/java/xyz/spaceio/customoregen/Events.java

+ 5 - 0
src/main/java/xyz/spaceio/customoregen/Events.java

@@ -59,6 +59,11 @@ public class Events implements Listener {
 		} catch( ClassNotFoundException e ) {
 			useLevelledClass = false;
 		}
+		
+		if(enableSoundEffect) {
+			// disabling sound effects when enum value not present
+			enableSoundEffect = Arrays.asList(Sound.values()).stream().map(Sound::name).anyMatch(s -> s.equals("BLOCK_FIRE_EXTINGUISH"));
+		}
 	}
 
 	@SuppressWarnings("deprecation")