fisheater's peterdance

maybe there is a fishcoin code in here?
my to do list is 1000 items long and yet here i am watching youtube again
message1
i need to actually learn how to do stuff
1g1dma5a7
real
fishcoin
well that was something
i love fishcoin

have YOU desired to have fishcoin in your minecraft world or server? now you can!

it comes with a simple configuration file in the plugin/mod folder.

downloads

❌ no fabric jar (yet?)

fishcoin-minecraft

now fishcoin can power your smp

spigot/paper/bukkit version, will be merged into fabric branch eventually

> for minecraft spigot/paper/bukkit 1.21.10

to build, run mvn clean package in the root directory

features

all of these features are configurable

rewards

new hidden advancements (for single time rewards)

more

<details> <summary>advanced info</summary>

want to use your self-hosted stuff? use these hidden config options:

  api: "&lt;api-url-here&gt;"
  java-pack-url: "&lt;java-pack-url&gt;"
  java-pack-hash: "&lt;java-pack-hash&gt;"
  bedrock-pack-url: "&lt;bedrock-pack-url&gt;"
  bedrock-mappings-url: "&lt;backrock-mappings-url&gt;"

if you're developing another plugin, use FishcoinHook to interact with fishcoin

> Note: FishcoinHook is loaded via reflection, so no compile dependency needed. Always wrap calls in try-catch blocks.

give coins to a player

  try {
      Class&lt;?&gt; hookClass = Class.forName("com.fisheater.FishcoinHook");
      java.lang.reflect.Method method = hookClass.getMethod("give", String.class, long.class);
      method.invoke(null, "PlayerName", 100L);
  } catch (ClassNotFoundException e) {
      plugin.getLogger().warning("FishcoinHook not found - is fishcoin plugin installed?");
  } catch (Exception e) {
      plugin.getLogger().warning("FishcoinHook error: " + e.getMessage());
  }

take coins from a player (with callback)

  try {
      Class&lt;?&gt; hookClass = Class.forName("com.fisheater.FishcoinHook");
      java.lang.reflect.Method method = hookClass.getMethod("take", String.class, long.class, java.util.function.Consumer.class);
      method.invoke(null, "PlayerName", 50L, (java.util.function.Consumer&lt;Boolean&gt;) success -&gt; {
          if (success) {
              player.sendMessage("payment received!");
          } else {
              player.sendMessage("insufficient funds");
          }
      });
  } catch (ClassNotFoundException e) {
      plugin.getLogger().warning("FishcoinHook not found");
  } catch (Exception e) {
      plugin.getLogger().warning("FishcoinHook error: " + e.getMessage());
  }

check player balance (async)

  try {
      Class&lt;?&gt; hookClass = Class.forName("com.fisheater.FishcoinHook");
      java.lang.reflect.Method method = hookClass.getMethod("getBalance", String.class, java.util.function.Consumer.class);
      method.invoke(null, "PlayerName", (java.util.function.Consumer&lt;Long&gt;) balance -&gt; {
          Bukkit.getScheduler().runTask(plugin, () -&gt; {
              if (balance == -1) {
                  player.sendMessage("no wallet linked");
              } else {
                  player.sendMessage("your balance: ₣" + java.text.NumberFormat.getInstance().format(balance));
              }
          });
      });
  } catch (ClassNotFoundException e) {
      plugin.getLogger().warning("FishcoinHook not found");
  } catch (Exception e) {
      plugin.getLogger().warning("FishcoinHook error: " + e.getMessage());
  }

check server wallet balance (async)

  try {
      Class&lt;?&gt; hookClass = Class.forName("com.fisheater.FishcoinHook");
      java.lang.reflect.Method method = hookClass.getMethod("getServerWalletBalance", java.util.function.Consumer.class);
      method.invoke(null, (java.util.function.Consumer&lt;Long&gt;) balance -&gt; {
          Bukkit.getScheduler().runTask(plugin, () -&gt; {
              if (balance == -1) {
                  player.sendMessage("server wallet unavailable");
              } else {
                  player.sendMessage("server wallet: ₣" + java.text.NumberFormat.getInstance().format(balance));
              }
          });
      });
  } catch (ClassNotFoundException e) {
      plugin.getLogger().warning("FishcoinHook not found");
  } catch (Exception e) {
      plugin.getLogger().warning("FishcoinHook error: " + e.getMessage());
  }

check if player is currently active (from PassiveIncome check)

  try {
      Class&lt;?&gt; hookClass = Class.forName("com.fisheater.FishcoinHook");
      java.lang.reflect.Method method = hookClass.getMethod("isPlayerActive", String.class);
      boolean active = (boolean) method.invoke(null, player.getName());

      if (active) {
          player.sendMessage("§aYou are eligible for active player rewards!");
      } else {
          player.sendMessage("§cYou must be active to claim rewards.");
      }
  } catch (ClassNotFoundException e) {
      plugin.getLogger().warning("FishcoinHook not found");
  } catch (Exception e) {
      plugin.getLogger().warning("FishcoinHook error: " + e.getMessage());
  }

complete example: shop plugin

  @EventHandler
  public void onPlayerInteract(PlayerInteractEvent event) {
      Player player = event.getPlayer();

      try {
          Class&lt;?&gt; hookClass = Class.forName("com.fisheater.FishcoinHook");

          // check if they have a wallet
          java.lang.reflect.Method hasWallet = hookClass.getMethod("hasWallet", String.class);
          boolean wallet = (boolean) hasWallet.invoke(null, player.getName());

          if (!wallet) {
              player.sendMessage("§cyou need to link your fishcoin wallet!");
              return;
          }

          // charge them
          java.lang.reflect.Method take = hookClass.getMethod("take", String.class, long.class, java.util.function.Consumer.class);
          take.invoke(null, player.getName(), 100L, (java.util.function.Consumer&lt;Boolean&gt;) success -&gt; {
              if (success) {
                  player.getInventory().addItem(new ItemStack(Material.DIAMOND));
                  player.sendMessage("§apurchased diamond for ₣100!");
              } else {
                  player.sendMessage("§cnot enough fishcoin!");
              }
          });
      } catch (ClassNotFoundException e) {
          player.sendMessage("§cFishcoin plugin not installed!");
      } catch (Exception e) {
          plugin.getLogger().warning("FishcoinHook error: " + e.getMessage());
      }
  }

</details>

source code

first thing i've ever made in java

source