Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
/ nifty-old Public archive

Library mod providing a basis for tech (or not) mods for Forge and Quilt/Fabric

License

Notifications You must be signed in to change notification settings

aeonic-mods/nifty-old

Repository files navigation

Nifty

Nifty is a cross-platform library mod that serves as a basis for tech mods targeting both Forge and Quilt/Fabric.

Features

Implemented

  • Abstracted registry system
    • Make things exist without ever touching platform-specific code!
    • The Registrar class allows for registering arbitrary game objects to any Vanilla registry from your mod's entry point
    • On Fabric, objects are registered directly and available immediately in the order the register method is called
    • On Forge, registry is deferred to the correct Forge event via the new resource key DeferredRegister support (#8527)
      • May be subject to change as this only works for 1.18.2+
  • Aspects
    • Original system closely mirrored Forge capabilities
    • New system is more close to the Fabric API lookup system
      • Aspect classes can be registered, then callbacks to certain objects that might contain them can be registered
      • On Fabric, this directly translates to the API lookup system
      • On Forge, lookups are tied into getCapability and aspects are registered as capabilities
    • Mods backed by Nifty can access Aspects registered by other mods through Nifty conditionally
    • Mods backed by Nifty can access implementations provided by other mods to a specific platform's system
      • On Forge, Aspect lookups can be used to get any registered capability
      • Registering an aspect interface on Fabric that already exists in the API lookup will just delegate lookups to the existing system
    • Mods that are not backed by Nifty can access any Aspect registered through Nifty via a specific platform's system
      • A mod running on Forge can access a specific Aspect without depending on Nifty, just by using getCapability
      • A Fabric mod can access any Aspect without depending on Nifty by using the API lookup system
    • Some internal Aspects
      • Item handlers, with complete compatibility for existing Forge IItemHandlers and the Fabric transfer api
        • Includes a simplified implementation using Slot objects to describe an inventory's functionality
      • Fluid handlers, same as above
      • Energy handlers, same as above + compat for Reborn Team's Energy API on Fabric
  • Modular UI system
    • UiElementTemplates, which can be used to make a UiElement instance for a given Screen (or other rendering scenario)
      • A few default template classes
      • A default UI set with vanilla ui assets and vanilla-style extras, such as fluid tanks and energy meters of various sizes
      • A bit messy, may revisit in the future
    • ModularMenuScreen
      • Renders UI elements added to the base list
      • Renders tooltips as defined by the UI elements
        • Default tooltips for fluid and energy handler UI elements
      • Integrated item slot ui elements with menu slots

Planned

  • More UI stuff
    • Extra templates
      • Energy usage over time graph like Satisfactory's would be very cool
      • Correct itemstack placement for offset slots such as the vanilla set's output slot
  • Tentatively, multiblocks
  • Rendering hooks
    • Holograms
    • Selection systems with item settings and syncing
      • Radial menus from abandoned multitool project
    • Math & other rendering utils
  • Abstracted configs
    • Avoid the extra dependency on Forge
    • Depend on Cloth or similar on Fabric
    • Simplified implementation as compared to Forge's configs
  • Abstracted networking
  • Abstracted tags deferring to platform tags

About

Library mod providing a basis for tech (or not) mods for Forge and Quilt/Fabric

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages