Skip to content

Commit 904fffa

Browse files
committed
Initial registry update stuff and starting to put more items within PU
1 parent 4f30645 commit 904fffa

3 files changed

Lines changed: 114 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package parallelmc.parallelutils.modules.datafixerupper;
2+
3+
import org.bukkit.Bukkit;
4+
import org.bukkit.configuration.file.FileConfiguration;
5+
import org.bukkit.plugin.Plugin;
6+
import org.bukkit.plugin.PluginManager;
7+
import org.bukkit.plugin.java.JavaPlugin;
8+
import org.jetbrains.annotations.NotNull;
9+
import parallelmc.parallelutils.Constants;
10+
import parallelmc.parallelutils.ParallelClassLoader;
11+
import parallelmc.parallelutils.ParallelModule;
12+
import parallelmc.parallelutils.ParallelUtils;
13+
import parallelmc.parallelutils.modules.bitsandbobs.commands.Hat;
14+
import parallelmc.parallelutils.modules.bitsandbobs.minimodules.*;
15+
import parallelmc.parallelutils.modules.bitsandbobs.minimodules.togglepvp.OnPvp;
16+
import parallelmc.parallelutils.modules.bitsandbobs.minimodules.togglepvp.TogglePvpCommand;
17+
import parallelmc.parallelutils.modules.bitsandbobs.minimodules.togglepvp.TogglePvpManager;
18+
import parallelmc.parallelutils.util.BukkitTools;
19+
20+
import java.util.List;
21+
import java.util.logging.Level;
22+
23+
public class DataFixerUpper extends ParallelModule {
24+
25+
public DataFixerUpper(ParallelClassLoader classLoader, List<String> dependents) {
26+
super(classLoader, dependents);
27+
}
28+
29+
30+
@Override
31+
public void onLoad() {
32+
33+
}
34+
35+
@Override
36+
public void onEnable() {
37+
// PluginManager manager = Bukkit.getPluginManager();
38+
// Plugin plugin = manager.getPlugin(Constants.PLUGIN_NAME);
39+
Plugin plugin = BukkitTools.getPlugin();
40+
if (plugin == null) {
41+
ParallelUtils.log(Level.SEVERE, "Unable to enable DataFixerUpper. Plugin " + Constants.PLUGIN_NAME + " does not exist!");
42+
return;
43+
}
44+
45+
ParallelUtils puPlugin = (ParallelUtils) plugin;
46+
if (!puPlugin.registerModule(this)) {
47+
ParallelUtils.log(Level.SEVERE, "Unable to register module DataFixerUpper! Module may already be registered. Quitting...");
48+
return;
49+
}
50+
}
51+
52+
@Override
53+
public void onDisable() {
54+
55+
}
56+
57+
@Override
58+
public void onUnload() {
59+
60+
}
61+
62+
@NotNull
63+
@Override
64+
public String getName() {
65+
return "DataFixerUpper";
66+
}
67+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package parallelmc.parallelutils.modules.datafixerupper;
2+
3+
import org.bukkit.inventory.ItemStack;
4+
import parallelmc.parallelutils.modules.parallelitems.ParallelItems;
5+
6+
public class UpdateItem {
7+
8+
/**
9+
* NOTE: ALL ITEMS BEING CHECKED FOR UPDATES HERE ARE BEING UPDATED TO THEIR LATEST VERSIONS AS OF:
10+
* OCTOBER 7, 2025. THIS MEANS THAT CURRENTLY, ALL OLD HATS ARE BEING UPGRADED ASSUMING:
11+
* - NO ONE BOUGHT THEM FROM THE ONLINE STORE
12+
* - NONE OF THEM HAVE HELMET STATS BOUND TO THEM
13+
* IF EITHER OF THE ABOVE ARE TRUE, THEY ARE CONSIDERED UP TO DATE ALREADY AND WILL NOT BE CHECKED FOR AN UPDATE BELOW
14+
*/
15+
16+
private ParallelItems parallelItems;
17+
18+
public UpdateItem() {
19+
// parallelItems
20+
}
21+
22+
public static ItemStack updateItem() {
23+
// TODO: CHECK FOR OLD ITEMREGISTRYID NUMBER ITEMS, NON-PU HATS & ITEMS (NMS), OLD FISH,
24+
// AND ITEMS THAT HAVE NEW FEATURES IN GENERAL
25+
return null;
26+
}
27+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package parallelmc.parallelutils.modules.datafixerupper.events;
2+
3+
import org.bukkit.event.EventHandler;
4+
import org.bukkit.event.Listener;
5+
import org.bukkit.event.player.PlayerJoinEvent;
6+
import org.bukkit.inventory.ItemStack;
7+
import org.bukkit.inventory.PlayerInventory;
8+
import parallelmc.parallelutils.modules.datafixerupper.UpdateItem;
9+
10+
public class PlayerJoinListener implements Listener {
11+
12+
@EventHandler
13+
public void onPlayerJoin(PlayerJoinEvent event) {
14+
PlayerInventory inventory = event.getPlayer().getInventory();
15+
for (int i = 0; i < inventory.getSize(); i++) {
16+
ItemStack item = inventory.getItem(i);
17+
// UpdateItem.updateItem()
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)