Skip to content

Cleanup and clarification #25

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
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/alloy-forgery/building-a-forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project: alloy-forgery

*Up to date as of 2.0.22*

You can currently make an Alloy Forge out of 5 materials: Bricks, Stone Bricks, Blackstone, Deepslate, and End Stone. Alloy Forges are dynamically generated. You can add more of these through data, which is explained [on this page.](../defining-a-forge.md)
You can currently make an Alloy Forge out of 5 materials: Bricks, Stone Bricks, Blackstone, Deepslate, and End Stone. Alloy Forges are dynamically generated. You can add more of these through data, which is explained [on this page.](defining-a-forge.md)

The basic shape of a forge looks like this:
![an image showing how to construct an Alloy Forge in 3 steps. Layer one is a 3x3 base. Layer two is the forge controller block in the front, and one block on each side, leaving the corners and the middle empty. Step three is the same as step two, but with a block instead of a controller](../assets/alloy-forgery/forge_structure.png)
Expand Down Expand Up @@ -39,7 +39,7 @@ A forge can by default be fueled by vanilla materials. Currently they accept the
- Blaze Rods
- Lava Bucket

For more information on how to add recipes and fuels, [go to this page.](../adding-recipes-and-fuels.md)
For more information on how to add recipes and fuels, [go to this page.](adding-recipes-and-fuels.md)

## Automation
As of Alloy Forgery 2.0.0 automation has been improved. You can now finally use hoppers to automate alloy forging.
Expand Down
2 changes: 1 addition & 1 deletion docs/alloy-forgery/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project: alloy-forgery

Alloy Forgery is a mod all about forging metals.

If you are a player looking for info on how to make an Alloy Forge, see the ["Building a Forge"](../building-a-forge) section. We recommend a mod like Roughly Enough Items or EMI to view alloy recipes.
If you are a player looking for info on how to make an Alloy Forge, see the ["Building a Forge"](building-a-forge.md) section. We recommend a mod like Roughly Enough Items or EMI to view alloy recipes.

