-
Notifications
You must be signed in to change notification settings - Fork 324
Full refactor of MetaMachine to merge MetaMachine and MetaMachineBlockEntity class and rework the machine inheritance tree #4304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gustovafing
wants to merge
38
commits into
1.20.1-v8.0.0
Choose a base branch
from
gus/refactor-machine-construction
base: 1.20.1-v8.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
0223762
implement new machine trait construction for steam machines (rebased)
gustovafing 777a2f2
port all the singleblocks (rebased
gustovafing ea5fe71
multi parts
gustovafing 8a1e919
update multi controllers
gustovafing 814b5e0
remove args on some machines
gustovafing 55ff9c5
clear up unneeded ctor args
gustovafing c81571e
spotless
gustovafing d835e9c
remove more unneeded args
gustovafing 34dbc03
fix large boiler logic
gustovafing fee778f
fix build issues
gustovafing 78ae2c4
tear out MetaMachineBlockEntity, update all machine classes
gustovafing c20a096
clean up all remaining references
gustovafing 8e476fc
fix some small sync errors
gustovafing 09d9db3
spotless stuff, create IGregtechBlockEntity
gustovafing 58070e2
remove mmbe usage
gustovafing bee9e05
fix data load issue
gustovafing f973024
small interface method changes
gustovafing d4a4c66
spotless
gustovafing 1a34578
change workable tiered machine ctors
gustovafing 7422200
fix simple tiered machine ctor
gustovafing ab29444
start docs
gustovafing 9059427
more docs
gustovafing d510e8d
a
gustovafing e6a0e1b
add tank scaling function back
gustovafing 2518523
fix minermachine
gustovafing 9363d09
move some static capability stuff
gustovafing 583acc2
io both
gustovafing ffb9be6
small changes based on PR review
gustovafing 3597764
Update src/main/java/com/gregtechceu/gtceu/api/machine/MetaMachine.java
gustovafing 8db109e
move cap stuff back to metamachine
gustovafing 8eb9e30
remove IRedstoneSignalMachine
gustovafing 36acd04
god class metamachine
gustovafing e3dd274
Update MetaMachine.java
gustovafing 68cdb87
spotless + add missing null check
gustovafing eb9bbca
remove TestUtils.getMetaMachine func
gustovafing c44a4d5
fix hammer drop conversion
gustovafing 8a6e98e
fix ldp again
gustovafing f6e1b0d
spotless
gustovafing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| title: "Version 8.0.0" | ||
| --- | ||
|
|
||
|
|
||
| # Updating from `7.4.0` to `8.0.0` | ||
|
|
||
| ## Machine Refactor | ||
|
|
||
| Many aspects of the machine classes have been refactored and changed in order to streamline the machine system and remove legacy and unnecessary abstraction. | ||
|
|
||
| ### `MetaMachine` and `MetaMachineBlockEntity` merge | ||
|
|
||
| - The `MetaMachineBlockEntity`(MMBE) class has been removed, and `MetaMachine`(MM) is now a BlockEntity. | ||
| - Most methods and properties of MMBE have been moved onto MM. | ||
| - The `IMachineBlockEntity` interface has been removed. Use `MetaMachineBlock` directly instead. | ||
| - Many methods common to all block entities have been moved to the `IGregtechBlockEntity` interface. | ||
| - Machine instance creation functions have signature `(BlockEntityCreationInfo) -> MetaMachine` instead of `(IMachineBlockEntity) -> MetaMachine` | ||
|
|
||
| References to MMBE can generally be replaced with references to MM: | ||
| ```java | ||
| /////// OLD | ||
| if (level.getBlockEntity(getPos()) instanceof MetaMachineBlockEntity mmbe) { | ||
| MetaMachine machine = mmbe.getMetaMachine(); | ||
| ... | ||
| } | ||
|
|
||
| ////// NEW | ||
| if (level.getBlockEntity(getPos()) instanceof MetaMachine machine) { | ||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| The `IMachineBlockEntity holder` argument in machine constructors has been replaced with `BlockEntityCreationInfo info`: | ||
| ```java | ||
| ////// OLD | ||
| public MetaMachine(IMachineBlockEntity holder); | ||
| ////// NEW | ||
| public MetaMachine(BlockEntityCreationInfo info); | ||
| ``` | ||
| A number of methods have been renamed across a number of different interfaces and classes to ensure consistency with default BlockEntity methods: | ||
| - `BlockPos getPipePos()` -> `BlockPos getBlockPos()` | ||
| - `Level getPipeLevel()` -> `Level getLevel()` | ||
| - `BlockPos getPos()` -> `BlockPos getBlockPos()` | ||
| - `BlockState getState()` -> `BlockState getBlockState()` | ||
| - `boolean isInvalid()` -> `boolean isRemoved()` | ||
| - `void markAsDirty()` -> `void markAsChanged()` | ||
|
|
||
| ### Machine constructor and trait initialisation changes | ||
|
|
||
| The constructors for a large number of machines have changed in order to simply machine instance creation. Additionally, methods for trait creation have also been removed and now form part of the machine constructor. | ||
|
|
||
| #### **All Machines** | ||
| - Replace the first constructor argument `IMachineBlockEntity holder` with `BlockEntityCreationInfo info` | ||
| #### `TieredEnergyMachine` | ||
| - Removed `createEnergyContainer` method | ||
| - Constructor now has an optional `Supplier<NotifiableEnergyContainer>` argument | ||
| #### `WorkableTieredMachine` | ||
| - Removed `createRecipeLogic`, `createImportItemHandler`, `createExportItemHandler`, `createImportFluidHandler`, `createExportFluidHandler` methods | ||
| - Added a new constructor: | ||
| - `BlockEntityCreationInfo info` | ||
| - `int tier` | ||
| - `Supplier<RecipeLogic> recipeLogicSupplier` Recipe logic supplier, defaults to the standard `RecipeLogic` class. | ||
| - `int importSlots` Item import slots, defaults to the amount of slots in the machine's default recipe type. | ||
| - `int exportSlots` Same as above, but for item export slots. | ||
| - `int fluidImportSlots` As above, but for fluid import slots. | ||
| - `int fluidExportSlots` As above, but for fluid export slots. | ||
| - `Int2IntFunction tankScalingFunction` Fluid tank capacity scaling function. | ||
| #### `WorkableMultiblockMachine`, `WorkableElectricMultiblockMachine` and `SteamWorkableMachine` | ||
| - Removed `createRecipeLogic` method | ||
| - Constructor now has an optional `Supplier<RecipeLogic>` argument, defaults to the standard `RecipeLogic` class | ||
90 changes: 0 additions & 90 deletions
90
src/main/java/com/gregtechceu/gtceu/api/block/IMachineBlock.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id' say update this, but honestly we'll updaet it when 8.0.0 merges xd also, didn't a file like this exist for the sync pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can flesh all this out closer to release