diff --git a/mods/bworld/items/fishing_rod.json b/mods/bworld/items/fishing_rod.json index e4d549b..f0c10f7 100644 --- a/mods/bworld/items/fishing_rod.json +++ b/mods/bworld/items/fishing_rod.json @@ -17,8 +17,7 @@ "bite": [ 20, 40 - ], - "loot_table": "bworld:gameplay/fishing" + ] } } } diff --git a/mods/bworld/loot_tables/gameplay/fishing_autumn.json b/mods/bworld/loot_tables/gameplay/fishing_autumn.json new file mode 100644 index 0000000..baae394 --- /dev/null +++ b/mods/bworld/loot_tables/gameplay/fishing_autumn.json @@ -0,0 +1,15 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:salmon", + "weight": 60 + } + ] + } + ] + } +} diff --git a/mods/bworld/loot_tables/gameplay/fishing_spring.json b/mods/bworld/loot_tables/gameplay/fishing_spring.json new file mode 100644 index 0000000..3a3bea5 --- /dev/null +++ b/mods/bworld/loot_tables/gameplay/fishing_spring.json @@ -0,0 +1,15 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:cod", + "weight": 60 + } + ] + } + ] + } +} diff --git a/mods/bworld/loot_tables/gameplay/fishing.json b/mods/bworld/loot_tables/gameplay/fishing_summer.json similarity index 100% rename from mods/bworld/loot_tables/gameplay/fishing.json rename to mods/bworld/loot_tables/gameplay/fishing_summer.json diff --git a/mods/bworld/loot_tables/gameplay/fishing_winter.json b/mods/bworld/loot_tables/gameplay/fishing_winter.json new file mode 100644 index 0000000..3f9d9c5 --- /dev/null +++ b/mods/bworld/loot_tables/gameplay/fishing_winter.json @@ -0,0 +1,19 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:cod", + "weight": 60 + }, + { + "item": "bworld:salmon", + "weight": 25 + } + ] + } + ] + } +} diff --git a/mods/bworld/scripts/server.ts b/mods/bworld/scripts/server.ts index 77b98ce..84cbe0f 100644 --- a/mods/bworld/scripts/server.ts +++ b/mods/bworld/scripts/server.ts @@ -628,8 +628,6 @@ interface FishingRodParams { wait: [number, number]; // ticks it stays on the hook before it gets away bite: [number, number]; - // what's caught, a loot table - loot_table: string; } interface Cast { @@ -706,7 +704,12 @@ function register_fishing(ctx: ServerContext) { const cast = casts.get(player.id); if (cast) { if (cast.escape_at !== undefined) { - const loot = ctx.loot.roll(params.loot_table, { position: cast.position, player, tool: rod }); + const season = ctx.world.season_at( + cast.hook.position.x, + cast.hook.position.z, + ); + const loot_table = `bworld:gameplay/fishing_${season}`; + const loot = ctx.loot.roll(loot_table, { position: cast.position, player, tool: rod }); for (const item of loot) player.give_item(item.id, item.count, item.data); } stop(player, player.id);