lukflug / PanelStudio

An extensible and customizable GUI API/library to create ClickGUIs, HUDEditors and TabGUIs designed for use in Minecraft utility mods.
https://lukflug.github.io/panelstudio.html
MIT License
309 stars 23 forks source link

Game crashes when trying to load the mod(i added mixins so that might be the problem) #26

Closed keirman1 closed 2 years ago

keirman1 commented 2 years ago
---- Minecraft Crash Report ----

WARNING: coremods are present:
  MixinLoader (AsdawareGUI-0.1-release.jar)
Contact their authors BEFORE contacting forge

// Why did you do that?

Time: 2/2/22 8:19 AM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Asdaware (awc)
Caused by: java.lang.NoClassDefFoundError: me/asdacashier/asdaware/module/Category
    at me.asdacashier.asdaware.AsdaWare.addModules(AsdaWare.java:46)
    at me.asdacashier.asdaware.AsdaWare.init(AsdaWare.java:62)
lukflug commented 2 years ago

Seems like something is wrong with your mixin. Unless that Category class extends or implements a PanelStudio class, this is not a PanelStudio issue.

keirman1 commented 2 years ago

This is my category `package me.asdacashier.asdaware.module;

import java.awt.Color; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.stream.Stream;

import me.asdacashier.asdaware.setting.BooleanSetting; import me.asdacashier.asdaware.setting.ColorSetting; import me.asdacashier.asdaware.setting.DoubleSetting; import me.asdacashier.asdaware.setting.IntegerSetting; import me.asdacashier.asdaware.setting.Setting; import me.asdacashier.asdaware.setting.StringSetting; import com.lukflug.panelstudio.setting.ICategory; import com.lukflug.panelstudio.setting.IClient; import com.lukflug.panelstudio.setting.IModule;

public enum Category implements ICategory { COMBAT("Combat"),EXPLOITS("Exploits"),HUD("HUD"),MISCELLANEOUS("Misc"),MOVEMENT("Movement"),RENDER("Render"),WORLD("World"); public final String displayName; public final List modules=new ArrayList();

Category(String displayName) {
    this.displayName=displayName;
}

public static void init() {

}

@Override
public String getDisplayName() {
    return displayName;
}

@Override
public Stream<IModule> getModules() {
    return modules.stream().map(module->module);
}

public static IClient getClient() {
    return new IClient() {
        @Override
        public Stream<ICategory> getCategories() {
            return Arrays.stream(Category.values());
        }
    };
}

}

`

lukflug commented 2 years ago

How does your Mixin look like?

keirman1 commented 2 years ago

i fixed it all but how do i check if a module is toggled in a module class?

lukflug commented 2 years ago

The IModule class has a isEnabled method that returns an IToggleable indicating whether the module is enabled. If it is null, the module has no on/off state. Otherwise you can query the state via module.isEnabled().isOn().

keirman1 commented 2 years ago

also how do i have something that always updates in a module

lukflug commented 2 years ago

I don't exactly understand what you mean. But any change in the value/name of a setting will be shown immediately.

keirman1 commented 2 years ago

nvm

keirman1 commented 2 years ago

ill use alpine

keirman1 commented 2 years ago

so how would i make a module lets say makes some1 always sprint so always runs mc.player.setSprinting(true) how would i do this

lukflug commented 2 years ago

PanelStudio is for rendering the GUI, not for the actual functionality of modules (except ofc HUD modules)

keirman1 commented 2 years ago

oh ok