fix a crash
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m20s

This commit is contained in:
Daniella / Tove 2024-06-25 09:56:55 +02:00
parent 7466529ffd
commit 943eb36e2d
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
3 changed files with 10 additions and 3 deletions

View file

@ -1,6 +1,7 @@
package de.com.baseband.client; package de.com.baseband.client;
import de.com.baseband.prod.LoadHandler; import de.com.baseband.prod.LoadHandler;
import de.tudbut.parsing.TCNArray;
import net.minecraftforge.common.ForgeVersion; import net.minecraftforge.common.ForgeVersion;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
@ -32,6 +33,7 @@ public class DevStub implements IFMLLoadingPlugin {
LoadHandler.data.set("release-branch", false); LoadHandler.data.set("release-branch", false);
LoadHandler.data.set("branch", "[dev]"); LoadHandler.data.set("branch", "[dev]");
LoadHandler.data.set("username", "root"); LoadHandler.data.set("username", "root");
LoadHandler.data.set("disabledModules", new TCNArray());
} }
@Override @Override

View file

@ -107,7 +107,6 @@ public abstract class Feature extends ToggleButton implements SetCommand {
} }
public final void register(Minecraft mc) { public final void register(Minecraft mc) {
Setup = de.com.baseband.client.Setup.get();
this.mc = mc; this.mc = mc;
this.text = toString(); this.text = toString();

View file

@ -15,9 +15,15 @@ public class Features {
ArrayList<Feature> filteredFeatures = new ArrayList<>(Arrays.asList(Setup.get().Features)); ArrayList<Feature> filteredFeatures = new ArrayList<>(Arrays.asList(Setup.get().Features));
for (int i = 0; i < filteredFeatures.size(); i++) { for (int i = 0; i < filteredFeatures.size(); i++) {
Feature value = filteredFeatures.get(i); Feature value = filteredFeatures.get(i);
value.Setup = de.com.baseband.client.Setup.get();
try {
if (!value.canExist()) { if (!value.canExist()) {
filteredFeatures.remove(i--); filteredFeatures.remove(i--);
} }
} catch (Exception e) {
e.printStackTrace();
BaseBand.LOGGER.error("Unable to check feature {}", value.toString());
}
} }
features = filteredFeatures.toArray(new Feature[0]); features = filteredFeatures.toArray(new Feature[0]);
for (Feature feature : features) { for (Feature feature : features) {