Skip to content

Commit

Permalink
Stupid solution
Browse files Browse the repository at this point in the history
  • Loading branch information
variananora committed Sep 6, 2021
1 parent 2828e2e commit 3fefce7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import java.util.Map;
import java.util.UUID;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;

public class HotbarPet extends SlimefunItem {

Expand Down Expand Up @@ -42,7 +42,7 @@ public ItemStack getFavouriteFood() {
public boolean checkAndConsumeFood(Player player) {
if (!player.getInventory().containsAtLeast(getFavouriteFood(), 1)) {
if (messageDelay.getOrDefault(player.getUniqueId(), 0L) <= System.currentTimeMillis()) {
Slimefun.getLocalization().sendMessage(player, "hotbarpets.neglected-pet", true, msg -> msg.replace("%pet%", getItemName()));
player.sendMessage(ChatColor.BLUE + "Your " + getItemName() + "would have helped you if you did not neglect it by not feeding it :(");
messageDelay.put(player.getUniqueId(), System.currentTimeMillis() + MESSAGE_DELAY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.github.thebusybiscuit.hotbarpets.listeners.TNTListener;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.libraries.dough.config.Config;
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;
Expand Down Expand Up @@ -52,9 +51,6 @@ public void onEnable() {
new UtilityPets(this);
new SpecialPets(this);

Slimefun.getLocalization().setDefaultMessage("hotbarpets.neglected-pet", "&9Your %pet% &9would have helped you if you did not neglect it by not feeding it :(");
Slimefun.getLocalization().save();

// Registering the Listeners
new DamageListener(this);
new FoodListener(this);
Expand Down

0 comments on commit 3fefce7

Please sign in to comment.