Skip to content

Commit

Permalink
✨ Backport 1.19.3. (Close #13)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Sep 16, 2023
1 parent a9879d8 commit 156d32f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Location(位置): `./config/nbtedit.json`
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286750-in-game-nbtedit-edit-mob-spawners-attributes-in

## Screenshots(使用截图)
![使用截图 #1](https://github.com/qyl27/NBTEdit/raw/1.19.4/img/2.png)
![使用截图 #2](https://github.com/qyl27/NBTEdit/raw/1.19.4/img/3.png)
![使用截图 #1](https://github.com/qyl27/NBTEdit/raw/1.19.3/img/2.png)
![使用截图 #2](https://github.com/qyl27/NBTEdit/raw/1.19.3/img/3.png)

## Common issues(常见问题)
- I was kicked when I tried to save my edit(在尝试保存时被服务器踢出):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ protected Minecraft getMinecraft() {

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
super.render(poseStack, mouseX, mouseY, partialTick);

RenderSystem.setShaderTexture(0, WINDOW_TEXTURE);
blit(poseStack, getX(), getY(), 0, 0, width, height);

Expand Down Expand Up @@ -202,12 +200,16 @@ public boolean charTyped(char character, int keyId) {
public boolean mouseClicked(double mouseX, double mouseY, int button) {
// Todo: qyl27: remove new line button and color button.
for (var widget : widgets) {
widget.changeFocus(false);
if (widget.isFocused()) {
widget.changeFocus(false);
}
}

for (var widget : widgets) {
if (widget.isMouseOver(mouseX, mouseY)) {
widget.changeFocus(true);
if (!widget.isFocused()) {
widget.changeFocus(true);
}
return widget.mouseClicked(mouseX, mouseY, button);
}
}
Expand Down Expand Up @@ -256,6 +258,7 @@ private static void isValueValid(String value, byte type) throws NumberFormatExc
case 6 -> ParseHelper.parseDouble(value);
case 7 -> ParseHelper.parseByteArray(value);
case 11 -> ParseHelper.parseIntArray(value);
case 12 -> ParseHelper.parseLongArray(value);
}
}

Expand Down Expand Up @@ -301,6 +304,13 @@ private static String getValue(Tag tag) {
}
return i.toString();
}
case Tag.TAG_LONG_ARRAY -> {
var i = new StringBuilder();
for (long a : ((LongArrayTag) tag).getAsLongArray()) {
i.append(a).append(",");
}
return i.toString();
}
default -> {
return NBTHelper.toString(tag);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ minecraft_version=1.19.3
parchment_minecraft_version=1.19.3
parchment_version=2023.06.25

fabric_loader_version=0.14.21
fabric_loader_version=0.14.13
fabric_api_version=0.76.1+1.19.3
mod_menu_version=5.1.0

Expand Down

0 comments on commit 156d32f

Please sign in to comment.