-
Notifications
You must be signed in to change notification settings - Fork 205
Make MetaTileEntity extend TileEntity and deprecate MetaTileEntityHolder #2904
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
Draft
ghzdude
wants to merge
38
commits into
GregTechCEu:master
Choose a base branch
from
ghzdude:gh/make-mte-extend-te
base: master
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.
Conversation
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
but i will
this should be everything that instantiates the TE
get convert chunk block pos to world pos
tear out references to mte holder and replace with GTBaseTileEntity
holy shit it actually works kinda multiblock previews are fucked up tho they all face north
try and initialize the mte like it was in MTE holder fix retrieving the wrong TE at a pos really these TEs should be added to the world directly
not finished use Object instead of generics
delete tile map from GTBaseTileEntity fix TileEntityMixin send mte info to client go back to using threadlocal for placing mte add special tile entity method for DummyWorld get rid of chunk load event improve ClientHandlerMixin delete ChunkMixin.java fix BlockPattern ??? simplify BlockMachine create mte
some minor lighting issues in jei preview large boilers are always borked because even in master
add copy method set TE in block placed method
mark getWorld and getPos to unknown nullability
deprecate `createMetaTileEntity()` in MetaTileEntity rename `createMetaTileEntity` -> `copy` cleanup/spotless
deprecate holder
add helper methods in GTUtility
should theoretically still work if anyone extended the class clean up GTBaseTileEntity
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.
What
Make MTE extend TileEntity through GTBaseTileEntity.
Could be a good candidate for 2.9
Implementation Details
for MetaTileEntity and extending classes, certain methods had to be renamed:
writeToNBT->writeMTETagreadFromNBT->readMTETagwriteInitialSyncData->writeInitialSyncDataMTEreceiveInitialSyncData->receiveInitialSyncDataMTEupdate->updateMTEnotable changed classes are:
MetaTileEntity#createMetaTileEntity(IGregTechTileEntity)is now deprecated and replaced byMetaTileEntity#copy()all usages of
setMetaTileEntity()from mte holder has been replaced withMTE#copy()BlockMachine might not need to implement
ITileEntityProviderBlockMachine now creates the MTE in
onBlockPlacedBy()create GTBaseTileEntity to map TE methods to MTE methods
replace usages of
MetaTileEntityHolderwithGTBaseTileEntitytrack tile entities by pos in DummyWorld
add
forcePlaceto dummy worldadd toString impl for BlockInfo
create ClientHandlerHooks along with ClientHandlerMixin to instantiate MetaTileEntities
TileEntity#Create()needs a mixin to avoid the reflection call to a no args constructorTileEntity#writeInternal()needs a mixin because the MTE is registered with the GTBaseTileEntity classPacketRecoverMTE could be removed
probably other things that i have yet to write in this pr
Outcome
people can now implement TileEntity interfaces on MTE
Potential Compatibility Issues
This might impact other prs? i don't know
this may affect the local trout population