forked from MightyPirates/OpenComputers
-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/creative tab #46
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
Grahmindol
wants to merge
39
commits into
CaitlynMainer:main-MC1.21.1
Choose a base branch
from
Grahmindol:feature/creative-tab
base: main-MC1.21.1
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
39 commits
Select commit
Hold shift + click to select a range
e53de23
added section padding
Grahmindol bd2b0e3
added section title
Grahmindol 00e8f57
sneak-dbl click
CaitlynMainer 51ea97d
Complete the double-sneak-click system.
CaitlynMainer 46f7bb8
Support? Create movement?
CaitlynMainer 35c3cdd
Fix fan sound being heard everywhere.
CaitlynMainer cb08486
Create contraption support.
CaitlynMainer 9abe1f6
Fix java.lang.NoClassDefFoundError
CaitlynMainer 6c40015
Computers work on trains.
CaitlynMainer 1b653c7
Create Train component.
CaitlynMainer 5784fcf
Fixes crash on dedicated server
CaitlynMainer 4e1eb14
Fix tablet crashing on dedicated server
CaitlynMainer b123acb
Implement #39 with the component clear method
CaitlynMainer 02cdcfb
Undo the async beep that somehow snuck back in
CaitlynMainer 868d18e
update funscii to unifont 17.0.05
CaitlynMainer db1ae7d
Create bug_report.md
CaitlynMainer 52d3808
Fix disassembler template output handling
CaitlynMainer a8e2f80
Generate block state files
SquidDev 8b33eb1
Use a dedicated component for chamelium color
SquidDev 28142a6
Prideflag Robots!
CaitlynMainer cc0871e
Correct CC:T Pride flag license
CaitlynMainer 56388d9
Add Create train computer integration and train robot
CaitlynMainer b4dfefe
Create CC-Tweaked.txt
CaitlynMainer 97d5705
Persist train component, make sure screens initialize after restore
CaitlynMainer dd4267f
Fix TextBuffers loading blank after restore
CaitlynMainer be4f800
Fix tablet rendering with batching mods and shaders
CaitlynMainer 477abf0
Open tablet UIs even when not looking at a block
CaitlynMainer c8241bf
Open manual on right click again...
CaitlynMainer 02454bb
Resync monitor resolution and color on load
CaitlynMainer 1dfe1bb
better banner
Grahmindol 1638803
Merge branch 'main-MC1.21.1' into feature/creative-tab
Grahmindol 561f695
add disk/eeprom support
Grahmindol f1e0c87
handle network T2 card ban
Grahmindol 0ffcc11
handle openprinter.....
Grahmindol 6383f0d
merge resolve OCItems
Daydrain 8704f39
some few fixs
Daydrain d5e1eb9
Merge branch 'main-MC1.21.1' into feature/creative-tab
Grahmindol 0e755f4
fix server crach
Grahmindol e4b7f35
just to test the modificated API, it's not that bad.
Grahmindol 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
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
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
14 changes: 14 additions & 0 deletions
14
src/main/java/li/cil/oc/mixin/accessor/AbstractContainerScreenAccess.java
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,14 @@ | ||
| package li.cil.oc.mixin.accessor; | ||
|
|
||
| import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
|
||
| @Mixin(AbstractContainerScreen.class) | ||
| public interface AbstractContainerScreenAccess { | ||
| @Accessor() | ||
| int getLeftPos(); | ||
|
|
||
| @Accessor | ||
| int getTopPos(); | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/main/java/li/cil/oc/mixin/accessor/CreativeModeInventoryScreenAccess.java
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,13 @@ | ||
| package li.cil.oc.mixin.accessor; | ||
|
|
||
| import net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen; | ||
| import net.minecraft.util.Mth; | ||
| import net.minecraft.world.item.CreativeModeTab; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.Shadow; | ||
|
|
||
| @Mixin(CreativeModeInventoryScreen.class) | ||
| public interface CreativeModeInventoryScreenAccess { | ||
| @Shadow | ||
| static CreativeModeTab selectedTab = null; | ||
| } |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
| { | ||
| "required": false, | ||
| "minVersion": "0.8", | ||
| "package": "li.cil.oc.mixin", | ||
| "compatibilityLevel": "JAVA_21", | ||
| "client": [ | ||
| "CreativeModeInventoryScreenMixin", | ||
| "ItemPickerMenuMixin", | ||
| "accessor.CreativeModeInventoryScreenAccess", | ||
| "accessor.AbstractContainerScreenAccess" | ||
| ], | ||
| "mixins": [ | ||
| "CreativeModeTabMixin" | ||
| ], | ||
| "injectors": { | ||
| "defaultRequire": 1 | ||
| } | ||
| } |
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
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
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
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.
Attempted to load class net/minecraft/client/gui/GuiGraphics for invalid dist DEDICATED_SERVERCreativeTab is loaded on both Client and Server, you can't have client rendering code in a common location.
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.
Also with this PR in place I am no longer able to register floppies directly from external mods, all floppy names seem to be forced to their internal name, and I am unable to register an item to the OC creative tab from another mod.
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.
The
renderBannersnmethod wasn't even being called, but that simple declaration was what caused the error—I never would have guessed. So, I moved it.Uh oh!
There was an error while loading. Please reload this page.
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.
Normally, you can continue adding items to the end of the tab just as before, since I’m not adding padding at the end.
When using the API, floppy disks and EEPROMs should already appear in the tab.
To be able to add items to a section, a method would need to be added to
li.cil.oc.api.Items.java.kind of :
However, this entails a significant change to the API.
A comment in
li.cil.oc.api.CreativeTabshould be used to explain how to register items in a section.(It doesn't seem ideal to me, but if it works for you, it works for me.)
(I haven't committed anything for this yet because I'm waiting to see if you have a better idea.)
Thanks for the review!