Oheers / EvenMoreFish

An advanced fishing plugin based on MoreFish, created 2 years after its last update.
MIT License
91 stars 56 forks source link

Fish biome sets #76

Open LeeSpork opened 2 years ago

LeeSpork commented 2 years ago

I've decided to make usage of the biome-specific fish feature to add more variation to fishing on my server, however I've noticed an issue: it requires a lot of copy-paste if you want to make multiple fish in the same biomes. This could be a problem if, for example, Mojang decides to add another ocean biome, and now I'd have to go through all of my fish and hope that I don't miss any fish.

Here's my proposed solution, expressed as example config files:

biomesets.yml (new file)

biomesets:
  Oceans:
    biomes:
      - BEACH
      - SNOWY_BEACH
      - STONE_SHORE
      - MUSHROOM_FIELD_SHORE
      - OCEAN
      - DEEP_OCEAN
      - COLD_OCEAN
      - DEEP_COLD_OCEAN
      - FROZEN_OCEAN
      - DEEP_FROZEN_OCEAN
      - LUKEWARM_OCEAN
      - DEEP_LUKEWARM_OCEAN
      - WARM_OCEAN
      - DEEP_WARM_OCEAN
  Deserts:
    biomes:
      - DESERT
      - DESERT_HILLS
      - DESERT_LAKES
  Ender:
    biomes:
      - THE_END
      - END_BARRENS
      - END_HIGHLANDS
      - END_MIDLANDS

fish.yml (snippets)

    Sea Bass:
      biomesets:
        # Can only be caught in oceanic biomes (see biomesets.yml)
        - Oceans

    Ender Pearl Oyster:
      item:
        material: ENDER_PEARL
      biomesets:
        # Can be caught in Ender biomes
        - Ender
      biomes:
        # Can also be caught in the void biome
        - THE_VOID

The way it would work is it would act as if the biomes referenced in the biomesets were also in the biomes field of the fish

Maybe it could also be cool to make dimension specific fish? (e.g. so you can specify that fish can only be caught in the Overworld dimension, so they can't be caught in the End regardless of biome)

Oheers commented 2 years ago

This is a great idea, perhaps even later down the line of updates a feature could be added that lets you change/add/remove biomes through a GUI with each biome being represented by a block from that biome!

I've added it to the todo list :)

LeeSpork commented 1 year ago

I just remembered this... Vanilla Minecraft now has biome tags, so does it work now to set fish to use a biome tag that is added by a datapack?

I imagine that would be more convenient, if Spigot/whatever allows it

sarhatabaot commented 2 weeks ago

So this is actually possible to achieve without any code modification, and with purely yaml features. I achieved this result by modifying my fish.yml like so:

biome-groups:
  ocean_beach: &ocean_beach
    ? OCEAN
    ? BEACH

And then in a particular fish:

cod:
  requirements:
    biome:
       <<: *ocean_beach

You can even extend this further by adding more info to the group later, i.e:

white_cod:
  requirements:
    biome:
       <<: *ocean_beach
       ? JUNGLE

https://gist.github.com/sarhatabaot/e2d1f69bff72e235aeb5b28aa01c0d54 gist with this exact explanation Based on https://stackoverflow.com/questions/9254178/is-there-yaml-syntax-for-sharing-part-of-a-list-or-map

sarhatabaot commented 2 weeks ago

Also added an wiki page for this at https://github.com/Oheers/EvenMoreFish/wiki/Biome-Sets