More Profile Handling + Login Packet

This commit is contained in:
Kam committed 2025-02-18 22:22:40 -05:00
1 parent 36181d5165
commit e8f657f7e6
17 files changed
+294 -223

No files matched your search

+2 -1
View File
@@ -267,7 +267,8 @@ public class CustomNpcs {
public void serverstart(FMLServerStartingEvent event) {
event.registerServerCommand(new CommandNoppes());
event.registerServerCommand(new CommandKamkeel());
event.registerServerCommand(new CommandProfile());
if(ConfigMain.ProfilesEnabled)
event.registerServerCommand(new CommandProfile());
}
private void registerNpc(Class<? extends Entity> cl, String name) {
@@ -23,6 +23,10 @@ public class ClientCacheHandler {
public static Party party;
public static boolean allowProfiles = true;
public static boolean allowParties = true;
public static ImageData getImageData(String directory) {
synchronized (imageDataCache) {
if (!imageDataCache.containsKey(directory)) {
@@ -1,10 +1,9 @@
package noppes.npcs.client.gui.player.inventory;
import cpw.mods.fml.common.Loader;
import kamkeel.npcs.addon.client.DBCClient;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.client.ClientCacheHandler;
import noppes.npcs.client.gui.util.GuiMenuSideButton;
import noppes.npcs.client.gui.util.GuiNPCInterface;
import noppes.npcs.config.ConfigClient;
@@ -41,13 +40,14 @@ public class GuiCNPCInventory extends GuiNPCInterface {
questsButton.renderResource = specialIcons;
addButton(questsButton);
y += 21;
GuiMenuSideButton partyButton = new GuiMenuSideButton(-101, guiLeft + xSize + 37, this.guiTop + y, 22, 22, "");
partyButton.rightSided = true;
partyButton.active = activeTab == -101;
partyButton.renderResource = specialIcons;
addButton(partyButton);
if(ClientCacheHandler.allowParties){
y += 21;
GuiMenuSideButton partyButton = new GuiMenuSideButton(-101, guiLeft + xSize + 37, this.guiTop + y, 22, 22, "");
partyButton.rightSided = true;
partyButton.active = activeTab == -101;
partyButton.renderResource = specialIcons;
addButton(partyButton);
}
if(ConfigClient.enableFactionTab){
y += 21;
GuiMenuSideButton factionButton = new GuiMenuSideButton(-102, guiLeft + xSize + 37, this.guiTop + y, 22, 22, "");
@@ -57,7 +57,7 @@ public class GuiCNPCInventory extends GuiNPCInterface {
factionButton.renderResource = specialIcons;
addButton(factionButton);
}
if(ConfigMain.EnableProfiles){
if(ClientCacheHandler.allowProfiles){
y += 21;
GuiMenuSideButton profileButton = new GuiMenuSideButton(-104, guiLeft + xSize + 37, this.guiTop + y, 22, 22, "");
profileButton.rightSided = true;
@@ -80,7 +80,13 @@ public class ConfigMain
public static Property DefaultMaxPartySizeProperty;
public static int DefaultMaxPartySize = 4;
public static boolean EnableProfiles = true;
/**
* Profile Properties
**/
public static boolean ProfilesEnabled = true;
public static boolean AllowProfileBackups = true;
public static int ProfileBackupAmount = 5;
/**
* General NPC Properties
@@ -220,7 +226,9 @@ public class ConfigMain
TrackedQuestUpdateFrequency = TrackedQuestUpdateFrequencyProperty.getInt(5);
// PROFILES
EnableProfiles = config.get(PROFILES, "Enable Profiles", true, "Allow the use of character Profiles").getBoolean(true);
ProfilesEnabled = config.get(PROFILES, "Enable Profiles", true, "Allow the use of character Profiles").getBoolean(true);
AllowProfileBackups = config.get(PROFILES, "Enable Profile Backups", true, "Will create backups of profile changes").getBoolean(true);
ProfileBackupAmount = config.get(PROFILES, "Number of Backups", 5, "How many backups per player to save").getInt(5);
// Convert to Legacy
if(CustomNpcs.legacyExist){