From 5c5b307664583bd31d3197092ec9a39a019567d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Mon, 23 Dec 2024 08:48:41 +0100 Subject: [PATCH] Update --- build.gradle | 1 + gradle.properties | 8 ++++---- src/main/java/systems/brn/televator/Televator.java | 5 ++++- .../systems/brn/televator/items/TelevatorBlockItem.java | 6 +++++- src/main/resources/assets/televator/items/televator.json | 6 ++++++ 5 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/assets/televator/items/televator.json diff --git a/build.gradle b/build.gradle index 3b6e88a..a2d38fe 100644 --- a/build.gradle +++ b/build.gradle @@ -30,6 +30,7 @@ dependencies { include(modImplementation("eu.pb4:polymer-core:${project.polymer_version}")) modImplementation include("eu.pb4:polymer-resource-pack:${project.polymer_version}") + modImplementation include("eu.pb4:polymer-resource-pack-extras:${project.polymer_version}") modImplementation include("eu.pb4:polymer-autohost:${project.polymer_version}") modImplementation include("eu.pb4:polymer-blocks:${project.polymer_version}") include(modImplementation("xyz.nucleoid:server-translations-api:${project.server_translations_api_version}")) diff --git a/gradle.properties b/gradle.properties index aec617d..c3ddd4f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,13 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.21.4 -yarn_mappings=1.21.4+build.1 +yarn_mappings=1.21.4+build.2 loader_version=0.16.9 # Mod Properties -mod_version=1.2.2 +mod_version=1.2.3 maven_group=systems.brn.televator archives_base_name=televator # Dependencies -fabric_version=0.110.5+1.21.4 -polymer_version=0.11.0+1.21.4-rc1 +fabric_version=0.111.0+1.21.4 +polymer_version=0.11.1+1.21.4 server_translations_api_version=2.4.0+1.21.2-rc1 \ No newline at end of file diff --git a/src/main/java/systems/brn/televator/Televator.java b/src/main/java/systems/brn/televator/Televator.java index 4022801..e5436dc 100644 --- a/src/main/java/systems/brn/televator/Televator.java +++ b/src/main/java/systems/brn/televator/Televator.java @@ -1,7 +1,10 @@ package systems.brn.televator; import com.mojang.authlib.GameProfile; +import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras; +import eu.pb4.polymer.resourcepack.impl.client.rendering.PolymerResourcePack; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Identifier; import systems.brn.televator.blocks.TelevatorBlock; import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils; import net.fabricmc.api.ModInitializer; @@ -18,8 +21,8 @@ public class Televator implements ModInitializer { @Override public void onInitialize() { - PolymerResourcePackUtils.addModAssets(MODID); + ResourcePackExtras.forDefault().addBridgedModelsFolder(Identifier.of(MODID, "item")); PolymerResourcePackUtils.markAsRequired(); TelevatorBlock.register(); diff --git a/src/main/java/systems/brn/televator/items/TelevatorBlockItem.java b/src/main/java/systems/brn/televator/items/TelevatorBlockItem.java index 47ad037..2f4d8bc 100644 --- a/src/main/java/systems/brn/televator/items/TelevatorBlockItem.java +++ b/src/main/java/systems/brn/televator/items/TelevatorBlockItem.java @@ -1,5 +1,9 @@ package systems.brn.televator.items; +import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras; +import eu.pb4.polymer.resourcepack.extras.api.format.item.model.BasicItemModel; +import eu.pb4.polymer.resourcepack.impl.client.rendering.PolymerResourcePack; +import net.minecraft.resource.ResourcePack; import systems.brn.televator.Televator; import eu.pb4.polymer.core.api.item.PolymerItem; import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils; @@ -16,7 +20,7 @@ public class TelevatorBlockItem extends BlockItem implements PolymerItem { public TelevatorBlockItem(Settings settings, Block block, String modelId) { super(block, settings); - this.polymerModel = Identifier.of(Televator.MODID, "item/" + modelId); + this.polymerModel = Identifier.of(Televator.MODID, modelId); } @Override diff --git a/src/main/resources/assets/televator/items/televator.json b/src/main/resources/assets/televator/items/televator.json new file mode 100644 index 0000000..cbbde4a --- /dev/null +++ b/src/main/resources/assets/televator/items/televator.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "televator:item/televator" + } +} \ No newline at end of file