├── .gitattributes ├── pack.png ├── assets └── minecraft │ ├── textures │ └── item │ │ ├── cleaver.png │ │ ├── fire_rod.png │ │ └── fire_rod_handheld.png │ ├── models │ └── item │ │ ├── netherite_sword.json │ │ └── golden_sword.json │ └── shaders │ └── core │ ├── rendertype_entity_translucent_cull.vsh │ └── rendertype_entity_translucent_cull.fsh ├── pack.mcmeta ├── README.md └── LICENSE /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShockMicro/CorePerspectiveModels/HEAD/pack.png -------------------------------------------------------------------------------- /assets/minecraft/textures/item/cleaver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShockMicro/CorePerspectiveModels/HEAD/assets/minecraft/textures/item/cleaver.png -------------------------------------------------------------------------------- /assets/minecraft/textures/item/fire_rod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShockMicro/CorePerspectiveModels/HEAD/assets/minecraft/textures/item/fire_rod.png -------------------------------------------------------------------------------- /pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "pack_format": 32, 4 | "description": "Adds a way to have different items in the hand and the GUI." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /assets/minecraft/textures/item/fire_rod_handheld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShockMicro/CorePerspectiveModels/HEAD/assets/minecraft/textures/item/fire_rod_handheld.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CorePerspectiveModels 2 | Adds a way to have different items in the hand and the GUI. Set pixels to alpha 253 for the texture in the inventory and 254 for the texture in the hand. 3 | Use an item model to get everything in the correct position, and congrats! If you don't know how to change the alpha value, just play around with your favorite image editor. 4 | Uses Farcr's awesome Cleaver texture(s) as an example! Used with permission, of course. Fire Rod model was custom by me. 5 | -------------------------------------------------------------------------------- /assets/minecraft/models/item/netherite_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "minecraft:item/cleaver" 5 | }, 6 | "display": { 7 | "thirdperson_righthand": { 8 | "rotation": [ 0, -90, 55 ], 9 | "translation": [ 0, 12.0, -1 ], 10 | "scale": [ 2, 2, 0.85 ] 11 | }, 12 | "firstperson_righthand": { 13 | "rotation": [ 0, -90, 25 ], 14 | "translation": [ 1.13, 4.2, 0.13 ], 15 | "scale": [ 1.5, 1.5, 0.68 ] 16 | }, 17 | "thirdperson_lefthand": { 18 | "rotation": [ 0, 90, -55 ], 19 | "translation": [ 0, 12.0, -1 ], 20 | "scale": [ 2, 2, 0.85 ] 21 | }, 22 | "firstperson_lefthand": { 23 | "rotation": [ 0, 90, -25 ], 24 | "translation": [ 1.13, 4.2, 0.13 ], 25 | "scale": [ 1.5, 1.5, 0.68 ] 26 | }, 27 | "gui": { 28 | "rotation": [ 0, 0, 0 ], 29 | "translation": [ -8, 8, 0 ], 30 | "scale": [ 2, 2, 2 ] 31 | }, 32 | "ground": { 33 | "rotation": [ 0, 0, 0 ], 34 | "translation": [ 0, 8, 0], 35 | "scale":[ 1.5, 1.5, 1 ] 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Shock Micro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/minecraft/shaders/core/rendertype_entity_translucent_cull.vsh: -------------------------------------------------------------------------------- 1 | #version 150 2 | 3 | #moj_import 4 | #moj_import 5 | 6 | in vec3 Position; 7 | in vec4 Color; 8 | in vec2 UV0; 9 | in vec2 UV1; 10 | in ivec2 UV2; 11 | in vec3 Normal; 12 | 13 | uniform sampler2D Sampler2; 14 | 15 | uniform mat4 ModelViewMat; 16 | uniform mat4 ProjMat; 17 | uniform int FogShape; 18 | uniform float FogStart; 19 | 20 | uniform vec3 Light0_Direction; 21 | uniform vec3 Light1_Direction; 22 | 23 | flat out int isGUI; 24 | out float zpos; 25 | out float vertexDistance; 26 | out vec4 vertexColor; 27 | out vec2 texCoord0; 28 | out vec2 texCoord1; 29 | out vec4 normal; 30 | 31 | void main() { 32 | zpos = Position.z; 33 | gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); 34 | 35 | isGUI = int(ProjMat[3][3] != 0.0); 36 | 37 | vertexDistance = fog_distance(Position, FogShape); 38 | vec4 lightColor = vertexDistance <= 800 ? minecraft_sample_lightmap(Sampler2, UV2) : texelFetch(Sampler2, UV2 / 16, 0); // Added this simply for better compat with light-altering packs. 39 | vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color) * lightColor; 40 | texCoord0 = UV0; 41 | texCoord1 = UV1; 42 | normal = ProjMat * ModelViewMat * vec4(Normal, 0.0); 43 | } 44 | -------------------------------------------------------------------------------- /assets/minecraft/shaders/core/rendertype_entity_translucent_cull.fsh: -------------------------------------------------------------------------------- 1 | #version 150 2 | 3 | #moj_import 4 | 5 | uniform sampler2D Sampler0; 6 | 7 | uniform vec4 ColorModulator; 8 | uniform float FogStart; 9 | uniform float FogEnd; 10 | uniform vec4 FogColor; 11 | 12 | flat in int isGUI; 13 | in float zpos; 14 | in float vertexDistance; 15 | in vec4 vertexColor; 16 | in vec2 texCoord0; 17 | in vec2 texCoord1; 18 | in vec4 normal; 19 | 20 | out vec4 fragColor; 21 | 22 | void main() { 23 | vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator; 24 | if (color.a < 0.1) discard; 25 | 26 | int alpha = int(textureLod(Sampler0, texCoord0, 0.0).a * 255.5); // Take the alpha from the texture's LOD so it doesn't have any issues (this has hurt me before with VDE) 27 | 28 | // Switch used parts of the texture depending on where the model is displayed 29 | if(isGUI == 1) { 30 | if(alpha == 254 && zpos > 100.0) discard; // Handled as inventory slot 31 | if(alpha == 253 && zpos < 100.0) discard; // player doll, so discard the icon 32 | }else{ 33 | if(alpha == 253) discard; // discard the icon outside of gui 34 | } 35 | 36 | // Remap alpha 37 | if(alpha >= 253) 38 | color.a = 1.0; 39 | 40 | fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); 41 | } 42 | -------------------------------------------------------------------------------- /assets/minecraft/models/item/golden_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "textures": { 4 | "0": "item/fire_rod_handheld", 5 | "1": "item/fire_rod" 6 | }, 7 | "elements": [ 8 | { 9 | "name": "rod", 10 | "from": [7, 2, 7], 11 | "to": [9, 14, 9], 12 | "faces": { 13 | "north": {"uv": [12, 0, 14, 12], "texture": "#0"}, 14 | "east": {"uv": [14, 0, 16, 12], "texture": "#0"}, 15 | "south": {"uv": [12, 0, 14, 12], "texture": "#0"}, 16 | "west": {"uv": [14, 0, 16, 12], "texture": "#0"}, 17 | "up": {"uv": [14, 12, 16, 14], "texture": "#0"}, 18 | "down": {"uv": [14, 12, 16, 14], "texture": "#0"} 19 | } 20 | }, 21 | { 22 | "name": "crystal", 23 | "from": [10.25, 16, -1], 24 | "to": [12.25, 18, 1], 25 | "rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]}, 26 | "faces": { 27 | "north": {"uv": [0, 14, 2, 16], "texture": "#0"}, 28 | "east": {"uv": [0, 14, 2, 16], "texture": "#0"}, 29 | "south": {"uv": [0, 14, 2, 16], "texture": "#0"}, 30 | "west": {"uv": [0, 14, 2, 16], "texture": "#0"}, 31 | "up": {"uv": [0, 14, 2, 16], "rotation": 180, "texture": "#0"}, 32 | "down": {"uv": [0, 14, 2, 16], "rotation": 180, "texture": "#0"} 33 | } 34 | }, 35 | { 36 | "name": "fancybit1", 37 | "from": [8, 10, 3], 38 | "to": [8, 22, 13], 39 | "faces": { 40 | "north": {"uv": [0, 0, 0, 7], "texture": "#0"}, 41 | "east": {"uv": [0, 0, 10, 12], "texture": "#0"}, 42 | "south": {"uv": [0, 0, 0, 7], "texture": "#0"}, 43 | "west": {"uv": [0, 0, 10, 12], "texture": "#0"}, 44 | "up": {"uv": [0, 0, 0, 10], "texture": "#0"}, 45 | "down": {"uv": [0, 0, 0, 10], "texture": "#0"} 46 | } 47 | }, 48 | { 49 | "name": "fancybit2", 50 | "from": [3, 10, 8], 51 | "to": [13, 22, 8], 52 | "faces": { 53 | "north": {"uv": [0, 0, 10, 12], "texture": "#0"}, 54 | "east": {"uv": [0, 0, 0, 7], "texture": "#0"}, 55 | "south": {"uv": [0, 0, 10, 12], "texture": "#0"}, 56 | "west": {"uv": [0, 0, 0, 7], "texture": "#0"}, 57 | "up": {"uv": [0, 0, 10, 0], "texture": "#0"}, 58 | "down": {"uv": [0, 0, 10, 0], "texture": "#0"} 59 | } 60 | }, 61 | { 62 | "from": [0, 0, 16], 63 | "to": [16, 16, 16], 64 | "faces": { 65 | "north": {"uv": [0, 0, 16, 16], "texture": "#1"}, 66 | "east": {"uv": [0, 0, 0, 16], "texture": "#1"}, 67 | "south": {"uv": [0, 0, 16, 16], "texture": "#1"}, 68 | "west": {"uv": [0, 0, 0, 16], "texture": "#1"}, 69 | "up": {"uv": [0, 0, 16, 0], "texture": "#1"}, 70 | "down": {"uv": [0, 0, 16, 0], "texture": "#1"} 71 | } 72 | } 73 | ], 74 | "gui_light": "front" 75 | } --------------------------------------------------------------------------------