Skip to content

Introduce Tablet Computer#131

Open
IpsumCapra wants to merge 6 commits intoNorth-Western-Development:1.20.1from
IpsumCapra:feature/tablet
Open

Introduce Tablet Computer#131
IpsumCapra wants to merge 6 commits intoNorth-Western-Development:1.20.1from
IpsumCapra:feature/tablet

Conversation

@IpsumCapra
Copy link
Copy Markdown

Tablets for OC2:R!

This PR introduces tablet computers. A feature I was sorely missing from OC. While this isn't my first contribution to (the original) OC2, this is my first time creating such a feature for any sort of mod. All feedback, questions and suggestions are welcome.

Important implementation facts:

  • Tablet states use an overworld level capability server-side so tablets can tick regardless of where they are.
    • Client-side they use a static cache
    • Tablet ItemStacks know which state is theirs using a UUID stored in NBT
  • As tablets are items, the only way I could find to make sure their states are destroyed correctly along with the item was using mixins:
    • A mixin attached to onRemove of the Entity class for destruction occurrences in regular survival play
    • A mixin attached to onSlotClicked of the CreativeModeInventoryScreen class for destruction using the creative menu

Screenshots:

tablet-hello tablet-tooltip

This commit introduces the basis of the Tablet item. It contains:
- The item registration for the tablet
- Its name, description and textures
- All classes required for its virtual machine instance
- All network message classes to allow communication between server and
  client
- Required container classes
- Level capability to store tablet states on server
When the player destroys the tablet in any way, its VM state is now
removed from the level capability, and where applicable, from the
client-side cache.
Also adds a required TerminalUserProvider resolver for TabletStates to
the File Import/Export Card.
Register an item property for the Tablet which allows its texture to
change depending on whether or not it is running.
Register the crafting recipe for the Tablet.
Also corrects a typo in the robot entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant