Text Fields Synchronizer

Published by 151chit on
Supported MCreator versions
2024.1
EAP 2024.2.24713
Tags / plugin type
Templates
plugin_image
Downloads:
190
Upvotes: 4
About the plugin

This plugin allows you to synchronize text fields between the server and client.

I also didn't implement the procedures called by the "When the GUI is opened" trigger, because when the GUI is opened, the text in the text field will never be different from "".

Supported versions:

  • 1.20.1 (forge)
  • 1.20.4 (neoforge)
  • 1.18.2 (forge) 2023.1-2023.3 Not fully tested

Supported components:

  • Procedure called by a button/image button
  • Procedure called every tick while the GUI is open
  • All 6 procedures called by slot interactions
  • Procedure called after GUI is closed
  • Boolean checkbox values
  • Setting values ​​in a text field:

                  1.All players (even external trigger)

                  2.To the player using an entity dependency (even an external trigger)                   

It adds new procedure blocks for reading the values ​​of checkboxes and text fields, and for setting the value of text fields:
procedure

setvalue

checkbox

When you click a button on the server, the client side writes all the values ​​of the text fields into a new hash map and sends it over the standard network packet of the mcreator button, in the network packet this hash map is combined with the guistate hash map from mcreator and the new procedure block can read it.

testing

The source code is the plugin itself.

In this case, an unlimited number of text fields and checkboxes is supported, but do not fill the text field to the maximum value, otherwise the network packet will exceed the permissible limit in bytes and you will be kicked from the server!

1.0

Plugin released

1.1

  • Added synchronization of text fields for procedures called by slot interactions
  • The "Every tick while the gui is open" trigger has been moved from the render method to the containerTick method to reduce the speed of the procedure and improve performance

1.2

  • Added support for the "When GUI is closed" trigger

1.3

  • Added a block for setting the value of a text field for a player (entity) or for all players for the currently open GUI for the server.

1.4

  • Added support for checkboxes (if the checkbox is checked)

1.5

  • Fixed a critical error leading to a ClassCastException when trying to press a button with a procedure when the trigger “when the gui is closed” or “every tick while the gui is open” is simultaneously attached to this procedure on 1.20.4 (neoforge)
  • 1.5.1: fixed a bug where the "every tick while the gui is open" trigger tried to call the textboxstart() method that was not intended for this purpose

1.6

  • Added support for snapshot 2024.2, 2 GUI bug fixes (mouse cursor, slots and blocks) were also ported to Neoforge 1.20.4 (2024.1)
Project members
Developer

Plugin downloads
Text Fields Synchronizer-1.4s (FOR 1.18.2 ONLY, 2023.1-2023.3) Not fully tested (probably fixed) - testsync-2.zipUploaded on: 06/09/2024 - 19:22   File size: 17.72 KB
Text Fields Synchronizer-1.6 - Textfields_sync_4.zipUploaded on: 06/16/2024 - 18:32   File size: 34.46 KB

Comments

I fear it is not working. When I try and save my GUIs, it gives me this error which I have never seen before: \MCreatorWorkspaces\MCNV\src\main\java\net\mcreator\mcnv\world\inventory\TerminalGUITestMenu.java:218: error: cannot find symbol
textBoxStart();
^

Damn, I forgot about the procedure for changing slots..... I'll have to do it

Doo89, the problem is that if the user fills the text field with characters to the maximum value, then he will be kicked from the server, and this can be easily fixed with a few lines of code, but in the context of blockly mcreator procedures this is very difficult to implement, and I have no idea how to do it correctly, without player variables and other unreliable methods, because the only method to fix this is to break the string into pieces and send it in a loop, but the receiving part must store this somewhere before collecting the entire source string, and if this is critically necessary, I will probably do this

Great plugin thanks a lot, this will be very useful for many mods. It should be included directly in MCreator 👍

It’s better not to fill the text field to the maximum value, otherwise the network packet will exceed the permissible byte limit and you will be kicked from the server!