Skip to content

Commit

Permalink
feat: 2.6.0
Browse files Browse the repository at this point in the history
closes #59
  • Loading branch information
Jamalam360 committed Dec 17, 2024
1 parent fa80972 commit 0f325fb
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 57 deletions.
10 changes: 1 addition & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
- (feat) compat with LambDynamicLights
- When LambDynamicLights is installed, you will be able to put light sources into your Utility Belt and they will illuminate the world around you.
- If you have suggestions for other dynamic lights mods to add compat for, please open an issue on GitHub.
- Closes #56
- (fix) issue when unequipping belt while you are using it
- (fix) general stability improvements
- (fix) the belt will now pop out all of its items when it is broken
- This means that Netherite tools will not be lost if the belt burns in lava
- (feat) add X/Y offset config options for the belt hotbar for more granular control over its position
- (fix) game will no longer crash when `player.accessoriesCapability()` returns null (#59)
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public static void setInventory(ItemStack stack, UtilityBeltInventory inv) {

@Nullable
public static ItemStack getBelt(Player player) {
if (player.accessoriesCapability() == null) {
return null;
}

@Nullable SlotEntryReference slot = player.accessoriesCapability().getFirstEquipped(UtilityBelt.UTILITY_BELT_ITEM.get());

if (slot != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.github.jamalam360.utility_belt.UtilityBeltInventory;
import io.github.jamalam360.utility_belt.state.StateManager;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
Expand All @@ -12,7 +11,7 @@

import java.util.function.Function;

// LambDynamicLights and RyoamicLights
// LambDynamicLights and RyoamicLights (planned but not yet implemented)
public class LambDynamicLightsLikeCompat {
public static void init(LambDynamicLightsLike lights) {
lights.registerDynamicLightHandler(EntityType.PLAYER, (player) -> getLuminanceInBelt(player, lights));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dev.architectury.utils.Env;
import dev.architectury.utils.EnvExecutor;
import io.github.jamalam360.utility_belt.Duck;
import io.github.jamalam360.utility_belt.network.UtilityBeltPackets.S2CSetHotbarSlot;
import io.github.jamalam360.utility_belt.state.StateManager;
import io.github.jamalam360.utility_belt.UtilityBelt;
import io.github.jamalam360.utility_belt.UtilityBeltInventory;
Expand All @@ -27,7 +28,7 @@ public static void init() {

private static void registerServerPayloadTypes() {
NetworkManager.registerS2CPayloadType(UtilityBeltPackets.S2C_SET_BELT_SLOT, UtilityBeltPackets.S2CSetBeltSlot.STREAM_CODEC);
NetworkManager.registerS2CPayloadType(UtilityBeltPackets.S2C_SET_HOTBAR_SLOT, UtilityBeltPackets.S2CSetHotbarSlot.STREAM_CODEC);
NetworkManager.registerS2CPayloadType(UtilityBeltPackets.S2C_SET_HOTBAR_SLOT, S2CSetHotbarSlot.STREAM_CODEC);
NetworkManager.registerS2CPayloadType(UtilityBeltPackets.S2C_UPDATE_BELT_INVENTORY, UtilityBeltPackets.S2CUpdateBeltInventory.STREAM_CODEC);
NetworkManager.registerS2CPayloadType(UtilityBeltPackets.S2C_BELT_UNEQUIPPED, UtilityBeltPackets.S2CBeltUnequipped.STREAM_CODEC);
}
Expand Down Expand Up @@ -102,7 +103,7 @@ private static void handleUpdateState(C2SUpdateState payload, NetworkManager.Pac
NetworkManager.sendToPlayer((ServerPlayer) player, new S2CSetBeltSlot(beltSlot));
} else if (hotbarSlot != player.getInventory().selected) {
player.getInventory().selected = hotbarSlot;
NetworkManager.sendToPlayer((ServerPlayer) player, new S2CSetBeltSlot(hotbarSlot));
NetworkManager.sendToPlayer((ServerPlayer) player, new S2CSetHotbarSlot(hotbarSlot));
}
}
}
Expand Down
27 changes: 13 additions & 14 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
modImplementation libs.architectury.fabric
modImplementation libs.jamlib.fabric
modImplementation libs.accessories.fabric
modImplementation libs.owo.lib.fabric // Dependency of Accessories
modRuntimeOnly libs.owo.lib.fabric // Dependency of Accessories
modRuntimeOnly libs.modmenu

// Compat
Expand All @@ -50,7 +50,7 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K
displayName = "V${project.version} (Fabric ${project.minecraft_version})"
changelog = rootProject.file("CHANGELOG.md").text
releaseType = project.version.contains("beta") ? "beta" : "release"
gameVersions = [project.minecraft_version, *project.additional_minecraft_versions.split(",")]
gameVersions = [project.minecraft_version, *(project.additional_minecraft_versions == "" ? [] : project.additional_minecraft_versions.split(","))]
gameLoaders = ["fabric", "quilt"]

mainPublication tasks.remapJar
Expand Down Expand Up @@ -91,21 +91,20 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K
}

processResources {
def substitutions = [
"version" : project.version,
"minecraft_version" : project.minimum_minecraft_version,
"fabric_api_version" : project.minimum_fabric_api_version,
"architectury_version": project.minimum_architectury_api_version,
"jamlib_version" : project.minimum_jamlib_version,
"accessories_version" : project.minimum_accessories_version
]

filesMatching("fabric.mod.json") {
expand "version": project.version,
"minecraft_version": project.minecraft_version,
"fabric_api_version": libs.versions.fabric.api.get(),
"architectury_version": libs.versions.architectury.get(),
"jamlib_version": libs.versions.jamlib.get(),
"accessories_version": libs.versions.accessories.get()
expand substitutions
}

inputs.property "version", project.version
inputs.property "minecraft_version", project.minecraft_version
inputs.property "fabric_api_version", libs.versions.fabric.api.get()
inputs.property "architectury_version", libs.versions.architectury.get()
inputs.property "jamlib_version", libs.versions.jamlib.get()
inputs.property "accessories_version", libs.versions.accessories.get()
substitutions.each { inputs.property it.key, it.value }
}

shadowJar {
Expand Down
1 change: 0 additions & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"utility_belt.client.mixins.json"
],
"depends": {
"fabricloader": ">=0.15.0",
"fabric": ">=${fabric_api_version}",
"minecraft": ">=${minecraft_version}",
"architectury": ">=${architectury_version}",
Expand Down
9 changes: 8 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.parallel=true

version=2.5.0+1.21.1
version=2.6.0+1.21.1
minecraft_version=1.21.1

additional_minecraft_versions=1.21
minimum_minecraft_version=1.21
minimum_architectury_api_version=13.0.6
minimum_fabric_api_version=0.102.0+1.21
minimum_jamlib_version=1.2.2-build.2+1.21.1
minimum_accessories_version=1.1.0-beta.6+1.21.1

branch=main
group=io.github.jamalam360
mod_name=Utility Belt
Expand Down
15 changes: 5 additions & 10 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
architectury = "13.0.8"

# https://projects.neoforged.net/neoforged/neoforge
neoforge = "21.1.72"
neoforge = "21.1.90"

# https://fabricmc.net/develop
fabric-loader = "0.15.11"
fabric-api = "0.106.0+1.21.1"

# https://maven.jamalam.tech/#/releases
jamlib = "1.2.1+1.21"
jamlib = "1.2.2-build.2+1.21.1"

# https://modrinth.com/mod/accessories/versions
accessories = "1.1.0-beta.11+1.21.1"
accessories = "1.1.0-beta.16+1.21.1"

# https://modrinth.com/mod/owo-lib/versions
owo-lib-fabric = "0.12.15+1.21"
owo-lib-neoforge = "0.12.15-beta.7+1.21"

endec = "0.1.9"

# https://github.com/LlamaLad7/MixinExtras/releases
mixin-extras = "0.4.1"
Expand All @@ -28,9 +29,6 @@ modmenu = "11.0.1"
# https://modrinth.com/mod/lambdynamiclights/versions
lambdynamiclights = "3.1.0+1.21.1"

# https://modrinth.com/mod/ryoamiclights
ryoamic-lights = "0.2.11+mc1.21.1-neoforge"

# https://modrinth.com/mod/sodium/versions
sodium = "mc1.21-0.6.0-beta.2-fabric"

Expand All @@ -53,14 +51,11 @@ accessories-fabric = { module = "io.wispforest:accessories-fabric", version.ref
accessories-neoforge = { module = "io.wispforest:accessories-neoforge", version.ref = "accessories" }

owo-lib-fabric = { module = "io.wispforest:owo-lib", version.ref = "owo-lib-fabric" }
owo-lib-neoforge = { module = "io.wispforest:owo-lib-neoforge", version.ref = "owo-lib-neoforge" }

mixin-extras-common = { module = "io.github.llamalad7:mixinextras-common", version.ref = "mixin-extras" }

modmenu = { module = "maven.modrinth:modmenu", version.ref = "modmenu" }

lambdynamiclights = { module = "dev.lambdaurora.lambdynamiclights:lambdynamiclights-runtime", version.ref = "lambdynamiclights" }

ryoamic-lights = { module = "maven.modrinth:ryoamiclights", version.ref = "ryoamic-lights" }

sodium = { module = "maven.modrinth:sodium", version.ref = "sodium" }
33 changes: 17 additions & 16 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ dependencies {
modImplementation libs.architectury.neoforge
modImplementation libs.jamlib.neoforge
modImplementation libs.accessories.neoforge
modImplementation libs.owo.lib.neoforge // Dependency of Accessories

// Compat
modImplementation libs.ryoamic.lights


forgeRuntimeLibrary "blue.endless:jankson:1.2.3" // Dependency of JamLib
forgeRuntimeLibrary "io.wispforest:endec:0.1.5" // Dependency of Accessories
forgeRuntimeLibrary "io.wispforest:endec:0.1.8" // Dependency of Accessories
forgeRuntimeLibrary "io.wispforest.endec:gson:0.1.5" // Dependency of Accessories
forgeRuntimeLibrary "io.wispforest.endec:netty:0.1.4" // Dependency of Accessories

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }
Expand All @@ -50,7 +48,7 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K
displayName = "V${project.version} (NeoForge ${project.minecraft_version})"
changelog = rootProject.file("CHANGELOG.md").text
releaseType = project.version.contains("beta") ? "beta" : "release"
gameVersions = [project.minecraft_version, *project.additional_minecraft_versions.split(",")]
gameVersions = [project.minecraft_version, *(project.additional_minecraft_versions == "" ? [] : project.additional_minecraft_versions.split(","))]
gameLoaders = ["neoforge"]

mainPublication tasks.remapJar
Expand Down Expand Up @@ -86,17 +84,20 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K
}

processResources {
filesMatching("neoforge.mods.toml") {
expand "minecraft_version": project.minecraft_version,
"architectury_version": libs.versions.architectury.get(),
"jamlib_version": libs.versions.jamlib.get(),
"accessories_version": libs.versions.accessories.get()
def substitutions = [
"version" : project.version,
"minecraft_version" : project.minimum_minecraft_version,
"neoforge_version" : project.minimum_minecraft_version.substring(2),
"architectury_version": project.minimum_architectury_api_version,
"jamlib_version" : project.minimum_jamlib_version,
"accessories_version" : project.minimum_accessories_version
]

filesMatching("META-INF/neoforge.mods.toml") {
expand substitutions
}

inputs.property "minecraft_version", project.minecraft_version
inputs.property "architectury_version", libs.versions.architectury.get()
inputs.property "jamlib_version", libs.versions.jamlib.get()
inputs.property "accessories_version", libs.versions.accessories.get()
substitutions.each { inputs.property it.key, it.value }
}

shadowJar {
Expand Down
4 changes: 2 additions & 2 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ issueTrackerURL="https://github.com/JamCoreModding/utility-belt/issues"

[[mods]]
modId = "utility_belt"
version = "${file.jarVersion}"
version = "${version}"
displayName = "Utility Belt"
displayURL="https://github.com/JamCoreModding/utility-belt"
logoFile = "icon.png"
Expand All @@ -17,7 +17,7 @@ Free your hotbar
[[dependencies.utility_belt]]
modId = "neoforge"
type = "required"
versionRange = "[20.4,)"
versionRange = "[${neoforge_version},)"
ordering = "NONE"
side = "BOTH"

Expand Down

0 comments on commit 0f325fb

Please sign in to comment.