Skip to content

Commit

Permalink
Remove uwanted logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Reldeam committed Feb 1, 2022
1 parent eaca13b commit 0e07616
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 31 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ The format is as follows:

_<custom trade>_
```yaml
result: <item stack> # (required) The item the trader is selling
result: <item stack> | <money> # (required) The item the trader is selling
# (see <item stack>)

ingredients:
- <item stack> # (required) The first item the trader wants
- <item stack> # (optional) The second item the trader wants
- <item stack> | <money> # (required) The first item the trader wants
- <item stack> | <money> # (optional) The second item the trader wants

maxUses: <number> # (required) The number of times this trade can be made
# before needing to be refreshed
Expand Down Expand Up @@ -112,6 +112,17 @@ attributeModifiers: [<attribute modifier>] # (optional) A list of attribute
# modifiers
```

_&lt;money&gt;_



```yaml
money: <number>

# Vault and an Economy plugin must be installed, and `enableEconomy` must be set
# to `true` for money items to work.
```

_&lt;enchantment&gt;_
```yaml
type: <enchantment type> # The type of enchantment
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>online.meinkraft</groupId>
<artifactId>customvillagertrades</artifactId>
<packaging>jar</packaging>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>
<name>CustomVillagerTrades</name>
<url>http://maven.apache.org</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void onEnable() {
isVanillaTradesAllowed = !getConfig().getBoolean("disableVanillaTrades");
isEconomyEnabled = getConfig().getBoolean("enableEconomy");
toolMaterial = Material.getMaterial(getConfig().getString("tool"));
currencyMaterial = Material.getMaterial(getConfig().getString("currency"));
currencyMaterial = Material.getMaterial(getConfig().getString("currencyItem"));
currencyPrefix = getConfig().getString("currencyPrefix");
currencySuffix = getConfig().getString("currencySuffix");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void onInventoryClickEvent(InventoryClickEvent event) {
if(item != null) {
ItemMeta itemMeta = item.getItemMeta();
if(itemMeta != null) {

PersistentDataContainer itemData = itemMeta.getPersistentDataContainer();
Double money = itemData.get(
NamespacedKey.fromString("money", plugin),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public void onTradeSelectEvent(TradeSelectEvent event) {

}
}

System.out.println("cleaning up money");

// prevent money getting into players inventories
plugin.getServer().getScheduler().runTask(
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enableEconomy: false

# The item that will represent a trade involving your Vault Economy as an
# ingredient or as a result
currency: PAPER
currencyItem: PAPER

# The strings that goes before and after on the cost on a money item:
# "<currencyPrefix><amount><currencySuffix>"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: online.meinkraft.customvillagertrades.CustomVillagerTrades
name: CustomVillagerTrades
version: 1.1-SNAPSHOT
version: 1.2-SNAPSHOT
description: Adds custom villager trades
api-version: 1.18
load: STARTUP
Expand Down
103 changes: 81 additions & 22 deletions src/main/resources/trades.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
# ------------------------------------------------------------------------------
# This file contains all of the custom trades that you're villagers can learn
# just like they acquire Vanilla Minecraft trades.
#
# For more information on how to create your own custom trades, see:
# https://github.com/Reldeam/CustomVillagerTrades/blob/main/README.md
#
# Below are a few examples to get you started. This plugin starts working
# straight away, so feel free to delete these examples if you don't want to
# have your players running around with a, "Cool Axey Boi"!
#
# If you need to find the examples again, you can get them here:
# https://tinyurl.com/cvttrades
# ------------------------------------------------------------------------------

# This trade can be acquired by a mason with a 50% chance each time the
# villager acquires a new trade.

# The trade is 24 emeralds for 10 iron ingots, it can be made up to 4 times
# before the villager will need to refresh their stock.

# The trade gives 2 experience to the villager, but none to the player.

"ingotForEmerald":
result:
material: IRON_INGOT
amount: 24
ingredients:
- material: EMERALD
amount: 10
maxUses: 6
experience: 10
chance: 0.5
professions: [MASON]

# This trade takes some arrows and a glowstone dust and give you a spectral
# arrows in return, which might be a nice alternative to the vanilla trade
# for spectral arrows

"spectralArrows":
result:
material: SPECTRAL_ARROW
amount: 5
ingredients:
- material: ARROW
amount: 5
- material: GLOWSTONE_DUST
maxUses: 12
experience: 5
chance: 0.2
levels: [5]
professions: [FLETCHER]

# To get this trade, you need to have a SNOW type villager in the BASALT DELTA
# biome of The Nether when the reach Master level (5) as an ARMORER. There is
# still only a 5% chance of acquiring this trade if you meet all of those
# conditions.

# The trade is 20 EMERALDS and a NETHER STAR for 2 NETHER SCRAP. You can make
# this trade 2 times before the villager needs to replenish its stock.

"netheriteScrapforStar":
result:
material: NETHERITE_SCRAP
amount: 2
ingredients:
- material: EMERALD
amount: 20
- material: NETHER_STAR
maxUses: 2
chance: 0.05
experience: 50
levels: [5]
villagerTypes: [SNOW]
professions: [ARMORER]
biomes: [BASALT_DELTAS]

# This trade can be acquired by a desert type villager that is in a desert or
# badlands biome, has a weaponsmith profession, and has just become either an
# apprentice (level 2) or a journeyman (level 3). There is a 10% chance they
Expand Down Expand Up @@ -35,31 +112,11 @@
villagerTypes: [DESERT]
biomes: [DESERT, BADLANDS]

# This trade can be acquired by a mason with a 50% chance each time the
# villager acquires a new trade.

# The trade is 24 emeralds for 10 iron ingots, it can be made up to 4 times
# before the villager will need to refresh their stock.

# The trade gives 2 experience to the villager, but none to the player.

"ingotForEmerald":
result:
material: IRON_INGOT
amount: 24
ingredients:
- material: EMERALD
amount: 10
maxUses: 6
experience: 10
chance: 0.5
professions: [MASON]

# Upgrade a diamond pickaxe for the cost of 20 emeralds so that it has
# attribute modifiers that increase your armor by a large amount when you
# hold it in your hand.

"bulkyPick"
"bulkyPick":
result:
material: DIAMOND_PICKAXE
attributeModifiers:
Expand All @@ -81,6 +138,7 @@
professions: [WEAPONSMITH]

# Buy a diamond for 150 units of your Vault Economy currency.
# This trade requires Vault and an Econony plugin in work.

"diamondForMoney":
result:
Expand All @@ -92,10 +150,11 @@
chance: 0.1

# Sell a diamond for 100 units of your Vault Economy currency.
# This trade requires Vault and an Econony plugin in work.

"moneyForDiamond":
result:
material: 100
money: 100
ingredients:
- material: DIAMOND
maxUses: 20
Expand Down

0 comments on commit 0e07616

Please sign in to comment.