@@ -591,7 +591,7 @@ public boolean actionSelling(@NotNull final Player seller, @NotNull final Invent
591591 }
592592 sendPurchaseSuccess (sellerQUser , shop , amount , total , transaction .tax ().doubleValue ());
593593 new ShopSuccessPurchaseEvent (shop , sellerQUser , sellerInventory , amount , total , transaction .tax ().doubleValue ()).callEvent ();
594- notifyBought (sellerQUser , shop , amount , stock , transaction . tax (). doubleValue (), total );
594+ notifyBought (sellerQUser , shop , amount , stock , transaction );
595595 return true ;
596596 }
597597
@@ -1124,16 +1124,18 @@ public void sendShopInfo(@NotNull final Player p, @NotNull final Shop shop) {
11241124 }
11251125
11261126
1127- private void notifyBought (@ NotNull final QUser seller , @ NotNull final Shop shop , final int amount , final int stock , final double tax , final double total ) {
1127+ private void notifyBought (@ NotNull final QUser seller , @ NotNull final Shop shop , final int amount , final int stock , @ NotNull final QSEconomyTransaction transaction ) {
11281128
11291129 Util .asyncThreadRun (()->{
11301130 final String langCode = plugin .text ().findRelativeLanguages (shop .getOwner (), true ).getLocale ();
11311131 final List <Component > sendList = new ArrayList <>();
11321132 Component notify ;
1133+ final double ownerPayment = transaction .ownerPayment ().doubleValue ();
1134+ final double tax = transaction .tax ().doubleValue ();
11331135 if (plugin .getConfig ().getBoolean ("show-tax" )) {
1134- notify = plugin .text ().of ("player-bought-from-your-store-tax" , seller , amount * shop .getItem ().getAmount (), Util .getItemStackName (shop .getItem ()), this .formatter .format (total - tax , shop ), this .formatter .format (tax , shop )).forLocale (langCode );
1136+ notify = plugin .text ().of ("player-bought-from-your-store-tax" , seller , amount * shop .getItem ().getAmount (), Util .getItemStackName (shop .getItem ()), this .formatter .format (ownerPayment , shop ), this .formatter .format (tax , shop )).forLocale (langCode );
11351137 } else {
1136- notify = plugin .text ().of ("player-bought-from-your-store" , seller , amount * shop .getItem ().getAmount (), Util .getItemStackName (shop .getItem ()), this .formatter .format (total - tax , shop )).forLocale (langCode );
1138+ notify = plugin .text ().of ("player-bought-from-your-store" , seller , amount * shop .getItem ().getAmount (), Util .getItemStackName (shop .getItem ()), this .formatter .format (ownerPayment , shop )).forLocale (langCode );
11371139 }
11381140 notify = plugin .platform ().setItemStackHoverEvent (notify , shop .getItem ());
11391141 sendList .add (notify );
0 commit comments