By default, Alloy Forgery provides no new materials, but it does provide recipes for smelting ores into extra ingots. It also supports a handful of mods out of the box, [which you can see here.](https://github.com/wisp-forest/alloy-forgery/tree/1.20/src/main/resources/data/alloy_forgery/recipes/compat)

Expand Down
Binary file added docs/assets/owo/owo-sentinel-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/owo/owo-sentinel-installing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/owo/owo-sentinel-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ summary: The Wisp Forest Documentation Hub
![wisp forest banner](assets/wf-header.png){ .center-image .sized-image style="--image-width: 65%; margin-top: -3em;" }

### :material-account: For Users
- If you're a user, you're probably looking for the [FAQ](faq) which should answer most of the common questions and problems you might encounter.
- If you're a user, you're probably looking for the [FAQ](faq.md) which should answer most of the common questions and problems you might encounter.
- You can also find the guidebooks of our mods hosted, over on the [guides subdomain](https://guides.wispforest.io)
- The documentation for [Isometric Renders](isometric-renders/home.md) is also available here, with every aspect of the mod covered in great detail.
- So is that of [Numismatic Overhaul](numismatic-overhaul/home.md), with information on both the player-facing features and developer-facing trade format documentation


### :material-code-json: For Developers
- The documentation for oωo can be found [here](owo/setup)
- The documentation for oωo can be found [here](owo/setup.md)
- The documentation for scatter is located [here](scatter/home.md)
- You can also find a [list of all Fabric API events](fabric-events.md) on this site

Expand Down
4 changes: 3 additions & 1 deletion docs/owo/config/synchronization.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ To enable config sync, simply apply the `@Sync` annotation to the option you wan
- `Option.SyncMode.OVERRIDE_CLIENT`: Send the server's value to the client and temporarily override the client's value. Enabling `OVERRIDE_CLIENT` implies `INFORM_SERVER`

!!! info "Option Serialization"
To send your config's value over the network, owo's networking stack is employed - specifically the `PacketBufSerializer` system. It *should* support all commonly used types out-of-the box, yet it is not impossible to think of a situation where you may need a custom serializer. For those cases, simply call `PacketBufSerializer.register(...)` **before** you load your config and provide the necessary code.
To send your config's value over the network, owo's networking stack is employed - specifically the `Endec` serialization framework . It *should* support all commonly used types out-of-the box, yet it is not impossible to think of a situation where you may need a custom `Endec`.

For those cases, you can add your custom `Endec` by adding to your Config instance's `ReflectiveEndecBuilder` within the `createAndLoad` method by passing a custom `BuilderConsumer`. Such allows your to add your custom `Endec` by calling the `ReflectiveEndecBuilder.register(...)` method.

### Detached Options
When a client-side option gets overridden by the server, it enters the so-called "detached" state. In this state, it is essentially a dangling container for a value without any relation to its backing field. It will not get serialized when the config gets saved and any attempt made at modifying its value will fail. Should the player open the config screen while on a server, the option will appear as "managed by the server" and cannot be edited.
Expand Down
37 changes: 29 additions & 8 deletions docs/owo/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ oωo offers a flexible system for automatically registering a class' fields into
### Networking
:octicons-tag-24: 0.4.0

oωo provides a fully-featured network serialization system. Built around `OwoNetChannel` and the `PacketBufSerializer` framework, packet data is automatically (de-)serialized and the corresponding handlers invoked without the need of keeping track of Identifiers or channel associations - everything is derived from the data class. Packet contents are defined
as Java `record`s, making it highly ergonomic. The serialization backend fully supports serializers for custom types and all channel-layout related data is synced between client and server making it so an incompatible server cannot be joined.
oωo provides a fully-featured network serialization system. Built around `OwoNetChannel` and the `Endec` framework, packet data is automatically (de-)serialized and the corresponding handlers invoked without the need of keeping track of Identifiers or channel associations - everything is derived from the data class. Packet contents are defined
as Java `record`s, making it highly ergonomic. The serialization backend fully supports serializers for custom types and within development, all channel-layout related data is synced between client and server making it so an incompatible server cannot be joined.

### [Item Groups](item-groups.md)
:octicons-tag-24: 0.2.0
Expand All @@ -27,7 +27,7 @@ oωo provides two main systems for handling particles. Primarily there's a clien
### Debug/Dev Features
:octicons-tag-24: 0.3.0

When in a development environment, oωo's debug mode is automatically enabled which adds a host of features like commands for damaging/healing the player or dumping information about game objects, automatically disabled weather and daylight cycle and a few more.
When in a development environment, oωo's debug mode is automatically enabled which adds a host of features like commands for damaging/healing the player or dumping information about game objects, automatically **disabled weather and daylight cycle** and a few more.

### Moddata
:octicons-tag-24: 0.3.0
Expand All @@ -39,11 +39,6 @@ The `ModDataLoader` and related API are designed to allow loading JSON-formatted

oωo contains a few very simple helpers to facilitate the creation of a simple `HandledScreen` and `ScreenHandler`, namely a type of slot that only allows certain items as well as methods for generating the player inventory slots required for almost all screens.

### NBT Handling
:octicons-tag-24: 0.7.0

The `NbtKey` class is a simple serialization wrapper that allows inserting and extracting data values from `NbtCompound` instances. It essentially wraps the `get(...)` and `put(...)` methods to eliminate magic strings and centralize serialization code.

### Tag Injection
:octicons-tag-24: 0.3.6

Expand All @@ -53,3 +48,29 @@ The `TagInjector` system allows you to inject entries into tags at runtime. Ther
:octicons-tag-24: 0.5.0

The `OfflineDataLookup` and `OfflineAdvancementLookup` interfaces enable easily querying and/or modifying the NBT and Advancement data of offline players. As everything in oωo, the API surface is non-verbose to use and usually does not require more than a single method call.

### [UI Framework](./ui/index.md)

:octicons-tag-24: 0.8.0

owo-ui is a declarative UI framework that helps with building dynamic screens quickly and easily. It strives to be highly embeddable, performant and, most of all, super easy to use. More information pertaining to it features and capabilities can be found within [UI section](./ui/index.md)

### [Configuration](./config/index.md)

:octicons-tag-24: 0.8.0

oωo provides a highly flexible annotation-driven configuration system. It aims to be simple yet powerful and offers a wide range of customizability and features as discussed within the [Config section](./config/index.md)

### Endec

:octicons-tag-24: 0.12.0

[endec](https://github.com/wisp-forest/endec) is a format-agnostic serialization framework inspired by Rust's [serde](https://serde.rs) library and the Codec API from Mojang's [DataFixerUpper](https://github.com/mojang/datafixerupper). More information on its features and implementation details can be found within the (WIP: Planned addition) [Endec Section]()

#### Deprecated/Removed

### NBT Handling
:octicons-tag-24: 0.7.0 - 0.12.0

The `NbtKey` class is a simple serialization wrapper that allows inserting and extracting data values from `NbtCompound` instances. It essentially wraps the `get(...)` and `put(...)` methods to eliminate magic strings and centralize serialization code.

26 changes: 24 additions & 2 deletions docs/owo/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ project: owo
Networking can be quite the hassle to set up and maintain when using only the tools provided to you by Minecraft and Fabric API. owo, however, includes an easy-to-use networking stack which is quick to set up and even easier to maintain while still keeping high performance.

## Concepts
owo's networking API comprises of two core systems - the `OwoNetChannel`, which handles all networking, and the mostly self-contained `PacketBufSerializer`, which takes care of serializing objects into packet buffers.
owo's networking API comprises of two core systems - the `OwoNetChannel`, which handles all networking, and `Endec` the serialization framework, which takes care of serializing objects into packet buffers.

For safety reasons, using a channel in your mod will enable owo's handshaking procedure. This verifies that the channel layout on both server and client is identical, to prevent possible crashes or malformed data received, if one side is encoding differently than the other expects.
!!! note "Owo Handshake"
When using a channel in your mod, owo's handshaking will be enabled for validation purposes. Such a feature is only active within development environment and verifies that the channel layout on both server and client is identical, to prevent possible crashes or malformed data received, if one side is encoding differently than the other expects.

## Implementation

Expand Down Expand Up @@ -120,4 +121,25 @@ Once you obtained a handle, you can use it to send a packet:
=== "Client Example"
```java
MyModInitializer.MY_CHANNEL.clientHandle().send(new MyPacket(1, "this", new Identifier("is", "podge")));
```

### Registering Custom Endec's

There may be a point where a given message may contain object types that can not easily be reflectively built using the `ReflectiveEndecBuilder` meaning you may need to register custom `Endec`'s. This can be accomplished by calling your channels `addEndecs(...)` which allows for the ability to modify the channels builder by calling `register(...)` with the your custom `Endec`s.

=== "Registration Example"
```java
public record MyPacket(int index, String name, Identifier target, @Nullable List<String> additionalNames) {
public static final StructEndec<MyPacket> ENDEC = StructEndecBuilder.of(
Endec.INT.fieldOf("index", MyPacket::index),
Endec.STRING.fieldOf("name", MyPacket::name),
MinecraftEndecs.IDENTIFIER.fieldOf("target", MyPacket::target),
Endec.STRING.listOf().nullableOf().fieldOf("additional_names", MyPacket::additionalNames),
MyPacket::new
);
}

MyModInitializer.MY_CHANNEL.addEndecs(builder -> {
builder.register(MyPacket.ENDEC, MyPacket.class);
});
```
31 changes: 26 additions & 5 deletions docs/owo/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,45 @@ Then, declare the dependency inside your `dependencies` block and as well as the
```groovy
dependencies {
modImplementation "io.wispforest:owo-lib:${project.owo_version}"
// Optional Utility Module, More info below
// You still need to depend on owolib within your Fabric Mod Json (FMJ) as documented in Fabric Wiki [here](https://wiki.fabricmc.net/documentation:fabric_mod_json)
// and declaring your dependency on owolib on sites your upload your mod i.e. Modrinth or Curseforge
include "io.wispforest:owo-sentinel:${project.owo_version}"
}
```

!!! hint ""
As you can see, this example also includes `owo-sentinel`. sentinel is a super tiny mod which is designed to be Jar-in-Jar'd by mods that depend on owo. If a player then installs your mod without installing owo, sentinel will prevent their game from launching and instead open a window warning them that owo is required. It gives them the option to automatically install owo or open owo's page so they can do it manually
!!! hint "owo-sentinel Explanation"
owo-sentinel is a super tiny mod which is designed to be Jar-in-Jar'd by mods that depend on owo. If a player then installs your mod **without** installing owo, sentinel will prevent their game from launching and instead open a window warning them that owo is required. This means if owo is present sentinel will do **nothing**.

![owo-sentinel example popup](../assets/owo/owo-sentinel-open.png){ .center-image .docs-image style="max-width: 45%;" }

It gives them the **option** to either of the following:

- Automatically install owo using Modrinth as a source and selecting the latest version of owolib for the given Minecraft version.

![owo-sentinel example popup](../assets/owo/owo-sentinel-installing.png){ .center-image .docs-image style="max-width: 45%;" }

- Open a sub window with information about what sentinel is and an optional button to open github repo to download the lib else where if desired.

![owo-sentinel example popup](../assets/owo/owo-sentinel-info.png){ .center-image .docs-image style="max-width: 45%;" }

- Closes sentinel without doing any operation and stops the current java process to which spawn it.

Such code for this can be found within the owo-lib repo [here](https://github.com/wisp-forest/owo-lib/tree/1.21.5/owo-sentinel).

### Dependency Declaration requirement:
You as a developer still needs to declare your dependency on owolib within your Fabric Mod Json (FMJ) and any platform you upload on your mod if possible! sentinel just acts as a verification step for people who forget to install dependency outside of launchers who handle dependencies and when downloading mods from sites like Modrinth or Curseforge allowing for the quicker resolution of missing owolib if desired.

=== "build.gradle (Neoforge)"
```groovy
dependencies {
// Vanilla/Moddev Projects - Neoforge
// Moddev Projects - Neoforge
implementation "io.wispforest:owo-lib-neoforge:${project.owo_version}"
accessTransformers "io.wispforest:owo-lib-neoforge:${project.owo_version}"
interfaceInjectionData "io.wispforest:owo-lib-neoforge:${project.owo_version}"

// Arch Loom Projects - Neoforge
modImplementation "io.wispforest:owo-lib-neoforge:${project.owo_version}"

// Required due to issues with Arch Loom and JIJ within neo. May require bumping the version every once and awhile.
forgeRuntimeLibrary("io.wispforest:endec:0.1.8")
forgeRuntimeLibrary("io.wispforest.endec:netty:0.1.4")
Expand All @@ -56,7 +77,7 @@ Then, declare the dependency inside your `dependencies` block and as well as the
dependencies {
// Moddev Projects - Neoforge
compileOnly "io.wispforest:owo-lib-neoforge:${project.owo_version}"
accessTransformer "io.wispforest:owo-lib-neoforge:${project.owo_version}"
accessTransformers "io.wispforest:owo-lib-neoforge:${project.owo_version}"
interfaceInjectionData "io.wispforest:owo-lib-neoforge:${project.owo_version}"

// Arch Loom Projects - Neoforge
Expand Down