From 0ae30aa2c8aa0dc0d7addddf59c459ec536fb47f Mon Sep 17 00:00:00 2001 From: GearShocky Date: Wed, 7 Sep 2022 01:48:31 +0600 Subject: [PATCH 1/3] ZPM model --- .../models/item/zpm_battery.json | 325 +++++++++++++++++- .../textures/item/zpm_battery.png | Bin 0 -> 446 bytes 2 files changed, 320 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/zpm_battery.png diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/zpm_battery.json b/src/main/resources/assets/overdrive_that_matters/models/item/zpm_battery.json index b793c9e87..6fa136c36 100644 --- a/src/main/resources/assets/overdrive_that_matters/models/item/zpm_battery.json +++ b/src/main/resources/assets/overdrive_that_matters/models/item/zpm_battery.json @@ -1,6 +1,321 @@ { - "parent": "item/generated", - "textures": { - "layer0": "overdrive_that_matters:block/ph_kitty" - } -} + "textures": { + "0": "overdrive_that_matters:item/zpm_battery" + }, + "elements": [ + { + "name": "body", + "from": [4, 1, 4], + "to": [12, 4, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0.5, 8]}, + "faces": { + "north": {"uv": [0, 0, 4, 1.5], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 1.5], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 1.5], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 1.5], "texture": "#0"}, + "up": {"uv": [0, 1.5, 4, 5.5], "texture": "#0"}, + "down": {"uv": [0, 1.5, 4, 5.5], "texture": "#0"} + } + }, + { + "name": "body", + "from": [4.5, 4, 4.5], + "to": [11.5, 5, 11.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0.5, 8]}, + "faces": { + "north": {"uv": [0, 8.5, 3, 9], "texture": "#0"}, + "east": {"uv": [0, 8.5, 3, 9], "texture": "#0"}, + "south": {"uv": [0, 8.5, 3, 9], "texture": "#0"}, + "west": {"uv": [0, 8.5, 3, 9], "texture": "#0"}, + "up": {"uv": [0, 5.5, 3, 8.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 3, 3], "rotation": 270, "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [8, 6, 5], + "to": [11, 21, 8], + "rotation": {"angle": -45, "axis": "y", "origin": [9.5, 13, 6.5]}, + "faces": { + "north": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "east": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "south": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "west": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "up": {"uv": [0, 9, 1.5, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [9.7, 6, 8.5], + "to": [10.7, 17, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [10.2, 12.5, 9]}, + "faces": { + "north": {"uv": [3.5, 10, 5, 16], "texture": "#0"}, + "east": {"uv": [3.5, 10, 5, 16], "texture": "#0"}, + "south": {"uv": [3.5, 10, 5, 16], "texture": "#0"}, + "west": {"uv": [3.5, 10, 5, 16], "texture": "#0"}, + "up": {"uv": [3.5, 9, 5, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [7, 5, 10], + "to": [8, 20, 11], + "rotation": {"angle": 22.5, "axis": "y", "origin": [7.5, 14, 10.5]}, + "faces": { + "north": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "east": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "south": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "west": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "up": {"uv": [5.5, 9, 7, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [5, 8, 8], + "to": [6, 21, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 2, 0]}, + "faces": { + "north": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "east": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "south": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "west": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "up": {"uv": [0, 9, 1.5, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [7.1, 7, 5.9], + "to": [9.1, 23, 7.9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 2, 0]}, + "faces": { + "north": {"uv": [6, 10, 7.5, 16], "texture": "#0"}, + "east": {"uv": [6, 10, 7.5, 16], "texture": "#0"}, + "south": {"uv": [6, 10, 7.5, 16], "texture": "#0"}, + "west": {"uv": [6, 10, 7.5, 16], "texture": "#0"}, + "up": {"uv": [6, 9, 7.5, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [7, 7, 5], + "to": [8, 16, 6], + "rotation": {"angle": -22.5, "axis": "y", "origin": [7.5, 11, 5.5]}, + "faces": { + "north": {"uv": [2.5, 10, 4, 16], "texture": "#0"}, + "east": {"uv": [2.5, 10, 4, 16], "texture": "#0"}, + "south": {"uv": [2.5, 10, 4, 16], "texture": "#0"}, + "west": {"uv": [2.5, 10, 4, 16], "texture": "#0"}, + "up": {"uv": [2.5, 9, 4, 10.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "rotation": 270, "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [6, 7, 7], + "to": [9, 22, 10], + "rotation": {"angle": -22.5, "axis": "y", "origin": [7.5, 14.5, 8.5]}, + "faces": { + "north": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "east": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "south": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "west": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "up": {"uv": [0, 9, 1.5, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [5.3, 4, 6], + "to": [7.3, 19, 8], + "rotation": {"angle": 22.5, "axis": "y", "origin": [6.3, 12, 7]}, + "faces": { + "north": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "east": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "south": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "west": {"uv": [5.5, 10, 7, 16], "texture": "#0"}, + "up": {"uv": [5.5, 9, 7, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [4.3, 5, 9], + "to": [6.3, 18, 11], + "rotation": {"angle": 22.5, "axis": "y", "origin": [5.3, 12.5, 10]}, + "faces": { + "north": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "east": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "south": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "west": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "up": {"uv": [0, 9, 1.5, 10.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "rotation": 90, "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [8.3, 6, 9], + "to": [10.3, 19, 11], + "rotation": {"angle": 22.5, "axis": "y", "origin": [9.3, 11, 10]}, + "faces": { + "north": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "east": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "south": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "west": {"uv": [0, 10, 1.5, 16], "texture": "#0"}, + "up": {"uv": [0, 9, 1.5, 10.5], "texture": "#0"}, + "down": {"uv": [0, 0, 1.5, 1.5], "texture": "#missing"} + } + }, + { + "name": "handle", + "from": [4, 6, 3], + "to": [4, 7, 13], + "faces": { + "north": {"uv": [0, 0, 0, 0.5], "texture": "#missing"}, + "east": {"uv": [4, 4, 9, 4.5], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 0.5], "texture": "#missing"}, + "west": {"uv": [4, 4, 9, 4.5], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 5], "texture": "#missing"}, + "down": {"uv": [0, 0, 0, 5], "texture": "#missing"} + } + }, + { + "name": "handle", + "from": [12, 6, 3], + "to": [12, 7, 13], + "faces": { + "north": {"uv": [0, 0, 0, 0.5], "texture": "#missing"}, + "east": {"uv": [4, 4, 9, 4.5], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 0.5], "texture": "#missing"}, + "west": {"uv": [4, 4, 9, 4.5], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 5], "texture": "#missing"}, + "down": {"uv": [0, 0, 0, 5], "texture": "#missing"} + } + }, + { + "name": "handle", + "from": [3, 2, 4], + "to": [7, 7, 4], + "faces": { + "north": {"uv": [7, 4.5, 9, 7], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "south": {"uv": [9, 4.5, 7, 7], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "up": {"uv": [0, 0, 2, 0], "texture": "#missing"}, + "down": {"uv": [0, 0, 2, 0], "texture": "#missing"} + } + }, + { + "name": "handle", + "from": [3, 2, 12], + "to": [7, 7, 12], + "faces": { + "north": {"uv": [7, 4.5, 9, 7], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "south": {"uv": [9, 4.5, 7, 7], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "up": {"uv": [0, 0, 2, 0], "texture": "#missing"}, + "down": {"uv": [0, 0, 2, 0], "texture": "#missing"} + } + }, + { + "name": "handle", + "from": [9, 2, 4], + "to": [13, 7, 4], + "faces": { + "north": {"uv": [9, 4.5, 7, 7], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "south": {"uv": [7, 4.5, 9, 7], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "up": {"uv": [0, 0, 2, 0], "texture": "#missing"}, + "down": {"uv": [0, 0, 2, 0], "texture": "#missing"} + } + }, + { + "name": "handle", + "from": [9, 2, 12], + "to": [13, 7, 12], + "faces": { + "north": {"uv": [9, 4.5, 7, 7], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "south": {"uv": [7, 4.5, 9, 7], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2.5], "texture": "#missing"}, + "up": {"uv": [0, 0, 2, 0], "texture": "#missing"}, + "down": {"uv": [0, 0, 2, 0], "texture": "#missing"} + } + }, + { + "name": "crystal", + "from": [5.5, 5, 5.5], + "to": [10.5, 8, 10.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 6, 8]}, + "faces": { + "north": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "east": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "south": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "west": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "up": {"uv": [12, 11, 16, 15], "texture": "#0"}, + "down": {"uv": [12, 11, 16, 15], "texture": "#0"} + } + }, + { + "name": "crystal", + "from": [5.5, 5, 5.5], + "to": [10.5, 10, 10.5], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 6, 8]}, + "faces": { + "north": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "east": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "south": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "west": {"uv": [12, 15, 16, 16], "texture": "#0"}, + "up": {"uv": [12, 11, 16, 15], "rotation": 270, "texture": "#0"}, + "down": {"uv": [12, 11, 16, 15], "rotation": 90, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [0, 45, 0], + "translation": [0, 3, 1], + "scale": [0.55, 0.55, 0.55] + }, + "thirdperson_lefthand": { + "rotation": [0, 45, 0], + "translation": [0, 3, 1], + "scale": [0.55, 0.55, 0.55] + }, + "firstperson_righthand": { + "rotation": [0, -90, 0], + "translation": [1.13, 3.2, 1.13], + "scale": [0.68, 0.68, 0.68] + }, + "firstperson_lefthand": { + "rotation": [0, -90, 0], + "translation": [1.13, 3.2, 1.13], + "scale": [0.68, 0.68, 0.68] + }, + "ground": { + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [30, 225, 0], + "translation": [0, -1.5, 0], + "scale": [0.725, 0.725, 0.725] + }, + "head": { + "translation": [0, 12.25, 0], + "scale": [1.5, 1.5, 1.5] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -12.5], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/zpm_battery.png b/src/main/resources/assets/overdrive_that_matters/textures/item/zpm_battery.png new file mode 100644 index 0000000000000000000000000000000000000000..619e2afa1a5d405634aabe3b27858f7a9ef91f30 GIT binary patch literal 446 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!hG0(@$B+p3d@LwH65L)8kwpl;pmwhir$b0teVRS{WSKWo~YqxN+aUfB% Date: Wed, 7 Sep 2022 00:09:00 +0300 Subject: [PATCH 2/3] fixed funni transforms/perspectives names (#23) --- .../overdrive_that_matters/models/item/plasma_rifle.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/plasma_rifle.json b/src/main/resources/assets/overdrive_that_matters/models/item/plasma_rifle.json index fb047a541..bd0def089 100644 --- a/src/main/resources/assets/overdrive_that_matters/models/item/plasma_rifle.json +++ b/src/main/resources/assets/overdrive_that_matters/models/item/plasma_rifle.json @@ -8,16 +8,16 @@ } }, "perspectives": { - "third_person_right_hand": { + "thirdperson_righthand": { "parent": "overdrive_that_matters:item/plasma_rifle_3d" }, - "third_person_left_hand": { + "thirdperson_lefthand": { "parent": "overdrive_that_matters:item/plasma_rifle_3d" }, - "first_person_right_hand": { + "firstperson_righthand": { "parent": "overdrive_that_matters:item/plasma_rifle_3d" }, - "first_person_left_hand": { + "firstperson_lefthand": { "parent": "overdrive_that_matters:item/plasma_rifle_3d" }, "fixed": { From ec08a60340bea8ff99a57bedc360b615a78c275b Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Wed, 7 Sep 2022 03:28:49 +0300 Subject: [PATCH 3/3] =?UTF-8?q?Achieved=20with=20FORGE=E2=84=A2=EF=B8=8F?= =?UTF-8?q?=20(#23=20final)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dbotthepony/mc/otm/item/weapon/AbstractWeaponItem.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/AbstractWeaponItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/AbstractWeaponItem.kt index d380a0c8a..6cd7f479d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/AbstractWeaponItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/AbstractWeaponItem.kt @@ -4,6 +4,7 @@ import com.mojang.blaze3d.systems.RenderSystem import com.mojang.math.Vector3f import net.minecraft.client.Minecraft import net.minecraft.client.model.HumanoidModel +import net.minecraft.client.renderer.block.model.ItemTransforms import net.minecraft.nbt.CompoundTag import net.minecraft.network.FriendlyByteBuf import net.minecraft.server.level.ServerPlayer @@ -368,7 +369,7 @@ abstract class AbstractWeaponItem(val tables: KClass, ra val player = Minecraft.getInstance().player!! val pose = event.poseStack - val itemInHandRenderer = Minecraft.getInstance().itemRenderer + val itemInHandRenderer = Minecraft.getInstance().entityRenderDispatcher.itemInHandRenderer pose.pushPose() @@ -419,15 +420,15 @@ abstract class AbstractWeaponItem(val tables: KClass, ra pose.mulPose(Vector3f.YP.rotation(yaw.toFloat())) pose.mulPose(Vector3f.XP.rotation(pitch.toFloat())) - /*itemInHandRenderer.render( - // player, + itemInHandRenderer.renderItem( + player, stack, ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND, false, pose, event.multiBufferSource, event.packedLight - )*/ + ) if (item is PlasmaWeaponItem<*>) { // RenderSystem.setShader(GameRenderer::getPositionColorShader)