make it work in dev environments
This commit is contained in:
parent
42685815c2
commit
525a538c42
5 changed files with 34 additions and 9 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -3,3 +3,8 @@
|
|||
/build/
|
||||
/obf/
|
||||
/Obf/
|
||||
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
/.idea/
|
7
Client/.gitignore
vendored
7
Client/.gitignore
vendored
|
@ -39,4 +39,9 @@ bin/
|
|||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
|
||||
|
||||
|
||||
run/
|
|
@ -8,16 +8,20 @@ import com.baseband.client.module.Module;
|
|||
import com.baseband.client.module.modules.*;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import tudbut.tools.Lock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Mod(modid = "baseband")
|
||||
public class BaseBand {
|
||||
public static int majorVersion = 1;
|
||||
public static int buildNumber = 3;
|
||||
public static String hash = "775f55b8c02f8a4e";
|
||||
public static int buildNumber = 14;
|
||||
public static String hash = "40f9263e7e638bf5";
|
||||
|
||||
public static String name = "BaseBand";
|
||||
public long timeOfCompile = 1694681365260L;
|
||||
|
@ -27,16 +31,20 @@ public class BaseBand {
|
|||
|
||||
|
||||
public ArrayList<Module> modules = new ArrayList<>();
|
||||
public static BaseBand INSTANCE;
|
||||
public static BaseBand INSTANCE; { INSTANCE = this; }
|
||||
|
||||
public static BaseBand getInstance() {
|
||||
if(INSTANCE == null) {
|
||||
INSTANCE = new BaseBand();
|
||||
new BaseBand();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
public static final Logger log = LogManager.getLogger("BaseBand");
|
||||
|
||||
@Mod.EventHandler
|
||||
public void eventInit(FMLPreInitializationEvent event) {
|
||||
onInit();
|
||||
}
|
||||
|
||||
public void onInit() {
|
||||
Utils.check();
|
||||
|
|
|
@ -123,7 +123,8 @@ public class GuiBB extends GuiScreen {
|
|||
resetButtons();
|
||||
}
|
||||
// Call onTick on every button
|
||||
for (Button button : buttons) {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
Button button = buttons[i];
|
||||
if (button != null)
|
||||
button.onTick(this);
|
||||
}
|
||||
|
@ -175,7 +176,8 @@ public class GuiBB extends GuiScreen {
|
|||
cy = mouseY;
|
||||
|
||||
// Notify buttons
|
||||
for (Button button : buttons) {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
Button button = buttons[i];
|
||||
if (button != null)
|
||||
if (button.mouseClicked(mouseX, mouseY, mouseButton))
|
||||
return;
|
||||
|
@ -200,7 +202,8 @@ public class GuiBB extends GuiScreen {
|
|||
cy = mouseY;
|
||||
|
||||
// Notify buttons
|
||||
for (Button button : buttons) {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
Button button = buttons[i];
|
||||
if (button != null)
|
||||
button.mouseReleased();
|
||||
}
|
||||
|
@ -227,7 +230,8 @@ public class GuiBB extends GuiScreen {
|
|||
//}
|
||||
int m = -Mouse.getDWheel();
|
||||
if(m != 0) {
|
||||
for (Button button : buttons) {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
Button button = buttons[i];
|
||||
if (button != null) {
|
||||
button.y += (lastScrollPos - m) / 3;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,9 @@ public class Utils {
|
|||
|
||||
//Check if we have the loader
|
||||
try {
|
||||
// funny bypass for dev env
|
||||
if(new File("../../Client").isDirectory())
|
||||
return;
|
||||
Class.forName("org.baseband.launcher.Tweaker");
|
||||
} catch (Exception e) {
|
||||
crash();
|
||||
|
|
Loading…
Add table
Reference in a new issue