Add a new gt_machine driver for oc#199
Closed
czqwq wants to merge 1 commit into
Closed
Conversation
PLASMAchicken
requested changes
Jun 6, 2026
Member
There was a problem hiding this comment.
Thank you for the AI generated PR, this takes wrong assumptions and does not fix the cause ( see GTNewHorizons/GT-New-Horizons-Modpack#25071 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary: Restoring GT Machine Driver and Enhancing OC Integration
Root Cause
The
gt_machinedriver was previously removed from the codebase, leaving onlygt_energyContainer(DriverEnergyContainer.java), which exposes only energy-related methods. As a result, scripts controlling GT machines such as the Black Hole Compressor could not function because required callbacks likegetName,setWorkAllowed,getWorkProgress, andgetWorkMaxProgressdo not exist ingt_energyContainer.Implemented Changes
Change 1 – New
DriverGTMachine.javaPath:
OpenComputers/src/main/scala/li/cil/oc/integration/gregtech/DriverGTMachine.javaPurpose: Provides a dedicated OC driver for all GT machine blocks that implement
IGregTechTileEntity(including the Black Hole Compressor controller).Exposed Lua callbacks:
Priority: Driver priority set to
0(higher thanDriverEnergyContainer's-1). Thus GT machines appear as component typegt_machinein the OC network, while energy methods (merged fromDriverEnergyContainer) remain available.Change 2 – Registration in
ModGregtech.scalaAdds the new driver to OC’s driver registry:
Driver.add(new DriverGTMachine)Final Result
Full functionality restored for the Black Hole Compressor and similar GT machines that depend on work state and progress queries.
Scripts can access both machine control methods (via
gt_machine) and energy methods without extra adaptation.Priority mechanism ensures backward compatibility; existing energy container drivers remain unaffected.
fixes GTNewHorizons/GT-New-Horizons-Modpack#25071