Skip to content

Commit 187e89c

Browse files
authored
Release 2.1.0 for LoTAS 1.7.10 to 1.19.3
## Major changes: * Added 1.19.3 * Made savestates more reliable, preventing corruption * Reworked the entire Pause Screen * Added small gap between Save Items and Load items * Changed position of text boxes to match the buttons * Added hint text in checkboxes to tell the user to press enter to apply * Added hint text for Jump Ticks when holding shift * Holding shift and clicking on jump ticks counter will decrease the counter * Disabled ticks counter when jump ticks is pressed * Fixed crash when entering non numerical values into custom tickrate box and added hint * Unselecting a custom tickrate box will close that box and the original button will appear ## Fixes * [♾-snapshot] Fixed crash when opening the creative inventory * Fixed hitbox of labels in InfoGui being unclickable when resizing the window to something smaller * Fixed `fixedCrashDuringLoadstate` not fixing crash during loadstate * [Forge] Create world spawn location was inverted ## Removed * TAS-Challenge Maps (did you even know this existed?) * SeedList Screen * [Fabric] Possible fix for memory leak when loadstating
2 parents 6bc3e19 + f08d05c commit 187e89c

File tree

69 files changed

+1842
-1715
lines changed

Some content is hidden

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

69 files changed

+1842
-1715
lines changed

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.4"
3+
version = "2.1.0"
44
group = "de.pfannekuchen.lotas"
55

66
apply from: 'versions2/preprocessor.gradle'

