Utilize

# Utilize

A powerful utility library for Fabric mods by DevPieter, with custom tools and events to make modding easier.

![License](https://img.shields.io/github/license/DevPieter/Utilize?color=blue&label=License&logo=github)
![Java Version](https://img.shields.io/badge/Java-21-blue?logo=java&logoColor=white)

## Download

You can download Utilize on Modrinth: Download Utilize

![Mod loader: Fabric](https://img.shields.io/badge/Modloader-Fabric-1976d2?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiIHhtcD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ZzhhMDgfJ0wUSinxZUQWgKos1JP/AbD4OneIDyQPwCFniA+EJ4CaXm4TxAXCC0BNHgLhAdAnx9hC8PwGSRtAFVMQjF7cNTWED8B1cgwW20yfJgAvrssAsZ1cB3g/xckAxr6FmCDU5N6f488BrpCQ4rQBJkiMYh4ACmLzwOQF0CExinkCsvw7vgGikl+OotaKRwAAAABJRU5ErkJggg==)
![Minecraft](https://img.shields.io/badge/Minecraft-1.21.x-1976d2)
![Environment](https://img.shields.io/badge/Environment-client-1976d2)

## Description

This is **Utilize**, yet another Minecraft modding library, made for DevPieter’s mods. It
contains many custom Utils and Events to make modding easier and updates faster.

## Usage (Developers)

You can use Utilize in your Fabric mod by adding it as a dependency. The latest version is available
on Maven Pietr Space.

### Gradle

“`gradle
repositories {
maven {
name “Pietr Space Releases”
url “https://maven.pietr.space/releases”
}
}

dependencies {
implementation “nl.devpieter:utilize:${version}”
}
“`

### Maven

“`xml


pietr-space-releases
Pietr Space Releases
https://maven.pietr.space/releases



nl.devpieter
utilize
${version}


“`

Useful Tags

this datapack is a **library** that adds _plenty_ of **tags**
**all the tags:**
– metal_nuggets
– metal_ingots
– metal_ingots-raw
– metal_blocks
– metal_blocks-raw
– metal_blocks-smelted

Questions?
What Are Tags?

**Tags** are like _multiple_ **items**
instead of making 3 recipies![Name Tag with iron nugget](https://cdn.modrinth.com/data/cached_images/8f99a325f54ff4362c5ee97ce8f24831d312dd44.png)
![Name Tag with gold nugget](https://cdn.modrinth.com/data/cached_images/ef57966367fed780e07ad598a439fabc51c6c1a5.png)
![Name Tag with copper nugget](https://cdn.modrinth.com/data/cached_images/0a58cbe2c4380646ab86a922fbc20a382db0b6d5.png)

_**Make 1 recipie with one tag**_
![Name Tag with Metal nugget tag](https://cdn.modrinth.com/data/cached_images/63bb2328739050478c98106072cbb41df367a551.gif)

heres the **code** to _make_ a **metal nugget** _tag_

**YourPack**>_data_>_minecraft_>_tags_>_item_>**metal_nuggets.json**

“`
{
“values”: [
“iron_nugget”,
“gold_nugget”,
“copper_nugget”
]
}
“`

Use Server Name

# Use Server Name

Have you ever used a mod that saves data locally when playing on a server,
but you use a server that regularly changes IP?
If yes this mod is for you,
as long as you use the same server name in the multiplayer join screen all your data will still be there.

### For server owners
Add the mod to the server so the users don’t have to fiddle with configuration and can just connect.
You can change to server name in the config file under “./config/useservername.json5“.

### For modpack makers
Add the mod for both sides,
and you don’t need to adjust the config as the servername is randomly generated on the first lauche of the server.

### For modders
Don’t add this mod as a dependency, use the objectShare and use the string you can get from
“(String) objectShare.get(useservername:serverId)“. The string can be “null“.
It is first initialized when the “ClientPlayConnectionEvents.INIT“ event is fired but the string can be overwritten
after the firing of the “ServerPlayConnectionEvents.INIT“ event.

Currently, supported mods:

* Bobby
* Distant Horizons
* Xaero’s Minimap
* Xaero’s Worldmap

Use Item on Block Event

Use Item on Block Event is a mod that adds a cancellable forge event that fires when the player right-clicks a block.

Other mods can listen for this event using the forge event-listening API to specifically act on or cancel item/block interaction behavior, with improved targeting of whether the block’s or the item’s interaction is handled compared to builtin forge events.

This mod can be installed on clients, servers, or both.

Additional documentation for developers can be found in the github readme

Uranus

Uranus is a collection of useful utilities. Contains fast creation of material, easier access to damage type and so on.

Uranus also ported some code from Citadel. Provide animation engine for my other mods.

Upgraded Core

Upgraded Core

Forge Only

Please use the Modrinth download and do not rehost the files.

This mod may be used in any modpacks. (On Modrinth)

No plan for fabric version at this time, sorry.

DESCRIPTION

This mod contains shared code for my other mods.

This mod doesn’t do anything by himself.

Upgraded Nethrite
Adds upgraded versions of Netherite with helpful effects.
Upgraded Netherite : Items
Adds some items like apples and totems to the Upgraded Netherite mod.
Upgraded Netherite : Ultimerite
Adds Ultimerite Tier to the Upgraded Netherite mod.
Upgraded Tools
Add hammers that act as swords, axes, picks, shovels and hoes combined.

QoL

Epic QoL Datapack 1.21.5+ Enhance Your Minecraft Experience with Epic QoL!

Transform your Minecraft world with the Datapack for version 1.21.5+! This datapack is designed to streamline gameplay, improve user experience, and add practical features that make your adventure smoother and more enjoyable. Whether you’re a seasoned player or new to the game, you’ll find these enhancements make a big difference.

Download the Ultimate QoL Datapack file. Place the file in your Minecraft world’s datapacks folder. Load your world or run /reload to activate the datapack. Compatibility:

Designed for Minecraft 1.21.5+, this datapack is compatible with most other mods and datapacks. Ensure you have a backup of your world before installation.

(will also include some of my other datapacks/mods in this datapack/mod)

(email me for questions) “[email protected]

UNU Parts Pack [MTS/IV]

 Derrick on his throne of quality parts

Stylish Discord Banner ButtonStylish Patreon Banner ButtonStylish TEOM Banner Button

 

Official UNU Packs

Unimportant spacerUNU CivilUNU Military IconUNUverse IconRight Cap

Parner Pack Banner

Left CapDKZ IconBjorn IconImmersive Farming IconSyndicate IconRight Cap

UNU Parts requires Minecraft Transport Simulator

UNU Parts provides a variety of quality parts for other MTS Packs to use!

From engines, wheels, and seats to bus adverts, cargo containers, and treads! UNU Parts Pack has all the Quality MTS Parts™️ you’ll ever need! If we don’t have something you need for your MTS Pack, we’ll add it! We take pride in supplying parts for some of the best and biggest MTS Packs out there!

UNU Works best with the official UNU Packs:

UNU Civilian Pack – Chock full of essential high-quality vehicles!
UNU Military Pack – Defend the BlackThorne Empire!
Expanded UNUverse Pack – More unique vehicles that flesh out the robust UNUverse!

Try out these great UNU-Approved Content Packs!

DKZ Industries Automotive Branch – A Great Assortment of Vintage and Classic Vehicles!

Bjorn’s Customs – Bjorn’s customs is an addon to UNU Civil and UNU Parts. It includes aftermarket parts for the contractor and contractor xl.
IV Farming – A bunch of essential farming accesories!

Syndicate Motor Foundry – A content pack for Immersive Vehicles featuring a new brand of vehicles and parts!

Join our Discord!

Support UNU on Patreon!

Join the Official Server!

 

Shameless Bisecthosting Sponsorship

Unruled API

# Unruled API

mod icon

Allows to create new form of gamerules, beyond the restrictive vanilla integers and booleans.

This mod enables developers to easily create new floating, long, double, string, text, enum-driven,
entity selector and even registry-entry gamerules, using their respective builders,
all available from the `com.nerjal.unruled_api.UnruledApi` class’s static methods.

It also provides means to add value validators alongside registering new gamerules, which in turn
allows to restrict the range of valid values for gamerules. For instance, it can be used to only allow
odd values in an integer gamerule.

Additionally, this mod also adds per-dimension gamerule overrides! These are applied in their
strict dimension (provided they are queried correctly).
See [gamerules overrides](#gamerules-overrides) for more details about it.

### Gamerules registration

Example:
“`java
import com.nerjal.unruled_api.UnruledApi;

public class MyClass {
private static final int STRING_RULE_MAX_LENGTH = 24;

public void gamerulesRegistration() {
var myFloatingRule = UnruledApi.floatRuleBuilder(category, 1.5) // takes the category and the initial value as arguments
// the category determines where in the world creation screen will it be placed
.register(“mymod:my_gamerule”); // gamerule registration always takes the gamerule’s ID
// the ID also determines the translated name of the gamerule
var myStringRule = new StringRule.Builder(category, “initial value”, STRING_RULE_MAX_LENGTH)
// using the UnruledApi methods or directly creating the builder has the same result, and arguments are the same.
// however, mind that in some cases, it is strongly recommended to use the specified builders such as for string
// rules, enum, and dynamic registry entry rules, as they have a more specific processing of their values and
// command handling.
.register(“mymod:my_other_gamerule”);
}

}
“`

Additionally, quick creation and registration methods have been added for your convenience

“`java
import com.nerjal.unruled_api.UnruledApi;

public static void quickGamerulesRegistration() {
var myLongRule = UnruledApi.registerLong(Identifier.of(“mymod:my_long_rule”), category, 25L);
// Quick registration methods always follow the same parameter order: name, category, initial value, gamerule-type specific arguments
// Except for enum rules, for which the enum class goes before the initial value
var myEnumRule = UnruledApi.registerEnumRule(Identifier.of(“mymod:my_enum_rule”), category, MyEnum.FIRST, MyEnum.class);
}

enum MyEnum {
FIRST,
SECOND,
THIRD
}
“`

For consistency, methods have also been created to allow quickly register vanilla-type gamerules.

“`java
import com.nerjal.unruled_api.UnruledApi;

public static void registerBasicRules() {
UnruledApi.registerInteger(“my_int_rule”, category, 5);
UnruledApi.registerBoolean(“my_bool_rule”, category, false);
}
“`

~~You can also retrieve their values using the same class’s methods~~
This has become outdated since release 2.0 (for Minecraft 1.21.11 and later).
Please use the gamerule methods directly as now meant by the game code.

“`java
public long getMyLongGamerules(ServerWorld dimension) { // ServerWorld is a Yarn mapping class. Might be Level or ServerLevel with Mojmap
return UnruledApi.getLong(dimension.getGameRules(), myLongGamerule);
}

public Block getMyBlockRule(ServerWorld dimension) {
// querying a registry entry rule returns the registry entry’s very value, as it can only be set if it exists in the registry
return UnruledApi.getRegistryEntry(dimension.getGameRules(), myBlockRegistryEntryRule);
}
“`

### Command Tweaks

The average experience of using gamerules in vanilla minecraft is pretty poor.
Navigating a long list of names, trying to remember the one of the rule you need,
or even worse, searching for a hypothetic one, can be pretty annoying.

Thus, Unruled API aims to alleviate that burden ever so slightly, by allowing you
to navigate the same list *by category*!

Hence, you can now add the category name or full ID (both in full caps) in the command and the following
list will only contain rules in the appropriate category.

E.g. `/gamerule CHAT ` will then have your game suggest you only the rules inside the
*chat* category, according to the world creation menu listing.

This also applies to all modded gamerules and categories, as well as modded gamerule types
from any and all mod.

“`
/gamerule [] []
“`

### Gamerules Overrides

Gamerules overrides are set per dimension. They allow players to set specific rules to specific values
in the wanted dimension, all via the `gamerule-override` command.

This command has many uses:

* `gamerule-override` alone and with no arguments allows you to get a list of existing overrides in the current dimension.
* `gamerule-override ` allows you to get a list of existing overrides in the specified dimension.
* `gamerule-override get ` allows you to query a potential override for the specified gamerule in the current dimension.
* `gamerule-override set ` allows you to set an override for the specified gamerule to the given value in the current dimension.
* `gamerule-override unset ` allows you to remove a set override for the specified gamerule in the current dimension.
* `gamerule-override in get ` allows you to query a potential override for the specific gamerule in the given dimension.
* `gamerule-override in set ` allows you to set an override for the specified gamerule to the given value in the provided dimension.
* `gamerule-override in unset ` allows you to remove a set override for the specified gamerule in the provided dimension.

Gamerule overrides are stored in the dimension’s data folder, as the `gamerules.dat` file.
Removing it while the server is offline/world is not being played will simply remove all overrides for the dimension.

Additionally, for your convenience, the `get`, `set` and `unset` in all cases also
support the per-category filtering, for easier usage.
You can thus use the command as follows:
“`
/gamerule-override in set []
“`

### Configurable Default Values

Especially relevant for modpack creators, this feature allows to set custom values to be used as default gamerule
values upon world creation.

In order to set them, you only need to create a `config/default_gamerules.json` file, and for each gamerule you want
to add a default value for, set a key-value pair with the wanted new value, set as a string. (due to limitations in
the mojang code for easy JSON-parsing, only string values are accepted, anything else will simply be ignored)

Example:
“`json
{
“doDaylightCycle”: “false”,
“mobGriefing”: “false”
}
“`

Obviously, this works just as well with modded gamerules and gamerule types!

### Custom Gamerule Categories

**As of 1.21.11, gamerule categories are now a registry. The following is only relevant to game versions prior to this**

Developers can easily register new custom gamerule categories, that will be added straight to the category enum!
However, you do need it to be done *early* in the game load process, i.e. before the gamerules class gets loaded.

This can be done on Fabric with a `preLaunch` entrypoint, on (Neo)Forge upon initializing your `@Mod` class,
or on any launcher from your mixin config plugin.

You only need to add a `CategoryProvider` implementation to the `UnruledEarlyUtils.CATEGORY_PROVIDERS` set.

The `CategoryProvider` interface is a String supplier-like class, that allows for an optional implementation of a
category consumer upon creation of the matching category. The provided String will be set as the category name, but
will not allow for duplicate entries (i.e. if two mods want to add a same category, only one will be created, but both
providers will receive it as well)

## How to use in your project

You can implement this mod in your project using the Modrinth maven. Don’t hesitate to read the official documentation.

### Add the Modrinth maven repository

“`groovy
repositories {
maven {
name = “Modrinth”
url = “https://api.modrinth.com/maven”
}
}
“`

### Import the mod

loom example:
“`groovy
dependencies {
// using modApi allows your project’s dependents to also import dependencies by default
modApi “maven.modrinth:unruled-api:${project.unruled_version}”
}
“`

(neo)forgeGradle example:
“`groovy
dependencies {
implementation “maven.modrinth:unruled-api:${project.unruled_version}”
}
“`

For copyright reasons, we require you to **not** include (JiJ, jar-in-a-jar, shadow, etc) this mod inside of your own. Thank you for your comprehension.

Unnamed Framework

![ Display the mod’s title ](https://cdn.modrinth.com/data/YNXsr9uf/images/646d76f34f96049ca5ab27c1e9d8ffdbdcecc3b2.png)

# 🛠️ About

PUT ON HOLD INDEFINITELY!

**Unnamed Framework** is a datapack framework for my other datapacks that implements features focusing on performance increases, removal of redundancies, easier compatibility between my modules and improved debugging capabilities.

Some universal features of this framework appear in many of my datapacks and are explained below in the Wiki section of this site! However, in-depth documentation for this framework is not provided, since this project is only used by me for my datapacks.

A big thank you to the team behind Animated Java. Without their work, this framework and all of my other datapacks could not function!

ONLY DOWNLOAD THIS AS A DEPENDENCY FOR OTHER MODS! ON ITS OWN THIS MOD DOES NOTHING!

# 🌐 Wiki

… WIP …

# 📬 Remarks

If you encounter any bugs or want to suggest a new feature or addition, then feel free to open an issue!

Please keep in mind that at any given time vast amounts of the mod may be edited or completely overhauled! These changes should not, but may leave existing worlds on older versions corrupted. Creating backups before updating to a new version is advised!

I want to reiterate that this is simply a passion project. It may occur that for longer periods no updates or bug fixes are being developed/released simply because I do not want to.