Skip to content

Commit

Permalink
Release Patch 1.1.1 for LoTAS 1.8.9 to 1.12.2
Browse files Browse the repository at this point in the history
Changes:
- Fixed TAS Challenges and Auto Strafing
- Hotfix 1.9 and 1.10
  • Loading branch information
PancakeTAS authored Jun 3, 2021
2 parents 036c9f2 + f4b8aa1 commit 514248e
Show file tree
Hide file tree
Showing 183 changed files with 1,655 additions and 339 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
.gradle
.metadata
.settings
.classpath
.project
build
bin
run
*.launch
Private.java

.idea/
Fabric-1.14.4/.gradle/
Fabric-1.14.4/build/
Fabric-1.14.4/run/
out/

eclipse/
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Developers
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...
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!

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

You need to decompile Minecraft first, go into `tasks\` and run `SetupDecompWorkspace_and_AT.launch`. This can take up to 40 minutes... :(
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... :(
After that you can start programming. The Code to work with is in the 'core' subproject.

Here's how to change the MC Version:
Expand Down
9 changes: 9 additions & 0 deletions LoTAS-Fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import groovy.json.JsonOutput

version = "1.1.0"
group = "de.pfannekuchen.lotas"

apply from: 'versions2/preprocessor.gradle'
apply from: 'version.gradle'

defaultTasks 'build'
File renamed without changes.
17 changes: 17 additions & 0 deletions LoTAS-Fabric/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}

def versions2 = [
'fabric',
'1.14.4'
]
versions2.collect {":versions2:$it"}.each {
include it
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.pfannekuchen.lotas.core;

import de.pfannekuchen.lotas.core.utils.KeybindsUtils;
import net.fabricmc.api.ModInitializer;

public class LoTASModContainer implements ModInitializer {

@Override
public void onInitialize() {
KeybindsUtils.registerKeybinds();
}
}
152 changes: 152 additions & 0 deletions LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/core/MCVer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
package de.pfannekuchen.lotas.core;

public class MCVer {

public static int clamp(int num, int min, int max) {
if (num < min) {
return min;
} else {
return num > max ? max : num;
}
}

public static int ceil(float value) {
int i = (int)value;
return value > (float)i ? i + 1 : i;
}

public static float sin(float value) {
return (float) Math.sin(value);
}

public static float cos(float value) {
return (float) Math.cos(value);
}

public static double sqrt(double value)
{
return Math.sqrt(value);
}

public static float sqrt(float value)
{
return (float)Math.sqrt((double)value);
}

public static float clamp(float num, float min, float max) {
if (num < min) {
return min;
} else {
return num > max ? max : num;
}
}

public static float abs(float a) {
return (a <= 0.0F) ? 0.0F - a : a;
}

// public static int x(GuiButton button) {
// //#if MC>=11200
// return button.x;
// //#else
// //$$ return button.xPosition;
// //#endif
// }
//
// public static int y(GuiButton button) {
// //#if MC>=11200
// return button.y;
// //#else
// //$$ return button.yPosition;
// //#endif
// }
//
// public static EntityPlayerSP player(Minecraft mc) {
// //#if MC>=11100
// return mc.player;
// //#else
// //$$ return mc.thePlayer;
// //#endif
// }
//
// public static WorldServer world(IntegratedServer mc, int dimension) {
// //#if MC>=11200
// return mc.getWorld(dimension);
// //#else
// //$$ return mc.worldServerForDimension(dimension);
// //#endif
// }
//
// public static WorldClient world(Minecraft mc) {
// //#if MC>=11100
// return mc.world;
// //#else
// //$$ return mc.theWorld;
// //#endif
// }
//
// public static FontRenderer getFontRenderer(Minecraft mc) {
// //#if MC>=11200
// return mc.fontRenderer;
// //#else
// //$$ return mc.fontRendererObj;
// //#endif
// }
//
// public static WorldServer[] getWorlds(MinecraftServer server) {
// //#if MC>=11100
// return server.worlds;
// //#else
// //$$ return server.worldServers;
// //#endif
// }
//
// public static World world(EntityLiving entity) {
// //#if MC>=11100
// return entity.getEntityWorld();
// //#else
// //$$ return entity.worldObj;
// //#endif
// }
//
// public static Item getItem(String itemId) {
// int mainVersion = Integer.parseInt(ForgeVersion.mcVersion.split("\\.")[1]);
// if (mainVersion <= 10) {
// return Item.getByNameOrId(itemId.toLowerCase());
// }
// return Item.getByNameOrId(itemId);
// }
//
// public static Block getBlock(String blockId) {
// int mainVersion = Integer.parseInt(ForgeVersion.mcVersion.split("\\.")[1]);
// if (mainVersion <= 8) {
// return Block.getBlockFromName(blockId.toLowerCase());
// }
// return Block.getBlockFromName(blockId);
// }
//
// public static AxisAlignedBB aabb(double d, double e, double f, double g, double h, double i) {
// return new AxisAlignedBB(d, e, f, g, h, i);
// }
//
// public static Packet<?> loginStart(GameProfile gameProfile) {
// //#if MC>=10900
// return (new CPacketLoginStart(gameProfile));
// //#else
// //$$ return (new C00PacketLoginStart(gameProfile));
// //#endif
// }
//
// public static Packet<?> handshake(String string, int i, EnumConnectionState login, boolean b) {
// //#if MC>=11202
// return new C00Handshake(string, i, login, b);
// //#else
// //$$ return new C00Handshake(316, string, i, login, b);
// //#endif
// }
//
// public static AxisAlignedBB expandBy32(AxisAlignedBB box) {
// return new AxisAlignedBB(box.minX - 16, box.minY - 16, box.minZ - 16, box.maxX + 16, box.maxY + 16, box.maxZ + 16);
// }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package de.pfannekuchen.lotas.core.utils;

import java.io.IOException;

import org.lwjgl.glfw.GLFW;

import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.options.KeyBinding;

public class KeybindsUtils {

public static KeyBinding saveStateKeybind = new KeyBinding("Savestate", GLFW.GLFW_KEY_J, "Stating");
public static final KeyBinding loadStateKeybind = new KeyBinding("Loadstate", GLFW.GLFW_KEY_K, "Stating");
public static final KeyBinding loadDupeKeybind = new KeyBinding("Load Items/Chests", GLFW.GLFW_KEY_O, "Duping");
public static final KeyBinding saveDupeKeybind = new KeyBinding("Save Items/Chests", GLFW.GLFW_KEY_P, "Duping");
public static final KeyBinding holdStrafeKeybind = new KeyBinding("Auto-Strafe", GLFW.GLFW_KEY_H, "Moving");
public static final KeyBinding toggleFreecamKeybind = new KeyBinding("Freecam", GLFW.GLFW_KEY_I, "Moving");
public static final KeyBinding increaseTickrateKeybind = new KeyBinding("Faster Tickrate", GLFW.GLFW_KEY_PERIOD, "Tickrate Changer");
public static final KeyBinding decreaseTickrateKeybind = new KeyBinding("Slower Tickrate", GLFW.GLFW_KEY_COMMA, "Tickrate Changer");
public static final KeyBinding advanceTicksKeybind = new KeyBinding("Advance Tick", GLFW.GLFW_KEY_F9, "Tickrate Changer");
public static final KeyBinding toggleAdvanceKeybind = new KeyBinding("Tickrate Zero Toggle", GLFW.GLFW_KEY_F8, "Tickrate Changer");
public static final KeyBinding toggleTimerKeybind = new KeyBinding("Start/Stop Timer", GLFW.GLFW_KEY_KP_5, "Tickrate Changer");
public static boolean shouldSavestate;
public static boolean shouldLoadstate;
public static boolean isFreecaming;
public static int savedTickrate;

public static void keyEvent() {
while (saveStateKeybind.wasPressed() /*&& ChallengeMap.currentMap == null*/) {
MinecraftClient.getInstance().openScreen(new GameMenuScreen(true));
shouldSavestate = true;
}
while(loadStateKeybind.wasPressed()) {
MinecraftClient.getInstance().openScreen(new GameMenuScreen(true));
shouldLoadstate = true;
}
// } else if (loadDupeKeybind.isPressed()) {
// DupeMod.loadChests();
// DupeMod.loadItems();
// } else if (saveDupeKeybind.isPressed()) {
// DupeMod.saveChests();
// DupeMod.saveItems();
// }
}

public static void registerKeybinds() {
KeyBindingHelper.registerKeyBinding(saveStateKeybind);
KeyBindingHelper.registerKeyBinding(loadStateKeybind);
// KeyBindingHelper.registerKeyBinding(loadDupeKeybind);
// KeyBindingHelper.registerKeyBinding(saveDupeKeybind);
// KeyBindingHelper.registerKeyBinding(holdStrafeKeybind);
// KeyBindingHelper.registerKeyBinding(toggleFreecamKeybind);
KeyBindingHelper.registerKeyBinding(increaseTickrateKeybind);
KeyBindingHelper.registerKeyBinding(decreaseTickrateKeybind);
KeyBindingHelper.registerKeyBinding(advanceTicksKeybind);
KeyBindingHelper.registerKeyBinding(toggleAdvanceKeybind);
// KeyBindingHelper.registerKeyBinding(toggleTimerKeybind);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.pfannekuchen.lotas.core.utils;

import org.lwjgl.glfw.GLFW;

import net.minecraft.client.MinecraftClient;

/**
* A LWJGL style keyboard method
* @author ScribbleLP
*
*/
public class Keyboard {

public static boolean isKeyDown(int keyCode) {
MinecraftClient mc=MinecraftClient.getInstance();
return GLFW.glfwGetKey(mc.window.getHandle(), keyCode) == GLFW.GLFW_KEY_DOWN;
}
public static boolean isPressed(int keyCode) {
MinecraftClient mc=MinecraftClient.getInstance();
return GLFW.glfwGetKey(mc.window.getHandle(), keyCode) == GLFW.GLFW_PRESS;
}
}
Loading

0 comments on commit 514248e

Please sign in to comment.