1 Commits
2.2.3 ... 1.21

Author SHA1 Message Date
5953eb0640 Downgrade to 1.21 2025-07-30 15:34:43 +02:00
3 changed files with 18 additions and 13 deletions

View File

@ -5,15 +5,15 @@ org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.21.6 minecraft_version=1.21
yarn_mappings=1.21.6+build.1 yarn_mappings=1.21+build.1
loader_version=0.17.2 loader_version=0.16.14
loom_version=1.11-SNAPSHOT loom_version=1.10-SNAPSHOT
# Fabric API # Fabric API
fabric_version=0.128.2+1.21.6 fabric_version=0.100.3+1.21
# Mod Properties # Mod Properties
mod_version = 2.2.3 mod_version = 2.2.2
maven_group = de.steamwar maven_group = de.steamwar
archives_base_name = AdvancedScripts archives_base_name = AdvancedScripts

View File

@ -33,9 +33,9 @@ public class TokenTypeColors {
public static final int VARIABLE = 0xFFFFFFFF; public static final int VARIABLE = 0xFFFFFFFF;
public static final int COMMENT = 0xFF656565; public static final int COMMENT = 0xFF656565;
public static final int CONSTANT = 0xFF3F6EC6; public static final int CONSTANT = 0x3F6EC6;
public static final int NUMBER = 0xFF61839F; public static final int NUMBER = 0xFF61839F;
public static final int BOOLEAN = 0xFF925F35; public static final int BOOLEAN = 0xFF925F35;
public static final int STRING = 0xFF6a8759; public static final int STRING = 0x6a8759;
} }

View File

@ -19,7 +19,6 @@
package de.steamwar.advancedscripts.screen; package de.steamwar.advancedscripts.screen;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import de.steamwar.advancedscripts.lexer.ScriptColorizer; import de.steamwar.advancedscripts.lexer.ScriptColorizer;
import de.steamwar.advancedscripts.lexer.Token; import de.steamwar.advancedscripts.lexer.Token;
@ -74,7 +73,7 @@ public class ScriptEditScreen extends Screen {
this.itemStack = itemStack; this.itemStack = itemStack;
this.hand = hand; this.hand = hand;
List<RawFilteredPair<String>> pages = itemStack.get(DataComponentTypes.WRITABLE_BOOK_CONTENT).pages(); List<RawFilteredPair<String>> pages = itemStack.getComponents().get(DataComponentTypes.WRITABLE_BOOK_CONTENT).pages();
pages.forEach(stringRawFilteredPair -> { pages.forEach(stringRawFilteredPair -> {
for (String s : stringRawFilteredPair.raw().split("\n")) { for (String s : stringRawFilteredPair.raw().split("\n")) {
if (s.isEmpty()) { if (s.isEmpty()) {
@ -104,7 +103,7 @@ public class ScriptEditScreen extends Screen {
this.addDrawableChild( this.addDrawableChild(
new Button(BOOK, this.width - 98 - 5, height - 20 - 5, () -> { new Button(BOOK, this.width - 98 - 5, height - 20 - 5, () -> {
finalizeBook(); finalizeBook();
this.client.setScreen(new BookEditScreen(player, itemStack, hand, toContent(toPages()))); this.client.setScreen(new BookEditScreen(player, itemStack, hand));
}) })
); );
} }
@ -157,9 +156,15 @@ public class ScriptEditScreen extends Screen {
} }
} }
@Override
protected void applyBlur(float delta) {
}
@Override @Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) { public void render(DrawContext context, int mouseX, int mouseY, float delta) {
setFocused(null); setFocused(null);
this.renderBackground(context, mouseX, mouseY, delta);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
context.fill(23, 23, this.width - 23, this.height - 63, TokenTypeColors.BACKGROUND); context.fill(23, 23, this.width - 23, this.height - 63, TokenTypeColors.BACKGROUND);
int lineNumberLength = textRenderer.getWidth(lines.size() + ""); int lineNumberLength = textRenderer.getWidth(lines.size() + "");
@ -189,7 +194,7 @@ public class ScriptEditScreen extends Screen {
if (lineTooLong(s)) { if (lineTooLong(s)) {
context.fill(25 + lineNumberLength + 2, 25 + lineNumber.getValue() * 9, 25 + lineNumberLength + 3, 25 + lineNumber.getValue() * 9 + height, TokenTypeColors.ERROR); context.fill(25 + lineNumberLength + 2, 25 + lineNumber.getValue() * 9, 25 + lineNumberLength + 3, 25 + lineNumber.getValue() * 9 + height, TokenTypeColors.ERROR);
} }
context.drawText(textRenderer, String.valueOf(lineNumberText), (int) (25f + lineNumberLength - textRenderer.getWidth(String.valueOf(lineNumberText))), (int) (25f + lineNumber.getValue() * 9f), 0xFFFFFFFF, false); context.drawText(textRenderer, String.valueOf(lineNumberText), (int) (25f + lineNumberLength - textRenderer.getWidth(String.valueOf(lineNumberText))), (int) (25f + lineNumber.getValue() * 9f), 0xFFFFFF, false);
lineNumberText++; lineNumberText++;
// Line text // Line text
@ -629,7 +634,7 @@ public class ScriptEditScreen extends Screen {
private void finalizeBook() { private void finalizeBook() {
List<String> pages = toPages(); List<String> pages = toPages();
this.writeNbtData(pages); this.writeNbtData(pages);
int i = this.hand == Hand.MAIN_HAND ? this.player.getInventory().getSelectedSlot() : 40; int i = this.hand == Hand.MAIN_HAND ? this.player.getInventory().selectedSlot : 40;
this.client.getNetworkHandler().sendPacket(new BookUpdateC2SPacket(i, pages, Optional.empty())); this.client.getNetworkHandler().sendPacket(new BookUpdateC2SPacket(i, pages, Optional.empty()));
} }