Skip to content

Conversation

@Zorbatron
Copy link
Member

@Zorbatron Zorbatron commented Jun 26, 2025

What

Ports the following blocks to MUI2.

  • Alarm
  • Creative Energy Emitter
  • Data Access Hatches
  • Turbo Chargers
  • Item Collectors
  • Maintenance Hatches

Additional Information

  • Turbo Chargers have a colored overlay that goes from red to green as the battery charges.
  • Adds a way to add more sounds to the alarm with MetaTileEntityAlarm#addSound.
  • Refactors how tool fixing is done in maintenance hatches.
  • The Among Us wiring task has been removed from the maintenance hatch and has been replaced with FlappyGreg.
  • MTEs that have an MUI GUI now have to implement IMetaTileEntityGuiHolder. The actual opening of the UI is handled in MetaTileEntity, so implementing buildUI is all that it required for implementers.

Outcome

Knocks more things off of the migration list and improve how MUI GUIs are handled.

@Zorbatron Zorbatron added type: feature New feature or request type: refactor Suggestion to refactor a section of code labels Jun 26, 2025
@Zorbatron Zorbatron changed the title Port the alarm block to MUI2 Port more miscellaneous blocks to MUI2 Jul 2, 2025
Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if the creative energy block saved the voltage and the amperage it was set at when the player switches from source -> sink -> back to source.

If the Alarm is powered and active with a redstone signal, opening the GUI will restart the sound loop when it probably shouldn't.

Something seems wrong with maintenance on multiblocks. If I have a controller with three problems, break the controller, place down a new one quickly, it will still have 3 problems, instead of all of them from being a new controller.

.child(new ButtonWidget<>()
.size(18)
.onMousePressed(mouse -> {
guiData.getPlayer().playSound(selectedSound, 1.0f, 1.0f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not play a sound if a sound is already playing. Alternatively cancel the playing sound and start a new one. Also, since it is a preview, I think the sound should cancel if the GUI is closed. Just in case a really long sound is used.


public void setRadius(int radius) {
this.radius = radius;
GregTechAPI.soundManager.stopTileSound(getPos());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to send custom data to update right away?

Int2ObjectMap.Entry<String> entry = findMatchingClass(toolEntries,
toolStack.getItem().getToolClasses(toolStack));
if (entry != null) {
ToolHelper.damageItemWhenCrafting(toolStack, player);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should play the tool sounds that are used to fix the maintenance issues, so the player knows that something happened. Although if we are fixing multiple issues at one time, it might be best to only play the sound of the first tool.

@Zorbatron
Copy link
Member Author

Something seems wrong with maintenance on multiblocks. If I have a controller with three problems, break the controller, place down a new one quickly, it will still have 3 problems, instead of all of them from being a new controller.

That is intended. Multiblocks store their maintenance state when unforming

if (hasMaintenanceMechanics() && ConfigHolder.machines.enableMaintenance) { // nothing extra if no maintenance

and read it back when forming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants