Skip to content

Commit c958a86

Browse files
committed
add 1.21.9 support for repair, salvage, copper tool and armor (wip)
1 parent 22231df commit c958a86

File tree

8 files changed

+489
-279
lines changed

8 files changed

+489
-279
lines changed

Changelog.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Version 2.2.043
2+
Added support for the new copper tools and weapons added in Minecraft 1.21.9
3+
Added copper tools and armor to repair.vanilla.yml (see notes)
4+
Added copper tools and armor to salvage.vanilla.yml (see notes)
5+
Added many missing buttons, trapdoors, doors, fence gates, etc to the ability/tool blacklists (see notes)
6+
TOOD: Smelting
7+
8+
NOTES:
9+
You will need to manually update your repair.vanilla.yml and salvage.vanilla.yml files to get support for copper tools and armor.
10+
You can find the default config files in the defaults folder at plugins\mcMMO\defaults after running this mcMMO update at least once.
11+
You can use this default file to copy paste if you please, or if you haven't customizes these two config files, simply delete them to have mcMMO regenerate them with the new entries.
12+
mcMMO has an internal blacklist of blocks that abilities and tools won't activate or "ready" on, pretty much anything that is interactable should go on this list, and I performed an audit and there were quite a few missing entries, so I've added them in this update, what this means is you won't click on a button and have it ready your tool anymore, as it should have been doing.
13+
114
Version 2.2.042
215
mcMMO now listens to BlockDropItemEvent at LOW priority instead of HIGHEST
316
Bonus drops from mcMMO now simply modify quantity in BlockDropItemEvent instead of spawning new ItemStacks.

src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.Iterator;
1414
import java.util.List;
1515
import java.util.Set;
16+
import java.util.logging.Level;
1617
import org.bukkit.Material;
1718
import org.bukkit.configuration.ConfigurationSection;
1819
import org.bukkit.inventory.ItemStack;
@@ -153,11 +154,16 @@ protected void loadKeys() {
153154
}
154155

155156
if (noErrorsInRepairable(reason)) {
156-
Repairable repairable = RepairableFactory.getRepairable(
157-
itemMaterial, repairMaterial, null, minimumLevel, maximumDurability,
158-
repairItemType,
159-
repairMaterialType, xpMultiplier, minimumQuantity);
160-
repairables.add(repairable);
157+
try {
158+
final Repairable repairable = RepairableFactory.getRepairable(
159+
itemMaterial, repairMaterial, null, minimumLevel, maximumDurability,
160+
repairItemType,
161+
repairMaterialType, xpMultiplier, minimumQuantity);
162+
repairables.add(repairable);
163+
} catch (Exception e) {
164+
mcMMO.p.getLogger().log(Level.SEVERE,
165+
"Error loading repairable from config entry: " + key, e);
166+
}
161167
}
162168
}
163169
//Report unsupported

src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@ protected void loadKeys() {
6464
LogUtils.debug(mcMMO.p.getLogger(),
6565
"Fixed incorrect Salvage quantities for Netherite gear!");
6666
} catch (IOException e) {
67-
LogUtils.debug(
68-
mcMMO.p.getLogger(),
69-
"Unable to fix Salvage config, please delete the salvage yml file to generate a new one.");
70-
e.printStackTrace();
67+
mcMMO.p.getLogger().log(Level.SEVERE,
68+
"Unable to fix Salvage config, please delete the salvage yml file"
69+
+ " to generate a new one.", e);
7170
}
7271
}
7372

@@ -120,8 +119,7 @@ protected void loadKeys() {
120119
salvageMaterialTypeString.replace(" ", "_")
121120
.toUpperCase(Locale.ENGLISH));
122121
} catch (IllegalArgumentException ex) {
123-
reason.add(
124-
key + " has an invalid MaterialType of " + salvageMaterialTypeString);
122+
reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString);
125123
}
126124
}
127125

@@ -192,11 +190,17 @@ protected void loadKeys() {
192190
}
193191

194192
if (noErrorsInSalvageable(reason)) {
195-
Salvageable salvageable = SalvageableFactory.getSalvageable(
196-
itemMaterial, salvageMaterial, minimumLevel,
197-
maximumQuantity, maximumDurability, salvageItemType, salvageMaterialType,
198-
xpMultiplier);
199-
salvageables.add(salvageable);
193+
try {
194+
final Salvageable salvageable = SalvageableFactory.getSalvageable(
195+
itemMaterial, salvageMaterial, minimumLevel,
196+
maximumQuantity, maximumDurability, salvageItemType,
197+
salvageMaterialType,
198+
xpMultiplier);
199+
salvageables.add(salvageable);
200+
} catch (Exception e) {
201+
mcMMO.p.getLogger().log(Level.SEVERE,
202+
"Error loading salvageable from config entry: " + key, e);
203+
}
200204
}
201205
}
202206
//Report unsupported

src/main/java/com/gmail/nossr50/mcMMO.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import java.nio.charset.StandardCharsets;
7979
import java.util.ArrayList;
8080
import java.util.List;
81+
import java.util.logging.Level;
8182
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
8283
import net.shatteredlands.shatt.backup.ZipLibrary;
8384
import org.bstats.bukkit.Metrics;
@@ -306,7 +307,7 @@ public void onEnable() {
306307
}
307308
}
308309
} catch (Throwable t) {
309-
getLogger().severe("There was an error while enabling mcMMO!");
310+
getLogger().log(Level.SEVERE, "There was an error while enabling mcMMO!", t);
310311

311312
if (!(t instanceof ExceptionInInitializerError)) {
312313
t.printStackTrace();

0 commit comments

Comments
 (0)