Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Changes #533

Merged
merged 5 commits into from
Jan 7, 2025
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
6 changes: 2 additions & 4 deletions even-more-fish-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ description = "A fishing extension bringing an exciting new experience to fishin

repositories {
mavenCentral()
// Adventure Snapshots
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") // Adventure Snapshots
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
maven("https://github.com/deanveloper/SkullCreator/raw/mvn-repo/")
maven("https://jitpack.io")
Expand Down Expand Up @@ -89,16 +88,15 @@ dependencies {
implementation(libs.inventorygui)
implementation(libs.vanishchecker)
implementation(libs.boostedyaml)
implementation(libs.maven.artifact)

library(libs.maven.artifact)
library(libs.friendlyid)
library(libs.flyway.core)
library(libs.flyway.mysql)
library(libs.hikaricp)
library(libs.caffeine)
library(libs.commons.lang3)
library(libs.commons.codec)

library(libs.json.simple)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,20 @@ public ItemStack createCustomNBTRod() {
itemFactory.setItemLoreCheck(true);

ItemStack customRod = itemFactory.createItem(null, 0);
NBT.modify(customRod,nbt -> {

setCustomNBTRod(customRod);

return customRod;
}

/**
* Allows external plugins to set their own items as an EMF NBT-rod.
* @param item The item to set as an EMF NBT-rod.
*/
public void setCustomNBTRod(@NotNull ItemStack item) {
NBT.modify(item, nbt -> {
nbt.getOrCreateCompound(NbtKeys.EMF_COMPOUND).setBoolean(NbtKeys.EMF_ROD_NBT, true);
});
return customRod;
}

public void reload(@Nullable CommandSender sender) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.oheers.fish.competition.Competition;
import com.oheers.fish.competition.CompetitionType;
import com.oheers.fish.competition.configs.CompetitionFile;
import com.oheers.fish.config.ConfigBase;
import com.oheers.fish.config.MainConfig;
import com.oheers.fish.config.messages.ConfigMessage;
import com.oheers.fish.config.messages.Messages;
Expand All @@ -23,6 +24,7 @@
import com.oheers.fish.fishing.items.Rarity;
import com.oheers.fish.permissions.AdminPerms;
import de.tr7zw.changeme.nbtapi.NBT;
import dev.dejvokep.boostedyaml.YamlDocument;
import net.md_5.bungee.api.chat.*;
import net.md_5.bungee.api.chat.hover.content.Text;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -411,14 +413,21 @@ public void onMigrate(final CommandSender sender) {
}

@Subcommand("rawItem")
@Description("Outputs this item's raw NBT form")
@Description("Outputs this item's raw NBT form for use in YAML")
public void onRawItem(final CommandSender sender) {
if (!(sender instanceof Player player)) {
ConfigMessage.ADMIN_CANT_BE_CONSOLE.getMessage().send(sender);
return;
}
ItemStack handItem = player.getInventory().getItemInMainHand();
String handItemNbt = NBT.itemStackToNBT(handItem).toString();

// Ensure the handItemNbt is escaped for use in YAML
// This could be slightly inefficient, but it is the only way I can currently think of.
YamlDocument document = new ConfigBase().getConfig();
document.set("rawItem", handItemNbt);
handItemNbt = document.dump().replaceFirst("rawItem: ", "");

TextComponent component = new TextComponent(handItemNbt);
component.setHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT, new Text(TextComponent.fromLegacyText("Click to copy to clipboard."))
Expand Down
2 changes: 1 addition & 1 deletion wiki/Economy.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## How to use EMF's new economy system:
As of EvenMoreFish 2.0, the plugin is capable of supporting multiple economies at the same time.

Below is the default config as of December 4th 2024:
Below is the default config (found in config.yml) as of December 4th 2024:
```
# Enable/Disable different economy types here.
# Optionally choose a multiplier for each type you have enabled.
Expand Down