Skip to content

Commit

Permalink
Fix some things
Browse files Browse the repository at this point in the history
  • Loading branch information
PeytonPlayz595 committed Jul 8, 2024
1 parent f91cdb2 commit f20012c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private int[] parseItems(String str, String str2) {
int j = Config.parseInt(s, -1);

if (j >= 0) {
set.add(new Integer(j));
set.add(Integer.valueOf(j));
} else {
if (s.contains("-")) {
String[] astring1 = Config.tokenize(s, "-");
Expand All @@ -183,7 +183,7 @@ private int[] parseItems(String str, String str2) {
continue label45;
}

set.add(new Integer(k1));
set.add(Integer.valueOf(k1));
++k1;
}
}
Expand All @@ -200,7 +200,7 @@ private int[] parseItems(String str, String str2) {
if (i2 <= 0) {
Config.warn("Item not found: " + s);
} else {
set.add(new Integer(i2));
set.add(Integer.valueOf(i2));
}
}
}
Expand Down
34 changes: 17 additions & 17 deletions src/teavm/java/net/PeytonPlayz585/shadow/input/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Controller {
private static double cursorThreshold = 0.4;

private static int activeController = -1;
private static ButtonState[] states = new ButtonState[30];
private static ButtonState[] button = new ButtonState[30];

public static HTMLImageElement cursor;

Expand Down Expand Up @@ -92,39 +92,39 @@ public static boolean sprint() {
}

public static boolean itemChangeLeft() {
return states[4] == ButtonState.PRESSED;
return button[4] == ButtonState.PRESSED;
}

public static boolean itemChangeRight() {
return states[5] == ButtonState.PRESSED;
return button[5] == ButtonState.PRESSED;
}

public static boolean inventory() {
return states[2] == ButtonState.PRESSED || states[3] == ButtonState.PRESSED;
return button[2] == ButtonState.PRESSED || button[3] == ButtonState.PRESSED;
}

public static boolean togglePerspective() {
return states[12] == ButtonState.PRESSED;
return button[12] == ButtonState.PRESSED;
}

public static boolean playerList() {
return states[15] == ButtonState.HELD;
return button[15] == ButtonState.HELD;
}

public static boolean smoothCamera() {
return states[14] == ButtonState.PRESSED;
return button[14] == ButtonState.PRESSED;
}

public static boolean dropItem() {
return states[13] == ButtonState.PRESSED;
return button[13] == ButtonState.PRESSED;
}

public static boolean isButtonPressed(int i) {
return states[i] == ButtonState.PRESSED;
return button[i] == ButtonState.PRESSED;
}

public static boolean isButtonDown(int i) {
return states[i] == ButtonState.HELD;
return button[i] == ButtonState.HELD;
}

private static void updateAxes(Gamepad gamePad) {
Expand Down Expand Up @@ -170,15 +170,15 @@ private static void updateButtons(Gamepad gamePad, int index) {
resetButtonStates();
}

if(states[i] == ButtonState.PRESSED) {
states[i] = ButtonState.HELD;
if(button[i] == ButtonState.PRESSED) {
button[i] = ButtonState.HELD;
} else {
if(!(states[i] == ButtonState.HELD)) {
states[i] = ButtonState.PRESSED;
if(!(button[i] == ButtonState.HELD)) {
button[i] = ButtonState.PRESSED;
}
}
} else if(!gamePad.getButtons()[i].isPressed() && index == activeController) {
states[i] = ButtonState.DEFAULT;
button[i] = ButtonState.DEFAULT;
}
}
}
Expand Down Expand Up @@ -232,8 +232,8 @@ private static Gamepad getGamepad(int index) {
}

private static void resetButtonStates() {
for(int i = 0; i < states.length; i++) {
states[i] = ButtonState.DEFAULT;
for(int i = 0; i < button.length; i++) {
button[i] = ButtonState.DEFAULT;
}
}

Expand Down
8 changes: 1 addition & 7 deletions src/teavm/java/net/eaglerforge/EaglerForge.java

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions src/teavm/java/net/minecraft/client/Minecraft.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.minecraft.client;

import static net.eaglerforge.EaglerForge.removeanvil;
import net.eaglerforge.EaglerForge;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;

import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL._wglBindFramebuffer;
Expand Down Expand Up @@ -393,7 +393,6 @@ public void run() {
* settings, etcetera.
*/
private void startGame() throws IOException {
EaglerForge.init();
this.modapi = new ModAPI(theMinecraft);
this.gameSettings = new GameSettings(this);
Config.initDisplay();
Expand Down Expand Up @@ -506,11 +505,13 @@ public String formatString(String parString1) {

this.displayGuiScreen(new GuiScreenEditProfile(mainMenu));

removeanvil();
EaglerForge.removeanvil();
this.renderEngine.deleteTexture(this.mojangLogo);
this.mojangLogo = null;
this.loadingScreen = new LoadingScreenRenderer(this);

EaglerForge.log.info("Loading mods!");

//(EaglerForge bug)
modapi.onFrame(); //Mods were loaded before onFrame is called
ModAPI.setGlobal("settings", this.gameSettings.makeModData());
Expand Down Expand Up @@ -670,6 +671,13 @@ private void drawSplashScreen(TextureManager textureManagerInstance) {
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(GL_GREATER, 0.1F);
this.updateDisplay();

try {
Thread.sleep(1l);
} catch (InterruptedException e) {
e.printStackTrace();
}
EaglerForge.displayanvil();
}

public void func_181536_a(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, int parInt7,
Expand Down

0 comments on commit f20012c

Please sign in to comment.