Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void craftEvent(PrepareItemCraftEvent e) {
public void blockConsume(PlayerItemConsumeEvent e) {
if(Cache.blockedConsume.contains(e.getItem().getType())) {
e.setCancelled(true);
e.getPlayer().sendMessage("§cCannot consume this item!");
e.getPlayer().sendMessage("§cYou cannot eat or drink that!");
}
}
@EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public final class WhistleConfig {
public static String soundName = "ITEM_GOAT_HORN_SOUND_6";
public static float soundVolume = 4.0f;
public static float soundPitch = 2.0f;
public static String highlightedMessage = "&aHighlighted &6%count% &aanimals nearby.";
public static String noAnimalsMessage = "&7No animals found nearby.";
public static String cooldownMessage = "&7The whistle is on cooldown for another &6%seconds%s&7.";
public static String highlightedMessage = "&6%count% &aanimals nearby answer your whistle.";
public static String noAnimalsMessage = "&7No animals answer your whistle.";
public static String cooldownMessage = "&7You are still catching your breath. Try again in &6%seconds%s&7.";

private WhistleConfig() {}
}
6 changes: 3 additions & 3 deletions src/main/resources/animal-whistle-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ sound:

# Player feedback messages (& color codes, empty = don't send)
messages:
highlighted: "&aHighlighted &6%count% &aanimals nearby."
no-animals: "&7No animals found nearby."
cooldown: "&7The whistle is on cooldown for another &6%seconds%s&7."
highlighted: "&6%count% &aanimals nearby answer your whistle."
no-animals: "&7No animals answer your whistle."
cooldown: "&7You are still catching your breath. Try again in &6%seconds%s&7."
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ void resetConfig() throws IOException {
WhistleConfig.soundName = "ITEM_GOAT_HORN_SOUND_6";
WhistleConfig.soundVolume = 4.0f;
WhistleConfig.soundPitch = 2.0f;
WhistleConfig.highlightedMessage = "&aHighlighted &6%count% &aanimals nearby.";
WhistleConfig.noAnimalsMessage = "&7No animals found nearby.";
WhistleConfig.cooldownMessage = "&7The whistle is on cooldown for another &6%seconds%s&7.";
WhistleConfig.highlightedMessage = "&6%count% &aanimals nearby answer your whistle.";
WhistleConfig.noAnimalsMessage = "&7No animals answer your whistle.";
WhistleConfig.cooldownMessage = "&7You are still catching your breath. Try again in &6%seconds%s&7.";
}

@Test
Expand All @@ -54,9 +54,9 @@ void loadsFullConfiguration() throws IOException {
volume: 2.5
pitch: 1.5
messages:
highlighted: "&aHighlighted &6%count% &aanimals nearby."
no-animals: "&7No animals found nearby."
cooldown: "&7The whistle is on cooldown for another &6%seconds%s&7."
highlighted: "&6%count% &aanimals nearby answer your whistle."
no-animals: "&7No animals answer your whistle."
cooldown: "&7You are still catching your breath. Try again in &6%seconds%s&7."
""");

assertTrue(WhistleConfigLoader.load(configPath.toFile()));
Expand All @@ -74,9 +74,9 @@ void loadsFullConfiguration() throws IOException {
assertEquals("ITEM_GOAT_HORN_SOUND_6", WhistleConfig.soundName);
assertEquals(2.5f, WhistleConfig.soundVolume);
assertEquals(1.5f, WhistleConfig.soundPitch);
assertEquals("&aHighlighted &6%count% &aanimals nearby.", WhistleConfig.highlightedMessage);
assertEquals("&7No animals found nearby.", WhistleConfig.noAnimalsMessage);
assertEquals("&7The whistle is on cooldown for another &6%seconds%s&7.", WhistleConfig.cooldownMessage);
assertEquals("&6%count% &aanimals nearby answer your whistle.", WhistleConfig.highlightedMessage);
assertEquals("&7No animals answer your whistle.", WhistleConfig.noAnimalsMessage);
assertEquals("&7You are still catching your breath. Try again in &6%seconds%s&7.", WhistleConfig.cooldownMessage);
}

@Test
Expand Down Expand Up @@ -128,9 +128,9 @@ void missingKeysKeepDefaults() throws IOException {
assertEquals("ITEM_GOAT_HORN_SOUND_6", WhistleConfig.soundName);
assertEquals(4.0f, WhistleConfig.soundVolume);
assertEquals(2.0f, WhistleConfig.soundPitch);
assertEquals("&aHighlighted &6%count% &aanimals nearby.", WhistleConfig.highlightedMessage);
assertEquals("&7No animals found nearby.", WhistleConfig.noAnimalsMessage);
assertEquals("&7The whistle is on cooldown for another &6%seconds%s&7.", WhistleConfig.cooldownMessage);
assertEquals("&6%count% &aanimals nearby answer your whistle.", WhistleConfig.highlightedMessage);
assertEquals("&7No animals answer your whistle.", WhistleConfig.noAnimalsMessage);
assertEquals("&7You are still catching your breath. Try again in &6%seconds%s&7.", WhistleConfig.cooldownMessage);
assertTrue(WhistleConfig.whitelistedAnimals.contains(EntityType.HORSE));
}
}