So I've been working on a modded Client for Minecraft but I can't fix this thing.
(Please don't blame me if this is a obvious fault, because I'm really new to Java and I don't know much.)
Eclipse says that "module" can't be reached and first I thought that I didn't imported the right things into here. But that's not the case... (I think)
Here is the code:
public void setup() {
if(!setup.compareAndSet(false, true))
retu;
final Map<Category, ModuleFrame> CategoryFrames = new HashMap<Category, ModuleFrame>();
for(Module module : ModuleManager.getModules()){
if (module.isCategory(me.Liam_Yves.turbo.module.Category.GUI))
continue;
ModuleFrame frame = CategoryFrames.get(module.getCategory());
if (frame == null){
String name = module.getCategory().name().toLowerCase();
name = Character.toUpperCase(name.charAt(0)) + name.substring(1);
frame = new ModuleFrame(name);
frame.setTheme(getTheme());
frame.setLayoutManager(new GridLayoutManager(1, 0));
frame.setVisible(true);
frame.setClosable(false);
frame.setMinimized(true);
addFrame(frame);
CategoryFrames.put(module.getCategory(), frame);
}
final; Module updateModule = module;
Button button = new BasicButton(module.getName()){
public void update(){
setText(updateModule.getName());
setEnabled(updateModule.getState());
}
};
button.addButtonListener(new ButtonListener() {
@Override
public void onButtonPress(Button button) {
updateModule.toggleModule();
button.setText(updateModule.getName());
button.setEnabled(updateModule.getState());
}
});
frame.add(button, HorizontalGridConstraint.FILL);
}
// Optional equal sizing and auto-positioning
resizeComponents();
Minecraft minecraft = Minecraft.getMinecraft();
Dimension maxSize = recalculateSizes();
int offsetX = 5, offsetY = 5;
int scale = minecraft.gameSettings.guiScale;
if(scale == 0)
scale = 1000;
int scaleFactor = 0;
while(scaleFactor < scale && minecraft.displayWidth / (scaleFactor + 1) >= 320 && minecraft.displayHeight / (scaleFactor + 1) >= 240)
scaleFactor++;
for(Frame frame : getFrames()) {
frame.setX(offsetX);
frame.setY(offsetY);
offsetX += maxSize.width + 5;
if(offsetX + maxSize.width + 5 > minecraft.displayWidth / scaleFactor) {
offsetX = 5;
offsetY += maxSize.height + 5;
}
}
}
If you want to see more of the code or codes from other classes just comment down below! I really need your help!
