From 365cdbdd8e28a310fe798417a6fcf29cbb356bd8 Mon Sep 17 00:00:00 2001 From: BenceX100 Date: Mon, 16 Dec 2024 18:03:30 +0100 Subject: [PATCH] AxAuctions update --- Writerside/hi.tree | 1 + Writerside/images/image_52.png | Bin 0 -> 2497 bytes Writerside/topics/AxAuctions-Developer-API.md | 22 +++++---- .../AxAuctions-Multi-Currency-Plugins.md | 44 ++++++++++++++++++ 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 Writerside/images/image_52.png create mode 100644 Writerside/topics/AxAuctions-Multi-Currency-Plugins.md diff --git a/Writerside/hi.tree b/Writerside/hi.tree index 3a1b69b..8fa36a8 100644 --- a/Writerside/hi.tree +++ b/Writerside/hi.tree @@ -138,6 +138,7 @@ + diff --git a/Writerside/images/image_52.png b/Writerside/images/image_52.png new file mode 100644 index 0000000000000000000000000000000000000000..2ee622a9111686abf0765e805209e6741f3495a8 GIT binary patch literal 2497 zcmbu>X*Ane9|!QXGrCZO(jYOl6l0jCs-;?8>vm zOWTyHv{AL>FP01vOBK~3NNB}YA<2WHqUtfvInTR!Gv|5n{oQl!{hj;bcRu%=n|{vK zNl{))9s+?VqEYr9TdQO%k-K(mRULn%3MN3Z0YwU0#OoW~R@LHuIIR-u9lj z-26nPtdZsRu-@nU*9*~4!W)T1-)(37!#lS_z^^(7&)km5SnnBICCuD<*`Unq@uw$$ z!|j-|Gh6uf&2BWK-(X_o>~d$G=j!obbnWnI)(>Jh*t zx4Y^NT-1n^(pMRsi-PM9e<*D9%93<09;qhLVGD&PMA|-Mclw1zJL74xNgCXyZt7ES zTA4{sK*4VjM%*-haw}M!aK$Ncu*Ti?3>}P0j$sp3uH_Vi^@OK*+HtmL+0My2L5HmZH>s>>!|!Pl(sf<~-{|UY0%X)WP``XR zTsUv7zARxg;rDM$bVjEqD>fH+_}NV+4c=W9bHpZm!zLcKOIigqXo%q@L93PV4bE11 z23g4s5wBN^`ZtkppUp}|lE{TMSr(fD&wlZ`NUgH`h<6_LV!x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VbM2IWd7r=5M?KZ^ zm}#c8GHOQ`vv2)NAMoI6ryI2hpKk2W=$MBZ*#&U#_rpE=_0?n?w$c z)rMM$^^78E giveBalance(@NotNull UUID player, double amount) { + CompletableFuture cf = new CompletableFuture<>(); // your code here + cf.complete(true); // make sure to return true if the transaction the successfully completed! (or false if it failed) if your plugin doesn't use async tasks, just complete with a true value + return cf; } @Override - public void takeBalance(Consumer successful, @NotNull UUID player, double amount) { + public CompletableFuture takeBalance(Consumer successful, @NotNull UUID player, double amount) { + CompletableFuture cf = new CompletableFuture<>(); // your code here - // the Consumer is meant to be used for async plugins, for example if your async sql query fails, return false to prevent giving the item - successful.accept(true); // it is VERY IMPORTANT to accept the consumer if everything worked!!! + cf.complete(true); // make sure to return true if the transaction the successfully completed! (or false if it failed) if your plugin doesn't use async tasks, just complete with a true value + return cf; } } ``` -> Double-check, that in the **takeBalance** method you always accept the consumer (`successful.accept()`) +> Double-check, that you always complete the CompletableFuture transactions. (`cf.complete(true or false)`) +> If this is not done, the plugin will not respond to purchases using your currency. {style="warning"} -Next is, you will have to create a section in the `currencies.yml`, copy paste one of the other currencies, for example, like this: +Next is, check the `currencies.yml`, there should be something like this generated for your own currency: ```yaml ExampleCurrency: # < the name of your currency register: true diff --git a/Writerside/topics/AxAuctions-Multi-Currency-Plugins.md b/Writerside/topics/AxAuctions-Multi-Currency-Plugins.md new file mode 100644 index 0000000..c0fab25 --- /dev/null +++ b/Writerside/topics/AxAuctions-Multi-Currency-Plugins.md @@ -0,0 +1,44 @@ +# Multi Currency Plugins + +* If a plugin supports multiple currencies, you can allow multiple currencies to be used in AxAuctions. + +Example CoinsEngine setup with 2 currencies in the `currencies.yml`: + +We have 2 currencies set up in CoinsEngine: + +![image_52.png](image_52.png) + +And in The AxAuctions currencies.yml, this is how the 2 currencies are set up: +```yaml +currencies: + CoinsEngine: + register: true + # CoinsEngine supports multiple currencies, so you can also add multiple here + # "coins" is the name of the currency + # first currency + coins: + tax: 0 + display: + raw: "CoinsEngine-coins" + gui: "&f%\price% &#AAFFFFcoins" + item: + material: GOLD_INGOT + name: "�DDFFCoinsEngine coins" + lore: + - " " + - "�DDFF&l(!) �DDFFClick here to select!" + # second currency + money: + tax: 0 + display: + raw: "CoinsEngine-money" + gui: "&f%\price% &#AAFFFFmoney" + item: + material: GOLD_NUGGET + name: "�DDFFCoinsEngine money" + lore: + - " " + - "�DDFF&l(!) �DDFFClick here to select!" +``` + +You can register any amount of custom currencies if the plugin supports it. \ No newline at end of file