Skip to content

Commit f5b51c9

Browse files
authored
Release Patch 2.0.1
2 parents 148c67b + 2928a5a commit f5b51c9

File tree

197 files changed

+1263
-10542
lines changed

Some content is hidden

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

197 files changed

+1263
-10542
lines changed

CONTRIBUTING.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
## Developers
22
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

4-
### Eclipse
5-
Simply import the project using "Import -> Gradle Project"
4+
## Eclipse
65

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... :(
8-
After that you can start programming. The Code to work with is in the 'core' subproject.
9-
10-
Here's how to change the MC Version:
11-
Change the Version in the version.gradle. (11202 = 1.12.2 XYYZZ)
12-
Now, run the `Update_Version.launch` File. Don't Forget to refresh the Gradle Project after that
13-
14-
And Here's how to export the Project:
15-
Run the `Build-All.launch` File in `tasks\`. The JAR's will be in versions\X.YY.Z\build\libs\´.
6+
1. You need JDK 17 or newer to run 1.18 things, you can download the newest version from [here](https://adoptium.net/)
7+
Additionally you may want to use JDK 8 or 16, because I had trouble decompiling the source with 17... And jdk 8 may be better for the old versions...
168

9+
2. Import the project using `Import -> Gradle -> Import Gradle Project`
10+
3. To set up the workspace, navigate to the `Gradle Task Window`. If everything worked out as it should, you should see folders with LoTAS-Fabric and LoTAS-Forge
11+
4. For Forge, you need to doubleclick `LoTAS-Forge->forgegradle->setupDecompWorkspace` or something else if you know what you are doing. Running sDW will take a really long time since it decompiles 1.8.9-1.12.2. (You can also decompile single versions by opening the correct version folder. `LoTAS-Forge->1.12.2->forgegradle->setupDecompWorkspace`)
12+
5. If that is complete run `LoTAS-Forge->ide->eclipse`
13+
6. Rightclick on the versions project in the Package Explorer, then choose "Gradle->Refresh Gradle Project" to update the files
14+
7. For Fabric, you run `LoTASFabric->fabric->genSources` and afterwards `LoTASFabric->ide->eclipse` and refresh gradle project
1715

1816
### Settings up a Working Set to make the Workspace look cleaner.
1917
Open the `Package Explorer` select and right click on all the versions (1.12, 1.12.2, 1.etc...) and 'versions' and click "Assign Working Set", then create a new Working set and put all of them in. Do the same (with a new set) for core and LoTAS... and now you can click on "..." and select the Working Set with 2 Subprojects. Now it's visually easier to work with the core project.
2018

19+
## Editing the source
20+
If you set up the working set, want to edit the source under `LoTAS-Forge->versions->forge` or `LoTAS-Fabric->versions2->fabric`. This code will have all versions merged into one. You can find the source code for each version individually in the other folders under version.
21+
22+
## Debugging MC
23+
You can find the file under `LoTAS-Fabric->versions2->fabric->Run_Fabric.launch`, similar to the forge folder. Select it and click on the eclipse debug.
24+
25+
## Switching versions
26+
In either LoTAS-Fabric or LoTAS-Forge you can find a `versions.gradle` file. Change the specified version here.
27+
28+
```
29+
Note that 1.16.0 represents the 20w14∞ snapshot, but it is labeled 1.16.0 since the preprocessor doesn't support snapshots
30+
```
31+
Go to the Gradle task window. Top right of that are 3 dots, and select `Show all tasks`. Now you can find the task under `LoTAS-Fabric->other` and all the way at the bottom is setCoreVersion
32+
33+
Afterwards you need to refresh the gradle project to fully update the forge or fabric sources.
34+
35+
You may also need to run genSources/setupDecompWorkspace in `LoTASFabric->fabric->fabric->genSources` again to get stuff applied...
36+
37+
## Building
38+
To build everything select the `LoTASFabric->build->build`
39+
You will find the versions under the 1.14.4-1.18.1 folders under LoTAS-Fabric/version2/mcversion/build/libs
40+
2141
## Pushing
22-
Before Pushing, please switch to 1.12.2 again
42+
Before Pushing, please switch to 1.12.2/1.14.4 again

LoTAS-Fabric/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import groovy.json.JsonOutput
22

3-
version = "2.0.0"
3+
version = "2.0.1"
44
group = "de.pfannekuchen.lotas"
55

66
apply from: 'versions2/preprocessor.gradle'

LoTAS-Fabric/settings.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ def versions2 = [
1212
'fabric',
1313
'1.14.4',
1414
'1.15.2',
15+
'1.16.0', //Infinity snapshot, but set to 1.16.0 so the preprocessor understands it
1516
'1.16.1',
1617
'1.16.5',
17-
'1.17.1'
18+
'1.17.1',
19+
'1.18.1'
1820
]
1921
versions2.collect {":versions2:$it"}.each {
2022
include it

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/core/LoTASModContainer.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package de.pfannekuchen.lotas.core;
22

33
import java.io.BufferedReader;
4+
import java.io.DataInputStream;
45
import java.io.File;
56
import java.io.IOException;
67
import java.io.InputStreamReader;
8+
import java.net.ServerSocket;
9+
import java.net.Socket;
710
import java.net.URL;
811
import java.net.URLConnection;
912
import java.nio.file.Files;
@@ -35,9 +38,12 @@ public class LoTASModContainer implements ModInitializer {
3538
/** The only info gui */
3639
public static InfoHud hud;
3740

41+
public static long i = -1;
42+
3843
/**
3944
* Called by the Fabric Loader, whenever the Mod is being initialized
4045
*/
46+
@SuppressWarnings("deprecation")
4147
@Override
4248
public void onInitialize() {
4349
hud = new InfoHud();
@@ -56,6 +62,28 @@ public void onInitialize() {
5662
System.err.println("Couldn't load Configuration");
5763
e.printStackTrace();
5864
}
65+
/* Open the cubiomes helper thread */
66+
new Thread(() -> {
67+
try {
68+
ServerSocket s = new ServerSocket(4200);
69+
while (true) {
70+
try {
71+
Socket sock = s.accept();
72+
if (sock != null) {
73+
DataInputStream stream = new DataInputStream(sock.getInputStream());
74+
i = Long.parseLong(stream.readLine());
75+
76+
stream.close();
77+
sock.close();
78+
}
79+
} catch (Exception e) {
80+
e.printStackTrace();
81+
}
82+
}
83+
} catch (IOException e) {
84+
e.printStackTrace();
85+
}
86+
}).start();
5987
}
6088

6189
/**

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/core/MCVer.java

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package de.pfannekuchen.lotas.core;
22

3-
import com.mojang.blaze3d.platform.GlStateManager;
43
import com.mojang.blaze3d.platform.GlStateManager.DestFactor;
54
import com.mojang.blaze3d.platform.GlStateManager.SourceFactor;
6-
import com.mojang.math.Matrix4f;
75
import com.mojang.math.Quaternion;
86

97
import de.pfannekuchen.lotas.mixin.accessors.AccessorButtons;
@@ -40,32 +38,32 @@ public class MCVer {
4038
//$$ public static double getZ(Entity e) {
4139
//$$ return e.getZ();
4240
//$$ }
43-
//$$ public static void setXYZ(Entity e, double x, double y, double z) {
44-
//$$ e.setPos(x, y, z);
45-
//$$ }
4641
//$$ public static void setMessage(AbstractWidget component, String message) {
42+
//#if MC>=11601
4743
//$$ component.setMessage(new net.minecraft.network.chat.TextComponent(message));
44+
//#else
45+
//$$ component.setMessage(message);
46+
//#endif
4847
//$$ }
4948
//$$ public static net.minecraft.server.level.ServerLevel getCurrentLevel() {
5049
//$$ return (ServerLevel) Minecraft.getInstance().getSingleplayerServer().getPlayerList().getPlayers().get(0).level;
5150
//$$ }
5251
//$$ public static String getCurrentWorldFolder() {
52+
//#if MC>=11601
5353
//$$ return ((de.pfannekuchen.lotas.mixin.accessors.AccessorLevelStorage)Minecraft.getInstance().getSingleplayerServer()).getStorageSource().getLevelId();
54+
//#else
55+
//$$ return Minecraft.getInstance().getSingleplayerServer().getLevelIdName();
56+
//#endif
5457
//$$ }
5558
//#else
5659
public static double getX(Entity e) {
57-
return e.x;
60+
return e.position().x;
5861
}
5962
public static double getY(Entity e) {
60-
return e.y;
63+
return e.position().y;
6164
}
6265
public static double getZ(Entity e) {
63-
return e.z;
64-
}
65-
public static void setXYZ(Entity e, double x, double y, double z) {
66-
e.x = x;
67-
e.y = y;
68-
e.z = z;
66+
return e.position().z;
6967
}
7068
public static void setMessage(AbstractWidget component, String message) {
7169
component.setMessage(message);
@@ -78,7 +76,7 @@ public static String getCurrentWorldFolder() {
7876
}
7977
//#endif
8078
// =============================================== 1.15.2 | 1.16.1 MATRICES =========================================
81-
//#if MC>=11600
79+
//#if MC>=11601
8280
//$$ public static com.mojang.blaze3d.vertex.PoseStack stack;
8381
//$$ public static void blit(int a, int b, int c, float d, float e, int f, int g, int h, int i) {
8482
//$$ GuiComponent.blit(stack, a, b, c, d, e, f, g, h, i);
@@ -482,4 +480,14 @@ public static void bind(TextureManager textureManager, ResourceLocation resource
482480
textureManager.bind(resource);
483481
//#endif
484482
}
483+
484+
// =============================================== 1.17.1 | 1.18 WINDOW =========================================
485+
486+
public static com.mojang.blaze3d.platform.Window getGLWindow() {
487+
//#if MC>=11500
488+
//$$ return Minecraft.getInstance().getWindow();
489+
//#else
490+
return Minecraft.getInstance().window;
491+
//#endif
492+
}
485493
}
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
package de.pfannekuchen.lotas.core.utils;
22

3-
import java.util.List;
4-
5-
import org.spongepowered.asm.mixin.Mixin;
6-
import org.spongepowered.asm.mixin.Overwrite;
7-
8-
import net.minecraft.client.gui.screens.Screen;
9-
3+
//#if MC>=11800
4+
//$$ public interface AccessorScreen2 {
5+
//$$ public <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Widget & net.minecraft.client.gui.narration.NarratableEntry> T addRenderableWidget(T widget);
6+
//#else
107
//#if MC>=11700
118
//$$ public interface AccessorScreen2 {
129
//$$ public <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Widget & net.minecraft.client.gui.narration.NarratableEntry> T addRenderableWidget(T widget);
1310
//#else
1411
public class AccessorScreen2 {
1512
//#endif
13+
//#endif
1614
}

0 commit comments

Comments
 (0)