Remove controller support and fix crash
This commit is contained in:
parent
4bb96f9d64
commit
71d2fe5fc9
62980
javascript/classes.js
62980
javascript/classes.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,42 +0,0 @@
|
|||
package net.PeytonPlayz585.shadow;
|
||||
|
||||
import org.teavm.jso.JSBody;
|
||||
|
||||
public class Controller {
|
||||
|
||||
@JSBody(params = {}, script = "return isWalkingForward();")
|
||||
public static native boolean isWalkingForward();
|
||||
|
||||
@JSBody(params = {}, script = "return isWalkingBackward();")
|
||||
public static native boolean isWalkingBackward();
|
||||
|
||||
@JSBody(params = {}, script = "return isWalkingLeft();")
|
||||
public static native boolean isWalkingLeft();
|
||||
|
||||
@JSBody(params = {}, script = "return isWalkingRight();")
|
||||
public static native boolean isWalkingRight();
|
||||
|
||||
@JSBody(params = {}, script = "return getCameraX();")
|
||||
public static native int getCameraX();
|
||||
|
||||
@JSBody(params = {}, script = "return getCameraY();")
|
||||
public static native int getCameraY();
|
||||
|
||||
@JSBody(params = {}, script = "return jump;")
|
||||
public static native boolean isJumping();
|
||||
|
||||
@JSBody(params = {}, script = "return crouch;")
|
||||
public static native boolean isSneaking();
|
||||
|
||||
@JSBody(params = {}, script = "updateController();")
|
||||
public static native void controllerTick();
|
||||
|
||||
@JSBody(params = {}, script = "jump = false;")
|
||||
public static native void unpressJump();
|
||||
|
||||
@JSBody(params = {}, script = "crouch = false;")
|
||||
public static native void unpressCrouch();
|
||||
|
||||
@JSBody(params = {"buttonID"}, script = "return isKeyDown(buttonID);")
|
||||
public static native boolean isButtonPressed(int buttonID);
|
||||
}
|
|
@ -53,6 +53,7 @@ public class GuiScreenEditCape extends GuiScreen {
|
|||
public GuiScreenEditCape(GuiScreen parent, int skinToShow, SkinModel model) {
|
||||
this.parent = parent;
|
||||
this.skinToShow = skinToShow;
|
||||
this.dropDownOptions = defaultVanillaCapeNames;
|
||||
this.selectedSlot = EaglerProfile.presetCapeId;
|
||||
this.model = model;
|
||||
}
|
||||
|
|
|
@ -167,8 +167,6 @@ import net.minecraft.world.WorldProviderEnd;
|
|||
import net.minecraft.world.WorldProviderHell;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
|
||||
import net.PeytonPlayz585.shadow.Controller;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
|
@ -1253,8 +1251,6 @@ public class Minecraft implements IThreadListener {
|
|||
keepAlive = lastKeepAlive;
|
||||
}
|
||||
|
||||
Controller.controllerTick();
|
||||
|
||||
if (this.rightClickDelayTimer > 0) {
|
||||
--this.rightClickDelayTimer;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,6 @@ import net.minecraft.world.WorldSettings;
|
|||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import net.PeytonPlayz585.shadow.Config;
|
||||
import net.PeytonPlayz585.shadow.Controller;
|
||||
import net.PeytonPlayz585.shadow.TextureUtils;
|
||||
|
||||
/**+
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.Set;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.PeytonPlayz585.shadow.Controller;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.IntHashMap;
|
||||
|
||||
|
@ -44,19 +43,12 @@ public class KeyBinding implements Comparable<KeyBinding> {
|
|||
if (keyCode != 0) {
|
||||
KeyBinding keybinding = (KeyBinding) hash.lookup(keyCode);
|
||||
if (keybinding != null) {
|
||||
keybinding.updateButtonState();
|
||||
++keybinding.pressTime;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void updateButtonState() {
|
||||
if(Controller.isButtonPressed(buttonID)) {
|
||||
this.pressed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setKeyBindState(int keyCode, boolean pressed) {
|
||||
if (keyCode != 0) {
|
||||
KeyBinding keybinding = (KeyBinding) hash.lookup(keyCode);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.minecraft.util;
|
||||
|
||||
import net.PeytonPlayz585.shadow.Controller;
|
||||
import net.lax1dude.eaglercraft.v1_8.Display;
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
|
||||
|
@ -45,7 +44,7 @@ public class MouseHelper {
|
|||
}
|
||||
|
||||
public void mouseXYChange() {
|
||||
this.deltaX = Mouse.getDX() + Controller.getCameraX();
|
||||
this.deltaY = Mouse.getDY() + Controller.getCameraY();
|
||||
this.deltaX = Mouse.getDX();
|
||||
this.deltaY = Mouse.getDY();
|
||||
}
|
||||
}
|
|
@ -2,8 +2,6 @@ package net.minecraft.util;
|
|||
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
|
||||
import net.PeytonPlayz585.shadow.Controller;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
|
@ -32,26 +30,24 @@ public class MovementInputFromOptions extends MovementInput {
|
|||
public void updatePlayerMoveState() {
|
||||
this.moveStrafe = 0.0F;
|
||||
this.moveForward = 0.0F;
|
||||
if (this.gameSettings.keyBindForward.isKeyDown() || Controller.isWalkingForward()) {
|
||||
if (this.gameSettings.keyBindForward.isKeyDown()) {
|
||||
++this.moveForward;
|
||||
}
|
||||
|
||||
if (this.gameSettings.keyBindBack.isKeyDown() || Controller.isWalkingBackward()) {
|
||||
if (this.gameSettings.keyBindBack.isKeyDown()) {
|
||||
--this.moveForward;
|
||||
}
|
||||
|
||||
if (this.gameSettings.keyBindLeft.isKeyDown() || Controller.isWalkingLeft()) {
|
||||
if (this.gameSettings.keyBindLeft.isKeyDown()) {
|
||||
++this.moveStrafe;
|
||||
}
|
||||
|
||||
if (this.gameSettings.keyBindRight.isKeyDown() || Controller.isWalkingRight()) {
|
||||
if (this.gameSettings.keyBindRight.isKeyDown()) {
|
||||
--this.moveStrafe;
|
||||
}
|
||||
|
||||
this.jump = this.gameSettings.keyBindJump.isKeyDown() || Controller.isJumping();
|
||||
this.sneak = this.gameSettings.keyBindSneak.isKeyDown() || Controller.isSneaking();
|
||||
Controller.unpressCrouch();
|
||||
Controller.unpressJump();
|
||||
this.jump = this.gameSettings.keyBindJump.isKeyDown();
|
||||
this.sneak = this.gameSettings.keyBindSneak.isKeyDown();
|
||||
if (this.sneak) {
|
||||
this.moveStrafe = (float) ((double) this.moveStrafe * 0.3D);
|
||||
this.moveForward = (float) ((double) this.moveForward * 0.3D);
|
||||
|
|
Loading…
Reference in New Issue
Block a user