Skip to content

Commit 979b1ae

Browse files
committed
DupePlus v1.3.0
Updated Code for the v1.3.0
1 parent 85ede88 commit 979b1ae

File tree

11 files changed

+499
-82
lines changed

11 files changed

+499
-82
lines changed

README.md

Lines changed: 101 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ If you ever manage to break the `config.yml` or accidentally emptied the config.
1818
<summary>config.yml</summary>
1919

2020
```yml
21-
# The command's settings
21+
# DupePlus's Settings
2222
# Message Variables
23-
# %dupe_item% = The Duplicated item
24-
# %prefix% = The default prefix or the prefix you set
23+
# %item_type% = The Duplicated item
24+
# %item_name% = The Item's Display Name
25+
# %old_item_count% = The Item Count before dupe
26+
# %new_item_count% = The Item Count after dupe
27+
# %item_count% = Item Count
28+
# %prefix% = The Default prefix or the prefix you set
2529
# %max% = The maximum
2630
# %min% = The minimum
2731

@@ -35,17 +39,29 @@ dupe:
3539
# Permission: dupeplus.dupe
3640
permission: false
3741

42+
3843
# The message sent to the player when try to execute dupe or reloadconfig no permission (Only if the above is true) (Default: "%prefix% <dark_gray>|</dark_gray> <red>You are not allowed to use this command</red>")
44+
# Leave blank for no message
3945
permission-message: "%prefix% <dark_gray>|</dark_gray> <red>You are not allowed to use this command</red>"
4046

41-
# Leave blank for no message (Default: "%prefix% <dark_gray>|</dark_gray> <gray>Duped %dupe_item%</gray>")
42-
# Allowed Message Variables: %prefix%, %raw_dupe_item%, %dupe_item%
43-
message: "%prefix% <dark_gray>|</dark_gray> <gray>Duped %dupe_item%</gray>"
47+
# The message sent to the player when you duplicate an item. (Default: "%prefix% <dark_gray>|</dark_gray> <gray>Duped %item_name%</gray>")
48+
# Allowed Message Variables: %prefix%, %item_type%, %item_name%, %old_item_count%, %new_item_count%
49+
message: "%prefix% <dark_gray>|</dark_gray> <gray>Duped %item_name%</gray>"
4450

4551
# The message sent whenever the player tries to dupe nothing (Air) (Default: "")
4652
# Leave blank for no message
4753
duping-nothing-message: ""
4854

55+
# Checks if the item has a NBT Tag of "dupenotallowed", if it has, it will not dupe the item.
56+
custom-nbt-item:
57+
# Make it false to disable the Custom NBT feature, make it true to enable it (Default: true)
58+
enabled: true
59+
60+
# Allowed message variable: %prefix%, %item_type%, %item_name%, %item_count% (Default: "%prefix% <dark_gray>|</dark_gray> <red>The item is blocked from being duped!</red>")
61+
# Leave blank for no message
62+
blocked-message: "%prefix% <dark_gray>|</dark_gray> <red>The item is blocked from being duped!</red>"
63+
64+
4965
# When using /dupe, in which hand will it dupe? (Default: MainHand)
5066
# OffHand
5167
# MainHand
@@ -59,49 +75,88 @@ dupe:
5975
# Make it false to disable the blacklist, make it true to enable it (Default: false)
6076
enabled: false
6177
# If the player tries to dupe an item that is in (Default: "%prefix% <dark_gray>|</dark_gray> <red>The item is blocked from being duped!</red>")
62-
# Allowed message variable: %prefix%, %dupe_item%
78+
# Allowed message variable: %prefix%, %item_type%, %item_name%, %item_count%
79+
# Leave blank for no message
6380
blocked-message: "%prefix% <dark_gray>|</dark_gray> <red>The item is blocked from being duped!</red>"
64-
# Add or remove items to block them from being duped, also do not include spaces, for an example (NO: "diamond block" YES: "diamond_block")
81+
# Add or remove items to block them from being duped, also do not include spaces. (NO: "diamond block" YES: "diamond_block")
82+
83+
# Begin the item's id with minecraft: to check the item's type only, it will ignore if the item is part of a custom plugin. (Default: - minecraft:barrier)
84+
# Begin the item's id with itemsadder: if you want to check if the item's itemsadder id, it will not check for the namespace.
6585
items:
66-
- barrier
86+
- minecraft:barrier
6787

6888
# Settings for the cooldown of /dupe
6989
cooldown:
7090
# Make it false to disable the cooldown, make it true to enable it. (Default: false)
71-
enable: false
72-
# How many seconds for the cooldowns to be.
91+
enabled: false
92+
93+
# How many seconds for the cooldowns to be. (Default: 3)
7394
seconds: 3
95+
7496
# If the player tries to dupe while the cooldown is set. (Default: "%prefix% <dark_gray>|</dark_gray> <red>Please wait %duration%.</red>")
7597
# Allowed message variable: %prefix%, %duration%
98+
# Leave blank for no message
7699
wait-message: "%prefix% <dark_gray>|</dark_gray> <red>Please wait %duration%.</red>"
77100

101+
# Make it true if you want players with the permission to ignore the cooldown, make it false if you want everyone to have cooldown. (Default: false)
102+
# Permission: dupeplus.cooldown
103+
permission: true
104+
78105

79106
# Settings for this (ignore if you don't want this) players can still run /dupe
80107
# /dupe <times>
81108
times:
82109
# Make it false to disable this feature, make it true to enable this feature (Default: false)
83110
enabled: false
84111

85-
# 0 for no maximum amount of times the player can run (Default: 5) (Recommended: 5)
112+
# Set it to 0 to disable the times (Default: 5) (Recommended: 5)
86113
# Permission to let a player/group have no maximum regardless of this option: dupeplus.times.max.unlimited
87-
max: 5
114+
# dupeplus.times.max.<name>
115+
max-values:
116+
pro: 10
117+
vip: 8
118+
Default: 5 # Default permission or players without the permission who are using the dupe times.
88119

89120
# If the player puts the value above the maximum then what's the message? (Default: "%prefix% <dark_gray>|</dark_gray> <red>This is higher than maximum! Do something lower than %max%</red>")
90121
# Allowed message variable: %prefix%, %max%, %min%
122+
# Leave blank for no message
91123
max-message: "%prefix% <dark_gray>|</dark_gray> <red>This is higher than maximum! Do something lower than %max%</red>"
92124

93125
# 0 for no minimum amount of times the player can run (Default: 0) (Recommended: 0)
94126
# Permission to let a player/group have no minimum regardless of this option: dupeplus.times.min.unlimited
127+
# It is recommended to just keep this at 0
95128
min: 0
96129

97130
# If the player puts the value below the minimum (Default: "%prefix% <dark_gray>|</dark_gray> <red>This is lower than minimum! Do something higher than %min%</red>")
98131
# Allowed message variable: %prefix%, %max%, %min%
132+
# Leave blank for no message
99133
min-message: "%prefix% <dark_gray>|</dark_gray> <red>This is lower than minimum! Do something higher than %min%</red>"
100134

135+
# Instead of sending the dupe message for every time it duplicates, it sends it one time to stop spam. (Default: true)
136+
one-time-message: true
137+
101138
# Make it false to let everyone allowed to use this command (Default: false)
102139
# Permission: dupeplus.times
103140
permission: false
104141

142+
# Adds lore to the duplicated item.
143+
lore:
144+
# Enables or disables this feature. (Default: false)
145+
enabled: false
146+
147+
# The lore added to the duplicated item. (Default: "<dark_red>*</dark_red> <red>Duplicated Item</red>")
148+
text: "<dark_red>*</dark_red> <red>Duplicated Item</red>"
149+
150+
# The modes on how the plugin will add the lore. (Default: set)
151+
# append: Checks if the dupe lore exists or not, if it doesn't exist then it adds after the last lore or just adds the lore if no lore is present.
152+
# set: Checks if the dupe lore exists or not, if it doesn't exist then it will replace the existing lore with the dupe lore, otherwise it just ignores. (Recommended)
153+
mode: set
154+
155+
# The Integrations that this plugin connects with.
156+
integrations:
157+
# Enables ItemsAdder Integration (Default: true)
158+
itemsadder: true
159+
105160
# Checks for updates using the set API (Modrinth or SpigotMC),
106161
updates:
107162
# Checks on startup for updates, disable if you do not wish to update DupePlus.
@@ -128,13 +183,40 @@ updates:
128183
console-notify-message: "%prefix% | Update DupePlus at %link%"
129184

130185
# Don't edit this
131-
# Previous: 1.1
132-
# config-version: 1.2
133-
config-version: 1.2
186+
# Previous: 1.2
187+
# config-version: 1.3
188+
config-version: 1.3
134189
```
135190
</details>
136191
192+
## Custom NBT
193+
194+
You can make items undupeable by adding a custom NBT data "dupenotallowed", set it to true and the item will be undupeable.
195+
You have to enable the custom-nbt-item in the configuration to use this.
196+
197+
### 1.20.5 and above
198+
In the new change, Minecraft changed NBTs into components, and they also changed how custom tag works, it has to be in the custom_data.
199+
200+
Example:
201+
```
202+
/give @p minecraft:diamond_sword[minecraft:custom_data={dupenotallowed:true}]
203+
```
204+
205+
The command gives you a diamond sword with the undupeable tag in the Component format.
206+
207+
### 1.20.4 and below
208+
Instead of using components, you have to use NBT which is JSON formatted, instead of including the custom tag into the custom_data, you don't have to put it anywhere.
209+
210+
```
211+
/give @P minecraft:diamond_sword{dupenotallowed:true}
212+
```
213+
The command gives you a diamond sword with the undupeable tag in the NBT format.
214+
137215
## Features
216+
- Lore [Add Lore to a duplicated item, don't worry this won't affect the original item]
217+
- Times Max Value (Times) [Give certain groups or players a specific maximum time to duplicate an item.]
218+
- ItemsAdder Support (Blacklist) [Don't be limited to only blacklisting minecraft items, you can blacklist itemsadder items by their IDs, like itemsadder:op_weapon]
219+
- Custom NBT [Another way of blocking item, it's easy, just add {"dupenotallowed": true} to the minecraft:custom_data for 1.20.5 and above, or as its own tag for 1.20.4 and below]
138220
- Update Checker [Don't be living under a rock, new features that improve the Dupe System in your server]
139221
- Blacklist [Block items from being duped]
140222
- Times Support [Dupe the item several times.]
@@ -170,12 +252,7 @@ Server Software this plugin supports and recommend to use: Bold & ^
170252
- Fabric#
171253
- Forge#
172254

173-
## Upcoming 1.3.0
174-
- Replace Minecraft Item Type to Minecraft Item Identifier, TRIDENT -> minecraft:trident
175-
- %item_name% will show the item's display name
176-
- Support Custom Items like Oraxen and ItemsAdder
177-
- Support for Scripting Plugins like Denizen and Skript
178-
- Support for NBT Tag 1.20.4 and below: {"dupenotallowed": true}, 1.20.5 and above: \[minecraft:custom_data={dupenotallowed:true}]
179-
- Make a SpongeMC version fork for this plugin.
180-
- Add a new configuration that adds lore to duplicated item.
255+
## Upcoming 1.3.1
256+
- [ ] Support PlaceholderAPI
257+
- [ ]
181258
> Note: Please request features in the Issues Tab

dependency-reduced-pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.galaxydevnetwork</groupId>
55
<artifactId>DupePlus</artifactId>
6-
<version>1.2</version>
6+
<version>1.3.0</version>
77
<build>
88
<plugins>
99
<plugin>
@@ -38,6 +38,10 @@
3838
<pattern>org.bstats</pattern>
3939
<shadedPattern>com.galaxydevnetwork</shadedPattern>
4040
</relocation>
41+
<relocation>
42+
<pattern>com.nexomc</pattern>
43+
<shadedPattern>com.galaxydevnetwork</shadedPattern>
44+
</relocation>
4145
</relocations>
4246
</configuration>
4347
</plugin>
@@ -48,6 +52,18 @@
4852
<id>spigot-repo</id>
4953
<url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
5054
</repository>
55+
<repository>
56+
<id>CodeMC</id>
57+
<url>https://repo.codemc.org/repository/maven-public/</url>
58+
</repository>
59+
<repository>
60+
<id>matteodev</id>
61+
<url>https://maven.devs.beer/</url>
62+
</repository>
63+
<repository>
64+
<id>central</id>
65+
<url>https://repo1.maven.org/maven2/</url>
66+
</repository>
5167
</repositories>
5268
<dependencies>
5369
<dependency>
@@ -56,6 +72,12 @@
5672
<version>1.17-R0.1-SNAPSHOT</version>
5773
<scope>provided</scope>
5874
</dependency>
75+
<dependency>
76+
<groupId>dev.lone</groupId>
77+
<artifactId>api-itemsadder</artifactId>
78+
<version>4.0.2-beta-release-11</version>
79+
<scope>provided</scope>
80+
</dependency>
5981
</dependencies>
6082
<properties>
6183
<maven.compiler.target>17</maven.compiler.target>

pom.xml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.galaxydevnetwork</groupId>
88
<artifactId>DupePlus</artifactId>
9-
<version>1.2</version>
9+
<version>1.3.0</version>
1010

1111
<properties>
1212
<maven.compiler.source>17</maven.compiler.source>
@@ -35,6 +35,11 @@
3535
<!-- Replace this with your package! -->
3636
<shadedPattern>com.galaxydevnetwork</shadedPattern>
3737
</relocation>
38+
<relocation>
39+
<pattern>com.nexomc</pattern>
40+
<!-- Replace this with your package! -->
41+
<shadedPattern>com.galaxydevnetwork</shadedPattern>
42+
</relocation>
3843
</relocations>
3944
</configuration>
4045
<executions>
@@ -62,6 +67,18 @@
6267
<id>spigot-repo</id>
6368
<url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
6469
</repository>
70+
<repository>
71+
<id>CodeMC</id>
72+
<url>https://repo.codemc.org/repository/maven-public/</url>
73+
</repository>
74+
<repository>
75+
<id>matteodev</id>
76+
<url>https://maven.devs.beer/</url>
77+
</repository>
78+
<repository>
79+
<id>central</id>
80+
<url>https://repo1.maven.org/maven2/</url>
81+
</repository>
6582
</repositories>
6683

6784
<dependencies>
@@ -72,6 +89,17 @@
7289
<type>jar</type>
7390
<scope>provided</scope>
7491
</dependency>
92+
<dependency>
93+
<groupId>dev.lone</groupId>
94+
<artifactId>api-itemsadder</artifactId>
95+
<version>4.0.2-beta-release-11</version>
96+
<scope>provided</scope>
97+
</dependency>
98+
<dependency>
99+
<groupId>io.github.bananapuncher714</groupId>
100+
<artifactId>nbteditor</artifactId>
101+
<version>7.19.7</version>
102+
</dependency>
75103
<dependency>
76104
<groupId>net.kyori</groupId>
77105
<artifactId>adventure-text-minimessage</artifactId>

src/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/workspace.xml

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)