LoTAS-Fabric/settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def versions2 = [
1818
'1.17.1',
1919
'1.18.2',
2020
'1.19.0',
21-
'1.19.2'
21+
'1.19.2',
22+
'1.19.3'
2223
]
2324
versions2.collect {":versions2:$it"}.each {
2425
include it

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

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@
88
import java.net.ServerSocket;
99
import java.net.Socket;
1010
import java.net.URL;
11-
import java.net.URLConnection;
12-
import java.nio.file.Files;
13-
import java.util.List;
1411

1512
import javax.net.ssl.HttpsURLConnection;
1613

17-
import org.apache.commons.io.FileUtils;
18-
1914
import de.pfannekuchen.lotas.core.utils.ConfigUtils;
2015
import de.pfannekuchen.lotas.core.utils.TextureYoinker;
2116
import de.pfannekuchen.lotas.gui.InfoHud;
22-
import de.pfannekuchen.lotas.gui.SeedListScreen;
2317
import de.pfannekuchen.lotas.mods.TickrateChangerMod;
2418
import net.fabricmc.api.ModInitializer;
2519
import net.minecraft.client.Minecraft;
@@ -47,15 +41,10 @@ public class LoTASModContainer implements ModInitializer {
4741
@Override
4842
public void onInitialize() {
4943
hud = new InfoHud();
50-
/* Load the Seeds for the (disabled) Seeds Menu */
51-
try {
52-
loadSeeds();
53-
} catch (Exception e1) {
54-
e1.printStackTrace();
55-
}
5644
/* Load the Configuration and set the tickrate if required */
5745
try {
58-
ConfigUtils.init(new File(Minecraft.getInstance().gameDirectory, "lotas.properties"));
46+
Minecraft mc = Minecraft.getInstance();
47+
ConfigUtils.init(new File(mc.gameDirectory, "lotas.properties"));
5948
if (ConfigUtils.getBoolean("tools", "saveTickrate"))
6049
TickrateChangerMod.updateTickrate(ConfigUtils.getInt("hidden", "tickrate"));
6150
} catch (IOException e) {
@@ -106,8 +95,11 @@ public static void loadShieldsTASTools() {
10695
} catch (IOException e) {
10796
e.printStackTrace();
10897
}
98+
//#if MC>=11903
99+
//$$ LoTASModContainer.shield=new ResourceLocation("lotas", "shield/bottleshield.png");
100+
//#else
109101
LoTASModContainer.shield=new ResourceLocation("textures/shield/bottleshield.png");
110-
// AccessorModelLoader.setShieldBase(new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("lotas","pan_cake")));
102+
//#endif
111103
}
112104

113105
public static void loadShieldsMCTAS() {
@@ -130,33 +122,10 @@ public static void loadShieldsMCTAS() {
130122
e.printStackTrace();
131123
}
132124

125+
//#if MC>=11903
126+
//$$ LoTASModContainer.shield=new ResourceLocation("lotas", "shield/bottleshield.png");
127+
//#else
133128
LoTASModContainer.shield=new ResourceLocation("textures/shield/bottleshield.png");
129+
//#endif
134130
}
135-
136-
137-
/**
138-
* Loads a list of seeds together with preview images from <a href="http://mgnet.work/seeds/">mgnet.work/seeds/seedsX.XX.X.txt</a> and creates a List
139-
* @throws IOException
140-
*/
141-
public void loadSeeds() throws Exception {
142-
File file = new File("seeddata.txt");
143-
try {
144-
URL url = new URL("https://data.mgnet.work/lotas/seeds/1.14.4.txt"); // TODO: wait why does this say 1.14.4...
145-
URLConnection conn = url.openConnection();
146-
conn.setReadTimeout(5000);
147-
file.createNewFile();
148-
FileUtils.copyInputStreamToFile(conn.getInputStream(), file);
149-
} catch (Exception e) {
150-
e.printStackTrace();
151-
}
152-
List<String> strings = Files.readAllLines(file.toPath());
153-
for (String line : strings) {
154-
String seed = line.split(":")[0];
155-
String name = line.split(":")[1];
156-
String description = line.split(":")[2];
157-
158-
SeedListScreen.seeds.add(new SeedListScreen.Seed(seed, name, description));
159-
}
160-
}
161-
162131
}

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

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
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.blaze3d.vertex.BufferBuilder;
7-
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
8-
import com.mojang.blaze3d.vertex.Tesselator;
9-
import com.mojang.math.Quaternion;
105

116
import de.pfannekuchen.lotas.mixin.accessors.AccessorButtons;
12-
import de.pfannekuchen.lotas.mixin.accessors.AccessorScreen;
137
import net.minecraft.client.Minecraft;
148
import net.minecraft.client.gui.Font;
159
import net.minecraft.client.gui.GuiComponent;
@@ -18,13 +12,13 @@
1812
import net.minecraft.client.gui.components.Button.OnPress;
1913
import net.minecraft.client.gui.components.Checkbox;
2014
import net.minecraft.client.gui.components.EditBox;
21-
import net.minecraft.client.gui.components.Widget;
2215
import net.minecraft.client.gui.screens.Screen;
2316
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
2417
import net.minecraft.client.renderer.texture.TextureManager;
2518
import net.minecraft.network.chat.Component;
2619
import net.minecraft.resources.ResourceLocation;
2720
import net.minecraft.server.level.ServerLevel;
21+
import net.minecraft.server.level.ServerPlayer;
2822
import net.minecraft.world.entity.Entity;
2923

3024
/**
@@ -51,7 +45,8 @@ public class MCVer {
5145
//#endif
5246
//$$ }
5347
//$$ public static net.minecraft.server.level.ServerLevel getCurrentLevel() {
54-
//$$ return (ServerLevel) Minecraft.getInstance().getSingleplayerServer().getPlayerList().getPlayers().get(0).level;
48+
//$$ ServerPlayer player = Minecraft.getInstance().getSingleplayerServer().getPlayerList().getPlayers().get(0);
49+
//$$ return (ServerLevel) player.level;
5550
//$$ }
5651
//$$ public static String getCurrentWorldFolder() {
5752
//#if MC>=11601
@@ -90,18 +85,23 @@ public static String getCurrentWorldFolder() {
9085
//$$ GuiComponent.fill(stack, a, b, c, d, e);
9186
//$$ }
9287
//$$ public static void drawCenteredString(Screen s, String text, int x, int y, int color) {
88+
//$$ Minecraft mc = Minecraft.getInstance();
9389
//$$ if (text == null) text = " ";
9490
//#if MC>=11605
95-
//$$ Screen.drawCenteredString(stack, Minecraft.getInstance().font, text, x, y, color);
91+
//$$ Screen.drawCenteredString(stack, mc.font, text, x, y, color);
9692
//#else
97-
//$$ s.drawCenteredString(stack, Minecraft.getInstance().font, net.minecraft.network.chat.FormattedText.of(text), x, y, color);
93+
//$$ s.drawCenteredString(stack, mc.font, net.minecraft.network.chat.FormattedText.of(text), x, y, color);
9894
//#endif
9995
//$$ }
10096
//$$ public static Checkbox Checkbox(int i, int j, int k, int l, String text, boolean bl) {
10197
//$$ return new Checkbox(i, j, k, l, MCVer.literal(text), bl);
10298
//$$ }
10399
//$$ public static Button Button(int i, int j, int k, int l, String text, OnPress onpress) {
100+
//#if MC>=11903
101+
//$$ return Button.builder(MCVer.literal(text), onpress).pos(i, j).size(k, l).build();
102+
//#else
104103
//$$ return new Button(i, j, k, l, MCVer.literal(text), onpress);
104+
//#endif
105105
//$$ }
106106
//$$ public static EditBox EditBox(Font f, int i, int j, int k, int l, String text) {
107107
//$$ return new EditBox(f, i, j, k, l, MCVer.literal(text));
@@ -116,17 +116,27 @@ public static String getCurrentWorldFolder() {
116116
//$$ component.render(stack, mouseX, mouseY, delta);
117117
//$$ }
118118
//$$ public static void drawShadow(String text, int x, int y, int color) {
119+
//$$ Minecraft mc = Minecraft.getInstance();
119120
//$$ if(text!=null) {
120121
//#if MC>=11605
121-
//$$ Minecraft.getInstance().font.drawShadow(stack, text, x, y, color);
122+
//$$ mc.font.drawShadow(stack, text, x, y, color);
122123
//#else
123-
//$$ Minecraft.getInstance().font.drawShadow(stack, net.minecraft.network.chat.FormattedText.of(text), x, y, color);
124+
//$$ mc.font.drawShadow(stack, net.minecraft.network.chat.FormattedText.of(text), x, y, color);
124125
//#endif
125126
//$$ }
126127
//$$ }
127128
//$$ public static void renderBackground(Screen screen) {
128129
//$$ screen.renderBackground(stack);
129130
//$$ }
131+
//#if MC>=11903
132+
//$$ public static org.joml.Quaternionf fromYXZ(float f, float g, float h) {
133+
//$$ org.joml.Quaternionf quaternion = new org.joml.Quaternionf(0.0f, 0.0f, 0.0f, 1.0f);
134+
//$$ quaternion.mul(new org.joml.Quaternionf(0.0f, (float)Math.sin(f / 2.0f), 0.0f, (float)Math.cos(f / 2.0f)));
135+
//$$ quaternion.mul(new org.joml.Quaternionf((float)Math.sin(g / 2.0f), 0.0f, 0.0f, (float)Math.cos(g / 2.0f)));
136+
//$$ quaternion.mul(new org.joml.Quaternionf(0.0f, 0.0f, (float)Math.sin(h / 2.0f), (float)Math.cos(h / 2.0f)));
137+
//$$ return quaternion;
138+
//$$ }
139+
//#endif
130140
//#else
131141
public static Checkbox Checkbox(int i, int j, int k, int l, String text, boolean bl) {
132142
return new Checkbox(i, j, k, l, text, bl);
@@ -243,7 +253,11 @@ public static void drawCenteredString(Screen s, String text, int x, int y, int c
243253
//$$
244254
//$$ public static void rotated(Object stack, double i, double j, double k, double l) {
245255
//$$ com.mojang.blaze3d.vertex.PoseStack poseStack = (com.mojang.blaze3d.vertex.PoseStack)stack;
246-
//$$ poseStack.mulPose(new Quaternion((float)i,(float) j,(float) k,(float) l));
256+
//#if MC>=11903
257+
//$$ poseStack.mulPose(new org.joml.Quaternionf((float)i,(float) j,(float) k,(float) l));
258+
//#else
259+
//$$ poseStack.mulPose(new com.mojang.math.Quaternion((float)i,(float) j,(float) k,(float) l));
260+
//#endif
247261
//$$ }
248262
//$$
249263
//$$ public static void enableDepthTest() {
@@ -446,29 +460,45 @@ public static BlockEntityRenderDispatcher getBlockEntityDispatcher() {
446460
}
447461
//#endif
448462

449-
// =============================================== 1.16.5 | 1.17 BUTTONS =========================================
463+
// =============================================== 1.19.3 BUTTONS ================================================
464+
//#if MC>=11903
465+
//$$ public static <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Renderable & net.minecraft.client.gui.narration.NarratableEntry> T addButton(Screen screen, T button) {
466+
//$$ ((de.pfannekuchen.lotas.core.utils.AccessorScreen2)screen).addRenderableWidget(button);
467+
//$$ return button;
468+
//$$ }
469+
//$$
470+
//$$ public static net.minecraft.client.gui.components.Renderable getButton(Screen obj, int buttonID) {
471+
//$$ return ((AccessorButtons)obj).getButtons().get(buttonID);
472+
//$$ }
473+
//$$
474+
//$$
475+
//$$ public static int getButtonSize(Screen obj) {
476+
//$$ return ((AccessorButtons)obj).getButtons().size();
477+
//$$ }
478+
//#else
479+
// =============================================== 1.16.5 | 1.17 | 1.19.2 BUTTONS =========================================
450480
//#if MC>=11700
451481
//$$ public static <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Widget & net.minecraft.client.gui.narration.NarratableEntry> T addButton(Screen screen, T button) {
452482
//$$ ((de.pfannekuchen.lotas.core.utils.AccessorScreen2)screen).addRenderableWidget(button);
453483
//$$ return button;
454484
//$$ }
455485
//#else
456486
public static <T extends AbstractWidget> T addButton(Screen screen, T button) {
457-
((AccessorScreen)screen).invokeAddButton(button);
487+
((de.pfannekuchen.lotas.mixin.accessors.AccessorScreen)screen).invokeAddButton(button);
458488
return button;
459489
}
460490
//#endif
461-
491+
462492
//#if MC>=11700
463-
//$$ public static Widget getButton(Screen obj, int buttonID) {
493+
//$$ public static net.minecraft.client.gui.components.Widget getButton(Screen obj, int buttonID) {
464494
//$$ return ((AccessorButtons)obj).getButtons().get(buttonID);
465495
//$$ }
466496
//#else
467497
public static AbstractWidget getButton(Screen obj, int buttonID){
468498
return (AbstractWidget) ((AccessorButtons)obj).getButtons().get(buttonID);
469499
}
470500
//#endif
471-
501+
472502
//#if MC>=11700
473503
//$$ public static int getButtonSize(Screen obj) {
474504
//$$ return ((AccessorButtons)obj).getButtons().size();
@@ -478,6 +508,7 @@ public static int getButtonSize(Screen obj){
478508
return ((AccessorButtons)obj).getButtons().size();
479509
}
480510
//#endif
511+
//#endif
481512
// =============================================== 1.16.5 | 1.17 TEXTURES =========================================
482513

483514
public static void bind(TextureManager textureManager, ResourceLocation resource) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package de.pfannekuchen.lotas.core.utils;
22

3+
34
//#if MC>=11800
45
//$$ public interface AccessorScreen2 {
6+
//#if MC>=11903
7+
//$$ public <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Renderable & net.minecraft.client.gui.narration.NarratableEntry> T addRenderableWidget(T widget);
8+
//#else
59
//$$ 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);
10+
//#endif
611
//#else
712
//#if MC>=11700
813
//$$ public interface AccessorScreen2 {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ public static void render(Object poseStack, double xPos, double yPos, double rot
1919
MCVer.translated(poseStack, xPos, yPos, 0);
2020
MCVer.scaled(poseStack, scale, scale, scale);
2121

22+
//#if MC>=11903
23+
//$$ MCVer.stack.mulPose(MCVer.fromYXZ(0F, 0F, (float) rotation) );
24+
//#else
2225
//#if MC>=11700
2326
//$$ MCVer.stack.mulPose(com.mojang.math.Quaternion.fromXYZ(0, 0, (float) rotation));
2427
//#else
2528
MCVer.rotated(poseStack, rotation, 0, 0, 1);
2629
//#endif
30+
//#endif
2731

2832
int orangeBright=0xE35720;
2933
int orange=0xC24218;
@@ -133,11 +137,15 @@ public static void render(Object poseStack, double xPos, double yPos, double rot
133137
renderPixel(6, y, white);
134138
renderPixel(7, y, white);
135139

140+
//#if MC>=11903
141+
//$$ MCVer.stack.mulPose(MCVer.fromYXZ(0F, 0F, (float) -rotation));
142+
//#else
136143
//#if MC>=11700
137144
//$$ MCVer.stack.mulPose(com.mojang.math.Quaternion.fromXYZ(0, 0, (float) -rotation));
138145
//#else
139146
MCVer.rotated(poseStack, -rotation, 0, 0, 1);
140147
//#endif
148+
//#endif
141149
MCVer.scaled(poseStack, (double)1/scale, (double)1/scale, (double)1/scale);
142150
MCVer.translated(poseStack, -xPos, -yPos, 0);
143151

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public static void drawSolidBox(Object poseStack, AABB bb, float r, float g, flo
8484
Tesselator tesselator = Tesselator.getInstance();
8585
BufferBuilder bufferBuilder = tesselator.getBuilder();
8686
//#if MC>=11700
87+
//#if MC>=11903
88+
//$$ org.joml.Matrix4f matrix = ((com.mojang.blaze3d.vertex.PoseStack) poseStack).last().pose();
89+
//#else
8790
//$$ com.mojang.math.Matrix4f matrix = ((com.mojang.blaze3d.vertex.PoseStack) poseStack).last().pose();
91+
//#endif
8892
//$$ com.mojang.blaze3d.systems.RenderSystem.setShader(net.minecraft.client.renderer.GameRenderer::getPositionColorShader);
8993
//$$ bufferBuilder.begin(com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
9094
//$$ bufferBuilder.vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ).color(r, g, b, a).endVertex();
@@ -169,7 +173,11 @@ public static void drawOutlinedBox(Object poseStack, AABB bb) {
169173
BufferBuilder bufferBuilder = tesselator.getBuilder();
170174

171175
//#if MC>=11700
176+
//#if MC>=11903
177+
//$$ org.joml.Matrix4f matrix = ((com.mojang.blaze3d.vertex.PoseStack) poseStack).last().pose();
178+
//#else
172179
//$$ com.mojang.math.Matrix4f matrix = ((com.mojang.blaze3d.vertex.PoseStack) poseStack).last().pose();
180+
//#endif
173181
//$$ com.mojang.blaze3d.systems.RenderSystem.setShader(net.minecraft.client.renderer.GameRenderer::getPositionColorShader);
174182
//$$ bufferBuilder.begin(com.mojang.blaze3d.vertex.VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
175183
//$$ bufferBuilder.vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ).color(1F, 1F, 1F, 1F).endVertex();

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/DeadbushDropManipulation.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ public List<ItemStack> redirectDrops(Entity entity, int lootingBonus) {
7979

8080
@Override
8181
public void update() {
82+
//#if MC>=11903
83+
//$$ enabled.setPosition(x, y);
84+
//$$
85+
//$$ drop0Stick.setPosition(x, y + 96);
86+
//$$ drop1Stick.setPosition(x, y + 120);
87+
//$$ drop2Stick.setPosition(x, y + 144);
88+
//#else
8289
enabled.x = x;
8390
enabled.y = y;
8491

@@ -88,6 +95,7 @@ public void update() {
8895
drop1Stick.y = y + 120;
8996
drop2Stick.x = x;
9097
drop2Stick.y = y + 144;
98+
//#endif
9199

92100
drop0Stick.setWidth(width - x - 128 - 16);
93101
drop1Stick.setWidth(width - x - 128 - 16);

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/GlowstoneDropManipulation.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ public List<ItemStack> redirectDrops(Entity entity, int lootingBonus) {
7979

8080
@Override
8181
public void update() {
82+
//#if MC>=11903
83+
//$$ enabled.setPosition(x, y);
84+
//$$
85+
//$$ drop2Glowstonedust.setPosition(x, y + 96);
86+
//$$ drop3Glowstonedust.setPosition(x, y + 120);
87+
//$$ drop4Glowstonedust.setPosition(x, y + 144);
88+
//#else
8289
enabled.x = x;
8390
enabled.y = y;
8491

@@ -88,6 +95,7 @@ public void update() {
8895
drop3Glowstonedust.y = y + 120;
8996
drop4Glowstonedust.x = x;
9097
drop4Glowstonedust.y = y + 144;
98+
//#endif
9199

92100
drop2Glowstonedust.setWidth(width - x - 128 - 16);
93101
drop3Glowstonedust.setWidth(width - x - 128 - 16);

0 commit comments

Comments
 (0)