diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java index 6251e593..b8da7434 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java @@ -35,6 +35,7 @@ public class Settings { private static final String HOOK_SETTING_PATH = "hook-settings"; private static final String HOOK_ITEMADDER_PATH = "itemsadder"; private static final String HOOK_RELOAD_CHANGE_PATH = "reload-on-change"; + private static final String COSMETIC_EMOTE_CHECK_PATH = "emote-block-check"; private static String defaultMenu; private static String dyeMenuName; @@ -50,6 +51,7 @@ public class Settings { private static boolean unapplyOnDeath; private static boolean forcePermissionJoin; private static boolean itemsAdderChangeReload; + private static boolean cosmeticEmoteBlockCheck; private static int lookDownPitch; private static int viewDistance; private static int tickPeriod; @@ -81,6 +83,7 @@ public class Settings { unapplyOnDeath = cosmeticSettings.node(UNAPPLY_DEATH_PATH).getBoolean(false); forcePermissionJoin = cosmeticSettings.node(FORCE_PERMISSION_JOIN_PATH).getBoolean(false); emoteDistance = cosmeticSettings.node(EMOTE_DISTANCE_PATH).getDouble(-3); + cosmeticEmoteBlockCheck = cosmeticSettings.node(COSMETIC_EMOTE_CHECK_PATH).getBoolean(true); tickPeriod = cosmeticSettings.node(TICK_PERIOD_PATH).getInt(-1); lookDownPitch = cosmeticSettings.node(LOOK_DOWN_PITCH_PATH).getInt(); @@ -219,6 +222,11 @@ public class Settings { public static double getEmoteDistance() { return emoteDistance; } + + public static boolean getCosmeticEmoteBlockCheck() { + return cosmeticEmoteBlockCheck; + } + public static void setDebugMode(boolean newSetting) { debugMode = newSetting; diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java index 63ee7c72..79258f47 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java @@ -57,7 +57,7 @@ public class UserEmoteModel extends PlayerModel { double DISTANCE = Settings.getEmoteDistance(); Location thirdPersonLocation = newLocation.add(newLocation.getDirection().normalize().multiply(DISTANCE)); - if (thirdPersonLocation.getBlock().getType() != Material.AIR) { + if (Settings.getCosmeticEmoteBlockCheck() && thirdPersonLocation.getBlock().getType().isOccluding()) { stopAnimation(); MessagesUtil.sendMessage(player, "emote-blocked"); return; diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index d79a9ab1..ac183714 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -24,6 +24,7 @@ cosmetic-settings: force-permission-join: true # Checks a player permission if they can have a cosmetic when they join the server. emote-distance: -3 # This shows how far away the camera should be while a player is doing an emote. Negative is behind player. + emote-block-check: true # If the server should check if the block is open (prevents players viewing through blocks) # view distance in blocks that other players will see the backpack cosmetic # setting this to lower than the server player view distance should fix the