Skip to content

Commit 514248e

Browse files
authored
Release Patch 1.1.1 for LoTAS 1.8.9 to 1.12.2
Changes: - Fixed TAS Challenges and Auto Strafing - Hotfix 1.9 and 1.10
2 parents 036c9f2 + f4b8aa1 commit 514248e

File tree

183 files changed

+1655
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+1655
-339
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
.gradle
2+
.metadata
23
.settings
34
.classpath
45
.project
56
build
67
bin
78
run
8-
*.launch
99
Private.java
1010

1111
.idea/
12-
Fabric-1.14.4/.gradle/
13-
Fabric-1.14.4/build/
14-
Fabric-1.14.4/run/
1512
out/
1613

1714
eclipse/

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Developers
2-
If you want to contribute to LoTAS, you need to understand how the current system works. I am using an pre-processor made by the Replay-Mod guy...
2+
If you want to contribute to LoTAS, you need to understand how the current system works. I am using an pre-processor made by the Replay-Mod guy... He is a legend!
33

44
### Eclipse
55
Simply import the project using "Import -> Gradle Project"
66

7-
You need to decompile Minecraft first, go into `tasks\` and run `SetupDecompWorkspace_and_AT.launch`. This can take up to 40 minutes... :(
7+
You need to decompile Minecraft first, go into `tasks\` and run `SetupDecompWorkspace_and_AT.launch` or `GenSources.launch`. This can take up to 40 minutes... :(
88
After that you can start programming. The Code to work with is in the 'core' subproject.
99

1010
Here's how to change the MC Version:

LoTAS-Fabric/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import groovy.json.JsonOutput
2+
3+
version = "1.1.0"
4+
group = "de.pfannekuchen.lotas"
5+
6+
apply from: 'versions2/preprocessor.gradle'
7+
apply from: 'version.gradle'
8+
9+
defaultTasks 'build'

LoTAS-Fabric/settings.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pluginManagement {
2+
repositories {
3+
maven {
4+
name = 'Fabric'
5+
url = 'https://maven.fabricmc.net/'
6+
}
7+
gradlePluginPortal()
8+
}
9+
}
10+
11+
def versions2 = [
12+
'fabric',
13+
'1.14.4'
14+
]
15+
versions2.collect {":versions2:$it"}.each {
16+
include it
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package de.pfannekuchen.lotas.core;
2+
3+
import de.pfannekuchen.lotas.core.utils.KeybindsUtils;
4+
import net.fabricmc.api.ModInitializer;
5+
6+
public class LoTASModContainer implements ModInitializer {
7+
8+
@Override
9+
public void onInitialize() {
10+
KeybindsUtils.registerKeybinds();
11+
}
12+
}
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
package de.pfannekuchen.lotas.core;
2+
3+
public class MCVer {
4+
5+
public static int clamp(int num, int min, int max) {
6+
if (num < min) {
7+
return min;
8+
} else {
9+
return num > max ? max : num;
10+
}
11+
}
12+
13+
public static int ceil(float value) {
14+
int i = (int)value;
15+
return value > (float)i ? i + 1 : i;
16+
}
17+
18+
public static float sin(float value) {
19+
return (float) Math.sin(value);
20+
}
21+
22+
public static float cos(float value) {
23+
return (float) Math.cos(value);
24+
}
25+
26+
public static double sqrt(double value)
27+
{
28+
return Math.sqrt(value);
29+
}
30+
31+
public static float sqrt(float value)
32+
{
33+
return (float)Math.sqrt((double)value);
34+
}
35+
36+
public static float clamp(float num, float min, float max) {
37+
if (num < min) {
38+
return min;
39+
} else {
40+
return num > max ? max : num;
41+
}
42+
}
43+
44+
public static float abs(float a) {
45+
return (a <= 0.0F) ? 0.0F - a : a;
46+
}
47+
48+
// public static int x(GuiButton button) {
49+
// //#if MC>=11200
50+
// return button.x;
51+
// //#else
52+
// //$$ return button.xPosition;
53+
// //#endif
54+
// }
55+
//
56+
// public static int y(GuiButton button) {
57+
// //#if MC>=11200
58+
// return button.y;
59+
// //#else
60+
// //$$ return button.yPosition;
61+
// //#endif
62+
// }
63+
//
64+
// public static EntityPlayerSP player(Minecraft mc) {
65+
// //#if MC>=11100
66+
// return mc.player;
67+
// //#else
68+
// //$$ return mc.thePlayer;
69+
// //#endif
70+
// }
71+
//
72+
// public static WorldServer world(IntegratedServer mc, int dimension) {
73+
// //#if MC>=11200
74+
// return mc.getWorld(dimension);
75+
// //#else
76+
// //$$ return mc.worldServerForDimension(dimension);
77+
// //#endif
78+
// }
79+
//
80+
// public static WorldClient world(Minecraft mc) {
81+
// //#if MC>=11100
82+
// return mc.world;
83+
// //#else
84+
// //$$ return mc.theWorld;
85+
// //#endif
86+
// }
87+
//
88+
// public static FontRenderer getFontRenderer(Minecraft mc) {
89+
// //#if MC>=11200
90+
// return mc.fontRenderer;
91+
// //#else
92+
// //$$ return mc.fontRendererObj;
93+
// //#endif
94+
// }
95+
//
96+
// public static WorldServer[] getWorlds(MinecraftServer server) {
97+
// //#if MC>=11100
98+
// return server.worlds;
99+
// //#else
100+
// //$$ return server.worldServers;
101+
// //#endif
102+
// }
103+
//
104+
// public static World world(EntityLiving entity) {
105+
// //#if MC>=11100
106+
// return entity.getEntityWorld();
107+
// //#else
108+
// //$$ return entity.worldObj;
109+
// //#endif
110+
// }
111+
//
112+
// public static Item getItem(String itemId) {
113+
// int mainVersion = Integer.parseInt(ForgeVersion.mcVersion.split("\\.")[1]);
114+
// if (mainVersion <= 10) {
115+
// return Item.getByNameOrId(itemId.toLowerCase());
116+
// }
117+
// return Item.getByNameOrId(itemId);
118+
// }
119+
//
120+
// public static Block getBlock(String blockId) {
121+
// int mainVersion = Integer.parseInt(ForgeVersion.mcVersion.split("\\.")[1]);
122+
// if (mainVersion <= 8) {
123+
// return Block.getBlockFromName(blockId.toLowerCase());
124+
// }
125+
// return Block.getBlockFromName(blockId);
126+
// }
127+
//
128+
// public static AxisAlignedBB aabb(double d, double e, double f, double g, double h, double i) {
129+
// return new AxisAlignedBB(d, e, f, g, h, i);
130+
// }
131+
//
132+
// public static Packet<?> loginStart(GameProfile gameProfile) {
133+
// //#if MC>=10900
134+
// return (new CPacketLoginStart(gameProfile));
135+
// //#else
136+
// //$$ return (new C00PacketLoginStart(gameProfile));
137+
// //#endif
138+
// }
139+
//
140+
// public static Packet<?> handshake(String string, int i, EnumConnectionState login, boolean b) {
141+
// //#if MC>=11202
142+
// return new C00Handshake(string, i, login, b);
143+
// //#else
144+
// //$$ return new C00Handshake(316, string, i, login, b);
145+
// //#endif
146+
// }
147+
//
148+
// public static AxisAlignedBB expandBy32(AxisAlignedBB box) {
149+
// return new AxisAlignedBB(box.minX - 16, box.minY - 16, box.minZ - 16, box.maxX + 16, box.maxY + 16, box.maxZ + 16);
150+
// }
151+
152+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package de.pfannekuchen.lotas.core.utils;
2+
3+
import java.io.IOException;
4+
5+
import org.lwjgl.glfw.GLFW;
6+
7+
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
8+
import net.minecraft.client.MinecraftClient;
9+
import net.minecraft.client.gui.hud.InGameHud;
10+
import net.minecraft.client.gui.screen.GameMenuScreen;
11+
import net.minecraft.client.options.KeyBinding;
12+
13+
public class KeybindsUtils {
14+
15+
public static KeyBinding saveStateKeybind = new KeyBinding("Savestate", GLFW.GLFW_KEY_J, "Stating");
16+
public static final KeyBinding loadStateKeybind = new KeyBinding("Loadstate", GLFW.GLFW_KEY_K, "Stating");
17+
public static final KeyBinding loadDupeKeybind = new KeyBinding("Load Items/Chests", GLFW.GLFW_KEY_O, "Duping");
18+
public static final KeyBinding saveDupeKeybind = new KeyBinding("Save Items/Chests", GLFW.GLFW_KEY_P, "Duping");
19+
public static final KeyBinding holdStrafeKeybind = new KeyBinding("Auto-Strafe", GLFW.GLFW_KEY_H, "Moving");
20+
public static final KeyBinding toggleFreecamKeybind = new KeyBinding("Freecam", GLFW.GLFW_KEY_I, "Moving");
21+
public static final KeyBinding increaseTickrateKeybind = new KeyBinding("Faster Tickrate", GLFW.GLFW_KEY_PERIOD, "Tickrate Changer");
22+
public static final KeyBinding decreaseTickrateKeybind = new KeyBinding("Slower Tickrate", GLFW.GLFW_KEY_COMMA, "Tickrate Changer");
23+
public static final KeyBinding advanceTicksKeybind = new KeyBinding("Advance Tick", GLFW.GLFW_KEY_F9, "Tickrate Changer");
24+
public static final KeyBinding toggleAdvanceKeybind = new KeyBinding("Tickrate Zero Toggle", GLFW.GLFW_KEY_F8, "Tickrate Changer");
25+
public static final KeyBinding toggleTimerKeybind = new KeyBinding("Start/Stop Timer", GLFW.GLFW_KEY_KP_5, "Tickrate Changer");
26+
public static boolean shouldSavestate;
27+
public static boolean shouldLoadstate;
28+
public static boolean isFreecaming;
29+
public static int savedTickrate;
30+
31+
public static void keyEvent() {
32+
while (saveStateKeybind.wasPressed() /*&& ChallengeMap.currentMap == null*/) {
33+
MinecraftClient.getInstance().openScreen(new GameMenuScreen(true));
34+
shouldSavestate = true;
35+
}
36+
while(loadStateKeybind.wasPressed()) {
37+
MinecraftClient.getInstance().openScreen(new GameMenuScreen(true));
38+
shouldLoadstate = true;
39+
}
40+
// } else if (loadDupeKeybind.isPressed()) {
41+
// DupeMod.loadChests();
42+
// DupeMod.loadItems();
43+
// } else if (saveDupeKeybind.isPressed()) {
44+
// DupeMod.saveChests();
45+
// DupeMod.saveItems();
46+
// }
47+
}
48+
49+
public static void registerKeybinds() {
50+
KeyBindingHelper.registerKeyBinding(saveStateKeybind);
51+
KeyBindingHelper.registerKeyBinding(loadStateKeybind);
52+
// KeyBindingHelper.registerKeyBinding(loadDupeKeybind);
53+
// KeyBindingHelper.registerKeyBinding(saveDupeKeybind);
54+
// KeyBindingHelper.registerKeyBinding(holdStrafeKeybind);
55+
// KeyBindingHelper.registerKeyBinding(toggleFreecamKeybind);
56+
KeyBindingHelper.registerKeyBinding(increaseTickrateKeybind);
57+
KeyBindingHelper.registerKeyBinding(decreaseTickrateKeybind);
58+
KeyBindingHelper.registerKeyBinding(advanceTicksKeybind);
59+
KeyBindingHelper.registerKeyBinding(toggleAdvanceKeybind);
60+
// KeyBindingHelper.registerKeyBinding(toggleTimerKeybind);
61+
}
62+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package de.pfannekuchen.lotas.core.utils;
2+
3+
import org.lwjgl.glfw.GLFW;
4+
5+
import net.minecraft.client.MinecraftClient;
6+
7+
/**
8+
* A LWJGL style keyboard method
9+
* @author ScribbleLP
10+
*
11+
*/
12+
public class Keyboard {
13+
14+
public static boolean isKeyDown(int keyCode) {
15+
MinecraftClient mc=MinecraftClient.getInstance();
16+
return GLFW.glfwGetKey(mc.window.getHandle(), keyCode) == GLFW.GLFW_KEY_DOWN;
17+
}
18+
public static boolean isPressed(int keyCode) {
19+
MinecraftClient mc=MinecraftClient.getInstance();
20+
return GLFW.glfwGetKey(mc.window.getHandle(), keyCode) == GLFW.GLFW_PRESS;
21+
}
22+
}

0 commit comments

Comments
 (0)