From 80a597414c7904a18713f23544ccba8f02cdb6b6 Mon Sep 17 00:00:00 2001 From: Estecka Date: Thu, 7 Nov 2024 23:10:05 +0100 Subject: [PATCH] Updated doc. --- README.md | 14 +++++++------- .../api/IShiftingTradeFactory.java | 17 +++++++++-------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 78871f0..7eb9ec9 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # Shifting Wares -Causes villager to occasionally re-roll their trade offers, up to three times a day. -This effect is the most noticeable on professions that can sell enchanted items; a single one of these villagers will be able to offer a much greater variety of wares over time. +Causes villager to re-roll their trade offers on their own accord, up to three times a day. +The effect of thiswill be most noticeable on professions that can sell enchanted or coloured items; a single one of these villagers will be able to offer a much greater variety of wares over time. -This aims to reduce the benefits of exploitative playstyle, while increasing the viability of more serendipitous playstyles. +This aims to reduce the benefits of exploitative playstyle, while making serendipitous playstyles more viable. While it's still possible to get the trade you want by repeatedly breaking a villager's workstation, the benefits of doing so become *very* short lived. Waiting for a natural reroll is probably a better use of your time. -Because trades no longer make the identity of a villager, they become much easier to replace if they die, so you don't need to care as much about their safety. You can let them roam around freely with little risk. +Because all trades eventually expire, villagers become much easier to replace if they die, so you don't need to care as much about their safety. You can let them roam around freely with little risk. ## Triggers -There are two gamerules that control when trades can be re-rolled. Both are enabled by default. +There are two gamerules that control when trades can be re-rolled. Both are enabled by default. Disabling all rules effectively disables the mod. - `shiftingWares.dailyReroll`: Causes villagers to re-roll **all** their offers once per day, the first time they restock at their job station. @@ -37,5 +37,5 @@ Placeholder trades will never take the place of a valid trade; they will only sh ## For developpers By default, shifting-Wares assumes 2 trades per level, and pulls its trade pools from the same place as Vanilla. Mods can override this by using the `shifting-wares` entry-point, and implementing [`ITradeLayoutProvider`](./src/main/java/fr/estecka/shiftingwares/api/ITradeLayoutProvider.java). -If your mod contains custom implementation of map trade factories, or other similar items, you can communicate extra data to Shifting-Wares by implementing the same methods defined in [`IShiftingTradeFactory`](./src/main/java/fr/estecka/shiftingwares/api/IShiftingTradeFactory.java). -No dependency on Shifting-Wares is required, you only need to provide methods with the appropriate prototypes in your factories. +If your mod contains custom implementation of map trade factories, or produces other items attached with with permanent data, you can communicate to Shifting-Wares that they should be persistent, by implementing the same methods defined in [`IShiftingTradeFactory`](./src/main/java/fr/estecka/shiftingwares/api/IShiftingTradeFactory.java). +No dependency on Shifting-Wares is required for this, you only need to provide methods with matching names and prototypes. diff --git a/src/main/java/fr/estecka/shiftingwares/api/IShiftingTradeFactory.java b/src/main/java/fr/estecka/shiftingwares/api/IShiftingTradeFactory.java index b250a4d..71acb7a 100644 --- a/src/main/java/fr/estecka/shiftingwares/api/IShiftingTradeFactory.java +++ b/src/main/java/fr/estecka/shiftingwares/api/IShiftingTradeFactory.java @@ -16,20 +16,21 @@ static public IShiftingTradeFactory Of(TradeOffers.Factory factory){ } /** - * Prevents the trades from being be rerolled, until its item has been sold - * at least once. This is, for example, relevant to Exploration Maps, whose - * mere creation leaves a permanent impact on the world. + * Prevents the generated trades from being be rerolled, until its item has + * been sold at least once. This is, for example, relevant to Exploration + * Maps, whose mere creation leaves a permanent impact on the world. */ public default boolean shiftingwares$IsItemPersistent(){ return false; } /** - * This will be used to associate a trade offer to its factory, and avoid - * trade duplicata when rerolling. This should be set for persistent trades, - * else the villager's offers may get clogged up whith repeated copies of - * the same trades. Using this on non-persistent trades will also help - * preventing duplicatas from being generated during depleted-rerolls. + * This will be used to associate existsing trade offers to their factories, + * and avoid trade duplicata when rerolling. This should be set for + * persistent trades, else the villager's offers may get clogged up whith + * repeated copies of the same trades. This may still be used on non- + * persistent trades, since those can also generate duplicatas during + * depleted rerolls. */ public default @Nullable Identifier shiftingwares$GetTradeId(){ return null;