Skip to content

Commit 6963c16

Browse files
committed
feat!: deprecate GemVillagers, TreasureGems, and MoreMobHeads
GemVillagers and TreasureGems are gone from VanillaTweaks so there's nothing to update them from anymore. MoreMobHeads is getting too unwieldy to implement as a plugin and using the datapack isn't a performance hit because it is just loot tables.
1 parent a00cfbc commit 6963c16

File tree

15 files changed

+358
-772
lines changed

15 files changed

+358
-772
lines changed

scripts/gem_villagers.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

scripts/more_mob_heads.py

Lines changed: 0 additions & 110 deletions
This file was deleted.

scripts/treasure_gems.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

scripts/wandering_trades.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ def run():
2626
sell_tag: Compound = nbt["sell"]
2727
heads.append({
2828
"maxUses": int(nbt["maxUses"]),
29-
"secondaryCost": str(nbt["buyB"]["id"]),
30-
"headCount": int(sell_tag["Count"]),
31-
"name": str(sell_tag["tag"]["display"]["Name"]),
32-
"uuid": str(array_to_uuid(sell_tag["tag"]["SkullOwner"]["Id"])),
33-
"texture": sell_tag["tag"]["SkullOwner"]["Properties"]["textures"][0]["Value"]
29+
"secondaryCost": str(nbt["buyB"]["id"]) if "buyB" in nbt else None,
30+
"headCount": int(sell_tag["count"]),
31+
"name": str(sell_tag["components"]["minecraft:item_name"]),
32+
"texture": sell_tag["components"]["minecraft:profile"]["properties"][0]["value"]
3433
})
3534
with open("../src/main/resources/data/wandering_trades.json", "w") as out:
3635
out.write(dumps(heads, ensure_ascii=False, indent=2) + "\n")

src/main/java/me/machinemaker/papertweaks/modules/hermitcraft/gemvillagers/GemVillagers.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
2525
import com.google.inject.Inject;
2626
import com.google.inject.name.Named;
27-
import java.io.IOException;
2827
import java.util.Collection;
2928
import java.util.Collections;
3029
import java.util.Map;
@@ -59,7 +58,7 @@ public class GemVillagers extends ModuleBase {
5958

6059
@Override
6160
protected Class<? extends ModuleLifecycle> lifecycle() {
62-
return ModuleLifecycle.Empty.class;
61+
return Lifecycle.class;
6362
}
6463

6564
@Override
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package me.machinemaker.papertweaks.modules.hermitcraft.gemvillagers;
2+
3+
import jakarta.inject.Inject;
4+
import java.util.Set;
5+
import me.machinemaker.papertweaks.modules.ModuleCommand;
6+
import me.machinemaker.papertweaks.modules.ModuleConfig;
7+
import me.machinemaker.papertweaks.modules.ModuleLifecycle;
8+
import me.machinemaker.papertweaks.modules.ModuleListener;
9+
import me.machinemaker.papertweaks.modules.ModuleRecipe;
10+
import org.bukkit.plugin.java.JavaPlugin;
11+
12+
class Lifecycle extends ModuleLifecycle {
13+
14+
@Inject
15+
protected Lifecycle(final JavaPlugin plugin, final Set<ModuleCommand> commands, final Set<ModuleListener> listeners, final Set<ModuleConfig> configs, final Set<ModuleRecipe<?>> moduleRecipes) {
16+
super(plugin, commands, listeners, configs, moduleRecipes);
17+
}
18+
19+
@Override
20+
public void onEnable() {
21+
GemVillagers.LOGGER.error("Please disable GemVillagers. GemVillagers is deprecated and won't be updated or supported in 1.21+. It may be removed in future versions.");
22+
super.onEnable();
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package me.machinemaker.papertweaks.modules.hermitcraft.treasuregems;
2+
3+
import jakarta.inject.Inject;
4+
import java.util.Set;
5+
import me.machinemaker.papertweaks.modules.ModuleCommand;
6+
import me.machinemaker.papertweaks.modules.ModuleConfig;
7+
import me.machinemaker.papertweaks.modules.ModuleLifecycle;
8+
import me.machinemaker.papertweaks.modules.ModuleListener;
9+
import me.machinemaker.papertweaks.modules.ModuleRecipe;
10+
import org.bukkit.plugin.java.JavaPlugin;
11+
12+
class Lifecycle extends ModuleLifecycle {
13+
14+
@Inject
15+
protected Lifecycle(final JavaPlugin plugin, final Set<ModuleCommand> commands, final Set<ModuleListener> listeners, final Set<ModuleConfig> configs, final Set<ModuleRecipe<?>> moduleRecipes) {
16+
super(plugin, commands, listeners, configs, moduleRecipes);
17+
}
18+
19+
@Override
20+
public void onEnable() {
21+
TreasureGems.LOGGER.error("Please disable TreasureGems. TreasureGems is deprecated and won't be updated or supported in 1.21+. It may be removed in future versions.");
22+
super.onEnable();
23+
}
24+
}

src/main/java/me/machinemaker/papertweaks/modules/hermitcraft/treasuregems/TreasureGems.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
2727
import com.google.inject.Inject;
2828
import com.google.inject.name.Named;
29-
import java.io.IOException;
3029
import java.util.Collection;
3130
import java.util.Collections;
3231
import java.util.HashMap;
@@ -81,7 +80,7 @@ public class TreasureGems extends ModuleBase {
8180

8281
@Override
8382
protected Class<? extends ModuleLifecycle> lifecycle() {
84-
return ModuleLifecycle.Empty.class;
83+
return Lifecycle.class;
8584
}
8685

8786
@Override

0 commit comments

Comments
 (0)