Skip to content

Commit

Permalink
Add option to disable transaction logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Jan 28, 2025
1 parent a1f722f commit 2b3c46a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Core/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License: https://github.com/TheNewEconomy/EconomyCore/blob/main/license.md
Core:

config-version: 5
config-version: 6

#Cracked Server? Set this to true. May cause data issues as spigot/paper UUIDs are unpredictable.
#Do not change this unless you know what you're doing.
Expand Down Expand Up @@ -142,6 +142,9 @@ Core:
#All configurations relating to the transaction system.
Transactions:

#Should transactions be recorded?
Record: true

#The time format to use when displaying transaction history data.
Format: "M, d y"

Expand Down
6 changes: 5 additions & 1 deletion Core/src/net/tnemc/core/manager/ReceiptManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import net.tnemc.core.config.MainConfig;
import net.tnemc.core.transaction.Receipt;

import java.util.ArrayList;
Expand Down Expand Up @@ -48,7 +49,10 @@ public class ReceiptManager {
*/
public void log(final Receipt receipt) {

receipts.put(receipt.getId(), receipt);
if(MainConfig.yaml().getBoolean("Core.Transactions.Record")) {

receipts.put(receipt.getId(), receipt);
}
}

/**
Expand Down

0 comments on commit 2b3c46a

Please sign in to comment.