├── .gitignore ├── builtin ├── renderchest │ ├── items │ │ ├── empty.json │ │ └── unknown.json │ ├── textures │ │ └── item │ │ │ ├── empty.png │ │ │ └── unknown.png │ ├── models │ │ └── item │ │ │ ├── potion │ │ │ ├── bottle.json │ │ │ ├── content.json │ │ │ ├── arrow_base.json │ │ │ ├── arrow_head.json │ │ │ ├── bottle_splash.json │ │ │ └── bottle_lingering.json │ │ │ ├── filled_map │ │ │ ├── base.json │ │ │ └── overlay.json │ │ │ ├── firework_star │ │ │ ├── base.json │ │ │ └── overlay.json │ │ │ ├── unknown.json │ │ │ ├── bed │ │ │ ├── black_bed.json │ │ │ ├── blue_bed.json │ │ │ ├── brown_bed.json │ │ │ ├── cyan_bed.json │ │ │ ├── gray_bed.json │ │ │ ├── green_bed.json │ │ │ ├── lime_bed.json │ │ │ ├── pink_bed.json │ │ │ ├── red_bed.json │ │ │ ├── white_bed.json │ │ │ ├── magenta_bed.json │ │ │ ├── orange_bed.json │ │ │ ├── purple_bed.json │ │ │ ├── yellow_bed.json │ │ │ ├── light_blue_bed.json │ │ │ └── light_gray_bed.json │ │ │ ├── empty.json │ │ │ ├── chest │ │ │ ├── chest.json │ │ │ ├── copper_chest.json │ │ │ ├── ender_chest.json │ │ │ ├── trapped_chest.json │ │ │ ├── exposed_copper_chest.json │ │ │ ├── oxidized_copper_chest.json │ │ │ └── weathered_copper_chest.json │ │ │ ├── shulker_box │ │ │ ├── shulker_box.json │ │ │ ├── blue_shulker_box.json │ │ │ ├── cyan_shulker_box.json │ │ │ ├── gray_shulker_box.json │ │ │ ├── lime_shulker_box.json │ │ │ ├── pink_shulker_box.json │ │ │ ├── red_shulker_box.json │ │ │ ├── black_shulker_box.json │ │ │ ├── brown_shulker_box.json │ │ │ ├── green_shulker_box.json │ │ │ ├── magenta_shulker_box.json │ │ │ ├── orange_shulker_box.json │ │ │ ├── purple_shulker_box.json │ │ │ ├── white_shulker_box.json │ │ │ ├── yellow_shulker_box.json │ │ │ ├── light_blue_shulker_box.json │ │ │ └── light_gray_shulker_box.json │ │ │ ├── copper_golem_statue │ │ │ ├── copper_golem_statue.json │ │ │ ├── exposed_copper_golem_statue.json │ │ │ ├── oxidized_copper_golem_statue.json │ │ │ └── weathered_copper_golem_statue.json │ │ │ ├── decorated_pot_overlay.json │ │ │ ├── conduit.json │ │ │ ├── shield.json │ │ │ ├── decorated_pot.json │ │ │ ├── chest.json │ │ │ ├── banner.json │ │ │ └── decorated_pot_base.json │ └── atlases │ │ └── items.json ├── minecraft │ ├── textures │ │ └── item │ │ │ ├── empty.png │ │ │ └── unknown.png │ ├── items │ │ ├── piglin_head.json │ │ ├── player_head.json │ │ ├── zombie_head.json │ │ ├── creeper_head.json │ │ ├── dragon_head.json │ │ ├── skeleton_skull.json │ │ ├── shield.json │ │ ├── chest.json │ │ ├── conduit.json │ │ ├── rc_potion_bottle.json │ │ ├── red_bed.json │ │ ├── black_bed.json │ │ ├── blue_bed.json │ │ ├── brown_bed.json │ │ ├── cyan_bed.json │ │ ├── decorated_pot.json │ │ ├── gray_bed.json │ │ ├── green_bed.json │ │ ├── lime_bed.json │ │ ├── pink_bed.json │ │ ├── rc_filled_map_base.json │ │ ├── rc_potion_content.json │ │ ├── white_bed.json │ │ ├── wither_skeleton_skull.json │ │ ├── ender_chest.json │ │ ├── magenta_bed.json │ │ ├── orange_bed.json │ │ ├── purple_bed.json │ │ ├── rc_firework_star_base.json │ │ ├── rc_tipped_arrow_base.json │ │ ├── rc_tipped_arrow_head.json │ │ ├── yellow_bed.json │ │ ├── copper_chest.json │ │ ├── light_blue_bed.json │ │ ├── light_gray_bed.json │ │ ├── rc_filled_map_overlay.json │ │ ├── rc_firework_star_overlay.json │ │ ├── rc_potion_bottle_splash.json │ │ ├── trapped_chest.json │ │ ├── rc_potion_bottle_lingering.json │ │ ├── shulker_box.json │ │ ├── waxed_copper_chest.json │ │ ├── red_shulker_box.json │ │ ├── black_shulker_box.json │ │ ├── blue_shulker_box.json │ │ ├── brown_shulker_box.json │ │ ├── copper_golem_statue.json │ │ ├── cyan_shulker_box.json │ │ ├── exposed_copper_chest.json │ │ ├── gray_shulker_box.json │ │ ├── green_shulker_box.json │ │ ├── lime_shulker_box.json │ │ ├── orange_shulker_box.json │ │ ├── oxidized_copper_chest.json │ │ ├── pink_shulker_box.json │ │ ├── purple_shulker_box.json │ │ ├── white_shulker_box.json │ │ ├── yellow_shulker_box.json │ │ ├── magenta_shulker_box.json │ │ ├── waxed_copper_golem_statue.json │ │ ├── waxed_exposed_copper_chest.json │ │ ├── weathered_copper_chest.json │ │ ├── light_blue_shulker_box.json │ │ ├── light_gray_shulker_box.json │ │ ├── waxed_oxidized_copper_chest.json │ │ ├── waxed_weathered_copper_chest.json │ │ ├── exposed_copper_golem_statue.json │ │ ├── oxidized_copper_golem_statue.json │ │ ├── waxed_exposed_copper_golem_statue.json │ │ ├── weathered_copper_golem_statue.json │ │ ├── waxed_oxidized_copper_golem_statue.json │ │ ├── waxed_weathered_copper_golem_statue.json │ │ ├── red_banner.json │ │ ├── black_banner.json │ │ ├── blue_banner.json │ │ ├── brown_banner.json │ │ ├── cyan_banner.json │ │ ├── gray_banner.json │ │ ├── green_banner.json │ │ ├── lime_banner.json │ │ ├── magenta_banner.json │ │ ├── orange_banner.json │ │ ├── pink_banner.json │ │ ├── purple_banner.json │ │ ├── white_banner.json │ │ ├── yellow_banner.json │ │ ├── light_blue_banner.json │ │ └── light_gray_banner.json │ └── atlases │ │ └── misc.json └── mobheads │ ├── items │ ├── bat.json │ ├── bee.json │ ├── cat.json │ ├── cod.json │ ├── cow.json │ ├── fox.json │ ├── pig.json │ ├── vex.json │ ├── allay.json │ ├── blaze.json │ ├── bogged.json │ ├── breeze.json │ ├── camel.json │ ├── donkey.json │ ├── evoker.json │ ├── frog.json │ ├── ghast.json │ ├── giant.json │ ├── goat.json │ ├── hoglin.json │ ├── horse.json │ ├── husk.json │ ├── llama.json │ ├── mule.json │ ├── ocelot.json │ ├── panda.json │ ├── parrot.json │ ├── piglin.json │ ├── player.json │ ├── rabbit.json │ ├── salmon.json │ ├── sheep.json │ ├── slime.json │ ├── spider.json │ ├── squid.json │ ├── stray.json │ ├── turtle.json │ ├── warden.json │ ├── witch.json │ ├── wither.json │ ├── wolf.json │ ├── zoglin.json │ ├── zombie.json │ ├── axolotl.json │ ├── chicken.json │ ├── creaking.json │ ├── creeper.json │ ├── dolphin.json │ ├── drowned.json │ ├── enderman.json │ ├── guardian.json │ ├── mannequin.json │ ├── phantom.json │ ├── pillager.json │ ├── ravager.json │ ├── shulker.json │ ├── skeleton.json │ ├── sniffer.json │ ├── strider.json │ ├── tadpole.json │ ├── villager.json │ ├── armadillo.json │ ├── cave_spider.json │ ├── endermite.json │ ├── glow_squid.json │ ├── illusioner.json │ ├── iron_golem.json │ ├── magma_cube.json │ ├── mooshroom.json │ ├── nautilus.json │ ├── parched.json │ ├── polar_bear.json │ ├── pufferfish.json │ ├── silverfish.json │ ├── snow_golem.json │ ├── vindicator.json │ ├── camel_husk.json │ ├── ender_dragon.json │ ├── happy_ghast.json │ ├── piglin_brute.json │ ├── trader_llama.json │ ├── zombie_horse.json │ ├── copper_golem.json │ ├── elder_guardian.json │ ├── skeleton_horse.json │ ├── wandering_trader.json │ ├── wither_skeleton.json │ ├── zombie_villager.json │ ├── zombified_piglin.json │ ├── zombie_nautilus.json │ └── tropical_fish.json │ └── models │ └── item │ ├── cat.json │ ├── camel.json │ ├── mule.json │ ├── ocelot.json │ ├── donkey.json │ ├── guardian.json │ ├── hoglin.json │ ├── piglin.json │ ├── spider.json │ ├── squid.json │ ├── zoglin.json │ ├── allay.json │ ├── blaze.json │ ├── camel_husk.json │ ├── cow.json │ ├── evoker.json │ ├── horse.json │ ├── mooshroom.json │ ├── base │ ├── head_display.json │ ├── head_32_32.json │ ├── spider.json │ ├── head_64_64.json │ ├── head_64_32.json │ ├── head_64_64_overlay.json │ ├── villager.json │ ├── cat.json │ └── cow.json │ ├── cave_spider.json │ ├── elder_guardian.json │ ├── glow_squid.json │ ├── husk.json │ ├── illusioner.json │ ├── pillager.json │ ├── villager.json │ ├── vindicator.json │ ├── zombie_horse.json │ ├── giant.json │ ├── piglin_brute.json │ ├── skeleton_horse.json │ ├── wandering_trader.json │ ├── zombie.json │ ├── creeper.json │ ├── nautilus.json │ ├── player.json │ ├── skeleton.json │ ├── zombified_piglin.json │ ├── parched.json │ ├── zombie_villager.json │ ├── wither_skeleton.json │ ├── zombie_nautilus.json │ ├── llama.json │ ├── trader_llama.json │ ├── stray.json │ ├── drowned.json │ ├── wither.json │ ├── vex.json │ ├── snow_golem.json │ ├── turtle.json │ ├── tadpole.json │ ├── axolotl.json │ ├── phantom.json │ ├── sheep.json │ ├── dolphin.json │ ├── enderman.json │ ├── iron_golem.json │ ├── pig.json │ ├── bat.json │ ├── armadillo.json │ ├── breeze.json │ ├── fox.json │ ├── bee.json │ ├── goat.json │ ├── wolf.json │ └── endermite.json ├── src ├── Tinter │ ├── DyeTinter.php │ ├── TeamTinter.php │ ├── PotionTinter.php │ ├── FireworkTinter.php │ ├── MapColorTinter.php │ ├── CustomModelDataTinter.php │ ├── DefaultColorTinter.php │ ├── EmptyTinter.php │ ├── Tinterface.php │ ├── GrassTinter.php │ ├── TinterList.php │ ├── RandomTinter.php │ └── ColorMapTinter.php ├── Resource │ ├── Item │ │ ├── SpecialItem.php │ │ ├── BundleSelectedItem.php │ │ ├── AbstractItem.php │ │ ├── Properties │ │ │ ├── Property.php │ │ │ ├── LocalTimeProperty.php │ │ │ ├── NumberProperty.php │ │ │ ├── StringProperty.php │ │ │ ├── ConditionProperty.php │ │ │ └── Properties.php │ │ ├── EmptyItem.php │ │ ├── Parts │ │ │ ├── SelectCase.php │ │ │ └── RangeDispatchEntry.php │ │ └── ItemInterface.php │ ├── Texture │ │ ├── TextureFrame.php │ │ ├── FileTexture.php │ │ ├── ResolvedAnimationFrame.php │ │ ├── BufferTexture.php │ │ ├── TextureInterface.php │ │ └── TextureList.php │ ├── DynamicResourceGeneratorInterface.php │ ├── AtlasSource │ │ └── TextureSource │ │ │ ├── SingleAtlasTextureSource.php │ │ │ ├── DirectoryAtlasTextureSource.php │ │ │ ├── Permutations │ │ │ └── PermutatedTextureInfo.php │ │ │ └── UnstitchAtlasTextureSource.php │ ├── DynamicResources │ │ ├── CrossbowModelGenerator.php │ │ └── ArmorTrimModelGenerator.php │ └── ResourceManagerInterface.php ├── Exception │ ├── RenderchestException.php │ ├── FileResolutionException.php │ ├── ItemResolutionException.php │ ├── ModelResolutionException.php │ ├── ResourceResolutionException.php │ ├── InvalidItemDefinitionException.php │ ├── InvalidResourceLocatorException.php │ ├── TextureResolutionException.php │ └── InvalidTinterDefinitionException.php ├── Model │ ├── Axis.php │ ├── Face │ │ └── FaceDirection.php │ ├── ModelGuiLight.php │ ├── Rasterizer │ │ └── Point.php │ ├── ModelDisplaySettings.php │ ├── ModelInterface.php │ └── LightSource.php ├── Vector │ ├── UV.php │ └── Vector2.php ├── Output │ ├── ItemStyle │ │ ├── InternalItemStyleGenerator.php │ │ ├── MapItemStyleGenerator.php │ │ └── FireWorkStarItemStyleGenerator.php │ ├── CSS │ │ ├── AnimationEntry.php │ │ ├── CSSEntry.php │ │ ├── MediaQueryEntry.php │ │ ├── StyleSheet.php │ │ └── PropertyListEntry.php │ ├── ItemRenderTask.php │ └── Item.php ├── Util │ └── Math.php └── Constants.php ├── composer.json └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ 3 | assets/ 4 | renders/ 5 | test.php 6 | test.html 7 | -------------------------------------------------------------------------------- /builtin/renderchest/items/empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:empty" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /builtin/minecraft/textures/item/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aternosorg/renderchest/HEAD/builtin/minecraft/textures/item/empty.png -------------------------------------------------------------------------------- /builtin/minecraft/textures/item/unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aternosorg/renderchest/HEAD/builtin/minecraft/textures/item/unknown.png -------------------------------------------------------------------------------- /builtin/mobheads/items/bat.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/bat" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/bee.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/bee" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/cat.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/cat" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/cod.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/cod" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/cow.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/cow" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/fox.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/fox" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/pig.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/pig" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/vex.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/vex" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/renderchest/textures/item/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aternosorg/renderchest/HEAD/builtin/renderchest/textures/item/empty.png -------------------------------------------------------------------------------- /builtin/renderchest/textures/item/unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aternosorg/renderchest/HEAD/builtin/renderchest/textures/item/unknown.png -------------------------------------------------------------------------------- /builtin/minecraft/items/piglin_head.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/piglin" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /builtin/minecraft/items/player_head.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/player" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /builtin/minecraft/items/zombie_head.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/zombie" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /builtin/mobheads/items/allay.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/allay" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/blaze.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/blaze" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/bogged.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/bogged" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/breeze.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/breeze" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/camel.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/camel" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/donkey.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/donkey" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/evoker.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/evoker" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/frog.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/frog" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/ghast.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/ghast" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/giant.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/giant" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/goat.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/goat" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/hoglin.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/hoglin" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/horse.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/horse" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/husk.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/husk" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/llama.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/llama" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/mule.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/mule" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/ocelot.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/ocelot" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/panda.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/panda" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/parrot.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/parrot" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/piglin.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/piglin" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/player.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/player" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/rabbit.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/rabbit" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/salmon.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/salmon" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/sheep.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/sheep" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/slime.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/slime" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/spider.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/spider" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/squid.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/squid" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/stray.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/stray" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/turtle.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/turtle" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/warden.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/warden" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/witch.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/witch" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/wither.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/wither" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/wolf.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/wolf" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/zoglin.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/zoglin" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/mobheads/items/zombie.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "mobheads:item/zombie" 5 | } 6 | } -------------------------------------------------------------------------------- /builtin/renderchest/models/item/potion/bottle.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "item/potion" 5 | } 6 | } -------------------------------------------------------------------------------- /src/Tinter/DyeTinter.php: -------------------------------------------------------------------------------- 1 | LightSource::getSideLight(), 17 | default => LightSource::getFrontLight() 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Resource/Item/AbstractItem.php: -------------------------------------------------------------------------------- 1 | properties; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Tinter/DefaultColorTinter.php: -------------------------------------------------------------------------------- 1 | default ?? null; 17 | return static::fromColorValue($value); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Resource/Texture/TextureFrame.php: -------------------------------------------------------------------------------- 1 | index; 17 | } 18 | 19 | /** 20 | * @return int 21 | */ 22 | public function getTime(): int 23 | { 24 | return $this->time; 25 | } 26 | } -------------------------------------------------------------------------------- /builtin/minecraft/atlases/misc.json: -------------------------------------------------------------------------------- 1 | { 2 | "sources": [ 3 | { 4 | "type": "directory", 5 | "source": "misc", 6 | "prefix": "misc/" 7 | }, 8 | { 9 | "type": "directory", 10 | "source": "entity", 11 | "prefix": "entity/" 12 | }, 13 | { 14 | "type": "directory", 15 | "source": "colormap", 16 | "prefix": "colormap/" 17 | }, 18 | { 19 | "type": "single", 20 | "resource": "minecraft:item/unknown", 21 | "sprite": "missingno" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /src/Resource/Texture/FileTexture.php: -------------------------------------------------------------------------------- 1 | readImage($path); 19 | parent::__construct($image, $meta); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vector/UV.php: -------------------------------------------------------------------------------- 1 | u, $this->v]; 18 | } 19 | 20 | /** 21 | * @inheritDoc 22 | */ 23 | function setValues(array $values): void 24 | { 25 | $this->u = $values[0]; 26 | $this->v = $values[1]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Vector/Vector2.php: -------------------------------------------------------------------------------- 1 | x, $this->y]; 19 | } 20 | 21 | /** 22 | * @inheritDoc 23 | */ 24 | function setValues(array $values): void 25 | { 26 | [$this->x, $this->y] = $values; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Resource/Texture/ResolvedAnimationFrame.php: -------------------------------------------------------------------------------- 1 | frame; 17 | } 18 | 19 | /** 20 | * @return float 21 | */ 22 | public function getInterpolation(): float 23 | { 24 | return $this->interpolation; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/Tinter/EmptyTinter.php: -------------------------------------------------------------------------------- 1 | name; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/wither.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 64], 5 | "textures": { 6 | "0": "entity/wither/wither" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4, 4, 4], 11 | "to": [12, 12, 12], 12 | "faces": { 13 | "north": {"uv": [2, 2, 4, 4], "texture": "#0"}, 14 | "east": {"uv": [0, 2, 2, 4], "texture": "#0"}, 15 | "south": {"uv": [6, 2, 8, 4], "texture": "#0"}, 16 | "west": {"uv": [4, 2, 6, 4], "texture": "#0"}, 17 | "up": {"uv": [2, 0, 4, 2], "rotation": 180, "texture": "#0"}, 18 | "down": {"uv": [4, 0, 6, 2], "texture": "#0"} 19 | } 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /builtin/mobheads/models/item/base/head_32_32.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [32, 32], 5 | "elements": [ 6 | { 7 | "from": [4, 4, 4], 8 | "to": [12, 12, 12], 9 | "faces": { 10 | "north": {"uv": [2.5, 2.5, 5, 5], "texture": "#texture"}, 11 | "east": {"uv": [0, 2.5, 2.5, 5], "texture": "#texture"}, 12 | "south": {"uv": [7.5, 2.5, 10, 5], "texture": "#texture"}, 13 | "west": {"uv": [5, 2.5, 7.5, 5], "texture": "#texture"}, 14 | "up": {"uv": [2.5, 0, 5, 2.5], "rotation": 180, "texture": "#texture"}, 15 | "down": {"uv": [5, 0, 7.5, 2.5], "texture": "#texture"} 16 | } 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/Tinter/Tinterface.php: -------------------------------------------------------------------------------- 1 | readImageBlob($data); 19 | if ($image->getImageType() !== Imagick::IMGTYPE_TRUECOLORMATTE) { 20 | $image->transformImageColorspace(Imagick::COLORSPACE_UNDEFINED); 21 | } 22 | parent::__construct($image, $meta); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/vex.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [32, 32], 5 | "textures": { 6 | "0": "entity/illager/vex" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4, 4, 4], 11 | "to": [12, 12, 12], 12 | "rotation": {"angle": 0, "axis": "y", "origin": [-4.8, 0, -4.8]}, 13 | "faces": { 14 | "north": {"uv": [2.5, 2.5, 5, 5], "texture": "#0"}, 15 | "east": {"uv": [0, 2.5, 2.5, 5], "texture": "#0"}, 16 | "south": {"uv": [7.5, 2.5, 10, 5], "texture": "#0"}, 17 | "west": {"uv": [5, 2.5, 7.5, 5], "texture": "#0"}, 18 | "up": {"uv": [2.5, 0, 5, 2.5], "rotation": 180, "texture": "#0"}, 19 | "down": {"uv": [5, 0, 7.5, 2.5], "texture": "#0"} 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/Model/Rasterizer/Point.php: -------------------------------------------------------------------------------- 1 | vector; 20 | } 21 | 22 | /** 23 | * @return UV 24 | */ 25 | public function getUv(): UV 26 | { 27 | return $this->uv; 28 | } 29 | 30 | /** 31 | * @return float 32 | */ 33 | public function getDepth(): float 34 | { 35 | return $this->depth; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Resource/AtlasSource/TextureSource/SingleAtlasTextureSource.php: -------------------------------------------------------------------------------- 1 | settings->sprite ?? $this->settings->resource; 17 | if (!$locator->is(ResourceLocator::parse($sprite, $this->namespace))) { 18 | return null; 19 | } 20 | return parent::getTextureLocator(ResourceLocator::parse($this->settings->resource, $this->namespace)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Resource/Item/Properties/LocalTimeProperty.php: -------------------------------------------------------------------------------- 1 | timezone ?? ""); 24 | $time = new DateTime("now", $timezone); 25 | return $time->format($options->pattern ?? ""); 26 | } catch (Exception) { 27 | return ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/snow_golem.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "textures": { 5 | "0": "minecraft:block/carved_pumpkin", 6 | "1": "minecraft:block/pumpkin_top", 7 | "2": "minecraft:block/pumpkin_side" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [4, 4, 4], 12 | "to": [12, 12, 12], 13 | "rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 4]}, 14 | "faces": { 15 | "north": {"uv": [0, 0, 16, 16], "texture": "#0"}, 16 | "east": {"uv": [0, 0, 16, 16], "texture": "#2"}, 17 | "south": {"uv": [0, 0, 16, 16], "texture": "#2"}, 18 | "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, 19 | "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, 20 | "down": {"uv": [0, 0, 16, 16], "texture": "#1"} 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /builtin/mobheads/models/item/turtle.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [128, 64], 5 | "textures": { 6 | "0": "entity/turtle/big_sea_turtle" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4, 4.75, 4], 11 | "to": [11.8, 11.25, 11.8], 12 | "rotation": {"angle": 0, "axis": "y", "origin": [-2.4, 0, -2.4]}, 13 | "faces": { 14 | "north": {"uv": [1.125, 1.5, 1.875, 2.75], "texture": "#0"}, 15 | "east": {"uv": [0.375, 1.5, 1.125, 2.75], "texture": "#0"}, 16 | "south": {"uv": [2.625, 1.5, 3.375, 2.75], "texture": "#0"}, 17 | "west": {"uv": [1.875, 1.5, 2.625, 2.75], "texture": "#0"}, 18 | "up": {"uv": [1.125, 0, 1.875, 1.5], "rotation": 180, "texture": "#0"}, 19 | "down": {"uv": [1.875, 0, 2.625, 1.5], "texture": "#0"} 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/Resource/AtlasSource/TextureSource/DirectoryAtlasTextureSource.php: -------------------------------------------------------------------------------- 1 | getPath(); 15 | if (!str_starts_with($path, $this->settings->prefix)) { 16 | return null; 17 | } 18 | $source = str_ends_with($this->settings->source, "/") ? $this->settings->source : $this->settings->source . "/"; 19 | return parent::getTextureLocator($locator->clone()->setPath($source . substr($path, strlen($this->settings->prefix)))); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Resource/Item/EmptyItem.php: -------------------------------------------------------------------------------- 1 | newImage($width, $height, new ImagickPixel('transparent')); 28 | return $result; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /builtin/renderchest/models/item/conduit.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "minecraft:item/conduit", 4 | "texture_size": [32, 16], 5 | "gui_light": "side", 6 | "textures": { 7 | "texture": "entity/conduit/base" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [5, 5, 5], 12 | "to": [11, 11, 11], 13 | "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, 14 | "faces": { 15 | "north": {"uv": [3, 6, 6, 12], "rotation": 180, "texture": "#texture"}, 16 | "east": {"uv": [6, 6, 9, 12], "rotation": 180, "texture": "#texture"}, 17 | "south": {"uv": [9, 6, 12, 12], "rotation": 180, "texture": "#texture"}, 18 | "west": {"uv": [0, 6, 3, 12], "rotation": 180, "texture": "#texture"}, 19 | "up": {"uv": [9, 0, 6, 6], "rotation": 180, "texture": "#texture"}, 20 | "down": {"uv": [3, 0, 6, 6], "texture": "#texture"} 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aternos/renderchest", 3 | "description": "PHP library for rendering icons for Minecraft items directly from Minecraft's assets", 4 | "keywords": ["minecraft", "item", "render", "icon", "css"], 5 | "readme": "README.md", 6 | "type": "library", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Kurt Thiemann", 11 | "email": "kurt@aternos.org" 12 | } 13 | ], 14 | "support": { 15 | "source": "https://github.com/aternosorg/renderchest", 16 | "issues": "https://github.com/aternosorg/renderchest/issues" 17 | }, 18 | "require": { 19 | "ext-imagick": "*", 20 | "ext-json": "*", 21 | "vanilla/garden-cli": "^3.1", 22 | "php": ">=8.1", 23 | "aternos/taskmaster": "^1.1.3" 24 | }, 25 | "autoload": { 26 | "psr-4": { 27 | "Aternos\\Renderchest\\": "src/" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Resource/Item/Parts/SelectCase.php: -------------------------------------------------------------------------------- 1 | values; 26 | } 27 | 28 | /** 29 | * @return ItemInterface 30 | */ 31 | public function getItem(): ItemInterface 32 | { 33 | return $this->item; 34 | } 35 | 36 | /** 37 | * @param mixed $value 38 | * @return bool 39 | */ 40 | public function match(mixed $value): bool 41 | { 42 | return in_array($value, $this->values); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Output/ItemStyle/InternalItemStyleGenerator.php: -------------------------------------------------------------------------------- 1 | getLocator(), "minecraft:rc_"); 17 | } 18 | 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function getGlobalStyles(ItemLibraryGenerator $generator): array 23 | { 24 | return []; 25 | } 26 | 27 | /** 28 | * @inheritDoc 29 | */ 30 | public function getItemStyles(): array 31 | { 32 | return []; 33 | } 34 | 35 | /** 36 | * @inheritDoc 37 | */ 38 | public function getItemFallbackStyles(): array 39 | { 40 | return []; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Resource/Item/Parts/RangeDispatchEntry.php: -------------------------------------------------------------------------------- 1 | threshold; 26 | } 27 | 28 | /** 29 | * @return ItemInterface 30 | */ 31 | public function getItem(): ItemInterface 32 | { 33 | return $this->item; 34 | } 35 | 36 | /** 37 | * @param float $value 38 | * @return bool 39 | */ 40 | public function match(float $value): bool 41 | { 42 | return $value >= $this->threshold; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Util/Math.php: -------------------------------------------------------------------------------- 1 | temperature) && is_numeric($data->temperature) ?? 0.5; 18 | $downfall = isset($data->downfall) && is_numeric($data->downfall) ?? 1; 19 | 20 | $x = 1.0 - ($downfall * $temperature); 21 | $y = 1.0 - $temperature; 22 | 23 | return (new static($resourceManager))->setSamplePosition($x, $y); 24 | } 25 | 26 | /** 27 | * @inheritDoc 28 | * @throws Exception 29 | */ 30 | protected function getColorMap(): ResourceLocator 31 | { 32 | return ResourceLocator::parse("minecraft:colormap/grass"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Output/CSS/AnimationEntry.php: -------------------------------------------------------------------------------- 1 | name; 22 | } 23 | 24 | /** 25 | * @param PropertyListEntry $entry 26 | * @return $this 27 | */ 28 | public function addKeyframe(PropertyListEntry $entry): static 29 | { 30 | $this->keyframes[] = $entry; 31 | return $this; 32 | } 33 | 34 | /** 35 | * @inheritDoc 36 | */ 37 | protected function getContent(): string 38 | { 39 | $res = []; 40 | foreach ($this->keyframes as $frame) { 41 | $res[] = $frame->getEntryString(); 42 | } 43 | return implode("\n", $res); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/tadpole.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "textures": { 5 | "texture": "minecraft:entity/tadpole/tadpole" 6 | }, 7 | "elements": [ 8 | { 9 | "from": [5, 6, 1], 10 | "to": [11, 10, 7], 11 | "rotation": {"angle": 0, "axis": "y", "origin": [-8, 0, -8]}, 12 | "faces": { 13 | "north": {"uv": [3, 3, 6, 5], "texture": "#texture"}, 14 | "east": {"uv": [0, 3, 3, 5], "texture": "#texture"}, 15 | "south": {"uv": [9, 3, 12, 5], "texture": "#texture"}, 16 | "west": {"uv": [6, 3, 9, 5], "texture": "#texture"}, 17 | "up": {"uv": [3, 0, 6, 3], "rotation": 180, "texture": "#texture"}, 18 | "down": {"uv": [6, 0, 9, 3], "texture": "#texture"} 19 | } 20 | }, 21 | { 22 | "from": [8, 6, 3], 23 | "to": [8, 10, 17], 24 | "rotation": {"angle": 0, "axis": "y", "origin": [-8, 0, -8]}, 25 | "faces": { 26 | "east": {"uv": [0, 7, 7, 9], "texture": "#texture"}, 27 | "west": {"uv": [7, 7, 0, 9], "texture": "#texture"} 28 | } 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /src/Tinter/TinterList.php: -------------------------------------------------------------------------------- 1 | tinters[] = $tinter; 25 | return $this; 26 | } 27 | 28 | /** 29 | * @param Tinterface[] $tinters 30 | * @return $this 31 | */ 32 | public function setTinters(array $tinters): static 33 | { 34 | $this->tinters = $tinters; 35 | return $this; 36 | } 37 | 38 | /** 39 | * @param int $index 40 | * @return ImagickPixel|null 41 | */ 42 | public function getTintColor(int $index): ?ImagickPixel 43 | { 44 | $tinter = $this->tinters[$index] ?? null; 45 | return $tinter?->getTintColor(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Output/CSS/CSSEntry.php: -------------------------------------------------------------------------------- 1 | getSelector() . " {\n" . $this->indent($this->getContent()) . "\n}"; 13 | } 14 | 15 | /** 16 | * @return string 17 | */ 18 | public function __toString(): string 19 | { 20 | return $this->getEntryString(); 21 | } 22 | 23 | /** 24 | * @return string 25 | */ 26 | abstract protected function getSelector(): string; 27 | 28 | /** 29 | * @return string 30 | */ 31 | abstract protected function getContent(): string; 32 | 33 | /** 34 | * @param string $str 35 | * @return string 36 | */ 37 | protected function indent(string $str): string 38 | { 39 | $parts = explode("\n", $str); 40 | $parts = array_map(function ($part) { 41 | return " " . $part; 42 | }, $parts); 43 | return implode("\n", $parts); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023-2024 Aternos GmbH 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/axolotl.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 64], 5 | "textures": { 6 | "texture": "minecraft:entity/axolotl/axolotl_lucy" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4, 5, 4], 11 | "to": [12, 10, 9], 12 | "faces": { 13 | "north": {"uv": [1.25, 1.5, 3.25, 2.75], "texture": "#texture"}, 14 | "east": {"uv": [0, 1.5, 1.25, 2.75], "texture": "#texture"}, 15 | "south": {"uv": [4.5, 1.5, 6.5, 2.75], "texture": "#texture"}, 16 | "west": {"uv": [3.25, 1.5, 4.5, 2.75], "texture": "#texture"}, 17 | "up": {"uv": [1.25, 0.25, 3.25, 1.5], "texture": "#texture"}, 18 | "down": {"uv": [3.25, 0.25, 5.25, 1.5], "texture": "#texture"} 19 | } 20 | }, 21 | { 22 | "from": [1, 5, 8], 23 | "to": [15, 12, 9], 24 | "faces": { 25 | "north": {"uv": [0, 10, 3.5, 11.75], "texture": "#texture"} 26 | } 27 | }, 28 | { 29 | "from": [4, 10, 8], 30 | "to": [12, 13, 9], 31 | "faces": { 32 | "north": {"uv": [0.75, 9.25, 2.75, 10], "texture": "#texture"} 33 | } 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /src/Resource/Texture/TextureInterface.php: -------------------------------------------------------------------------------- 1 | resourceManager->getItem(new ResourceLocator("minecraft", "crossbow")); 26 | $item->getProperties()->set(new StringProperty("minecraft:charge_type", $locator->getPath())); 27 | return $item; 28 | } 29 | 30 | /** 31 | * @inheritDoc 32 | */ 33 | public function getAllItems(string $namespace): array 34 | { 35 | return [ 36 | strval(new ResourceLocator(static::getNamespace(), "arrow")), 37 | strval(new ResourceLocator(static::getNamespace(), "rocket")), 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Tinter/RandomTinter.php: -------------------------------------------------------------------------------- 1 | cache !== null) { 48 | return $this->cache; 49 | } 50 | 51 | return $this->cache = new ImagickPixel(static::COLORS[array_rand(static::COLORS)]); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/pig.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 64], 5 | "textures": { 6 | "texture": "entity/pig/temperate_pig" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4, 4, 4], 11 | "to": [12, 12, 12], 12 | "rotation": {"angle": 0, "axis": "y", "origin": [4, 4, 4]}, 13 | "faces": { 14 | "north": {"uv": [2, 2, 4, 4], "texture": "#texture"}, 15 | "east": {"uv": [0, 2, 2, 4], "texture": "#texture"}, 16 | "south": {"uv": [6, 2, 8, 4], "texture": "#texture"}, 17 | "west": {"uv": [4, 2, 6, 4], "texture": "#texture"}, 18 | "up": {"uv": [2, 0, 4, 2], "rotation": 180, "texture": "#texture"}, 19 | "down": {"uv": [4, 0, 6, 2], "texture": "#texture"} 20 | } 21 | }, 22 | { 23 | "from": [6, 5, 3], 24 | "to": [10, 8, 4], 25 | "rotation": {"angle": 0, "axis": "y", "origin": [6, 5, 3]}, 26 | "faces": { 27 | "north": {"uv": [4.25, 4.25, 5.25, 5], "texture": "#texture"}, 28 | "east": {"uv": [4, 4.25, 4.25, 5], "texture": "#texture"}, 29 | "west": {"uv": [5.25, 4.25, 5.5, 5], "texture": "#texture"}, 30 | "up": {"uv": [4.25, 4, 5.25, 4.25], "rotation": 180, "texture": "#texture"}, 31 | "down": {"uv": [5.25, 4, 6.25, 4.25], "texture": "#texture"} 32 | } 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /src/Model/ModelDisplaySettings.php: -------------------------------------------------------------------------------- 1 | rotation; 37 | } 38 | 39 | /** 40 | * @return Vector3 41 | */ 42 | public function getTranslation(): Vector3 43 | { 44 | return $this->translation; 45 | } 46 | 47 | /** 48 | * @return Vector3 49 | */ 50 | public function getScale(): Vector3 51 | { 52 | return $this->scale; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/base/head_64_64_overlay.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mobheads:item/base/head_display", 3 | "format_version": "1.21.6", 4 | "credit": "Made with Blockbench", 5 | "texture_size": [64, 64], 6 | "elements": [ 7 | { 8 | "from": [4, 4, 4], 9 | "to": [12, 12, 12], 10 | "rotation": {"angle": 0, "axis": "y", "origin": [4, 4, 4]}, 11 | "faces": { 12 | "north": {"uv": [2, 2, 4, 4], "texture": "#texture"}, 13 | "east": {"uv": [0, 2, 2, 4], "texture": "#texture"}, 14 | "south": {"uv": [6, 2, 8, 4], "texture": "#texture"}, 15 | "west": {"uv": [4, 2, 6, 4], "texture": "#texture"}, 16 | "up": {"uv": [2, 0, 4, 2], "rotation": 180, "texture": "#texture"}, 17 | "down": {"uv": [4, 0, 6, 2], "texture": "#texture"} 18 | } 19 | }, 20 | { 21 | "from": [3.75, 3.75, 3.75], 22 | "to": [12.25, 12.25, 12.25], 23 | "rotation": {"angle": 0, "axis": "y", "origin": [3.75, 3.75, 3.75]}, 24 | "faces": { 25 | "north": {"uv": [2, 10, 4, 12], "texture": "#texture"}, 26 | "east": {"uv": [0, 10, 2, 12], "texture": "#texture"}, 27 | "south": {"uv": [6, 10, 8, 12], "texture": "#texture"}, 28 | "west": {"uv": [4, 10, 6, 12], "texture": "#texture"}, 29 | "up": {"uv": [2, 8, 4, 10], "rotation": 180, "texture": "#texture"}, 30 | "down": {"uv": [4, 8, 6, 10], "texture": "#texture"} 31 | } 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /src/Output/CSS/MediaQueryEntry.php: -------------------------------------------------------------------------------- 1 | test . ")"; 25 | } 26 | 27 | /** 28 | * @inheritDoc 29 | */ 30 | protected function getContent(): string 31 | { 32 | $res = []; 33 | foreach ($this->entries as $entry) { 34 | $res[] = $entry->getEntryString(); 35 | } 36 | return implode("\n", $res); 37 | } 38 | 39 | /** 40 | * @param CSSEntry $entry 41 | * @return $this 42 | */ 43 | public function addEntry(CSSEntry $entry): static 44 | { 45 | $this->entries[] = $entry; 46 | return $this; 47 | } 48 | 49 | /** 50 | * @param CSSEntry[] $entries 51 | * @return $this 52 | */ 53 | public function addEntries(array $entries): static 54 | { 55 | foreach ($entries as $entry) { 56 | $this->addEntry($entry); 57 | } 58 | return $this; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /builtin/renderchest/models/item/shield.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "texture_size": [64, 64], 4 | "textures": { 5 | "texture": "entity/shield_base_nopattern" 6 | }, 7 | "gui_light": "side", 8 | "elements": [ 9 | { 10 | "from": [2, 0, 0], 11 | "to": [14, 22, 1], 12 | "faces": { 13 | "north": {"uv": [0.25, 0.25, 3.25, 5.75], "texture": "#texture"}, 14 | "east": {"uv": [0, 0.25, 0.25, 5.75], "texture": "#texture"}, 15 | "south": {"uv": [3.5, 0.25, 6.5, 5.75], "texture": "#texture"}, 16 | "west": {"uv": [3, 0.25, 3.25, 5.75], "texture": "#texture"}, 17 | "up": {"uv": [0.25, 0, 3.25, 0.25], "texture": "#texture"}, 18 | "down": {"uv": [0.25, 5.5, 3.25, 5.75], "texture": "#texture"} 19 | } 20 | }, 21 | { 22 | "from": [7, 8, 1], 23 | "to": [9, 14, 7], 24 | "faces": { 25 | "north": {"uv": [8, 0, 8.5, 1.5], "texture": "#texture"}, 26 | "east": {"uv": [6.5, 1.5, 8, 3], "texture": "#texture"}, 27 | "south": {"uv": [8.5, 0, 9, 1.5], "texture": "#texture"}, 28 | "west": {"uv": [8.5, 1.5, 10, 3], "texture": "#texture"}, 29 | "up": {"uv": [8, 1.5, 8.5, 3], "texture": "#texture"}, 30 | "down": {"uv": [10, 1.5, 10.5, 3], "texture": "#texture"} 31 | } 32 | } 33 | ], 34 | "display": { 35 | "gui": { 36 | "rotation": [15, 155, 5], 37 | "translation": [0.5, -0.9, 0], 38 | "scale": [0.68, 0.68, 0.68] 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/bat.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [32, 32], 5 | "textures": { 6 | "0": "entity/bat" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4.829, 4.2, 6.404], 11 | "to": [11.171, 8.9565, 9.575], 12 | "rotation": {"angle": 0, "axis": "y", "origin": [-4.684, 0, -4.684]}, 13 | "faces": { 14 | "north": {"uv": [1, 4.5, 3, 6], "texture": "#0"}, 15 | "east": {"uv": [0, 4.5, 1, 6], "texture": "#0"}, 16 | "south": {"uv": [4, 4.5, 6, 6], "texture": "#0"}, 17 | "west": {"uv": [3, 4.5, 4, 6], "texture": "#0"}, 18 | "up": {"uv": [1, 3.5, 3, 4.5], "rotation": 180, "texture": "#0"}, 19 | "down": {"uv": [3, 3.5, 5, 4.5], "texture": "#0"} 20 | } 21 | }, 22 | { 23 | "from": [1.658, 5.7855, 7.9895], 24 | "to": [6.4145, 13.713, 7.9895], 25 | "rotation": {"angle": 0, "axis": "y", "origin": [-4.684, 0, -4.684]}, 26 | "faces": { 27 | "north": {"uv": [4, 7.5, 5.5, 10], "texture": "#0"}, 28 | "south": {"uv": [5.5, 7.5, 7, 10], "texture": "#0"} 29 | } 30 | }, 31 | { 32 | "from": [9.5855, 5.7855, 7.9895], 33 | "to": [14.342, 13.713, 7.9895], 34 | "rotation": {"angle": 0, "axis": "y", "origin": [-4.684, 0, -4.684]}, 35 | "faces": { 36 | "north": {"uv": [0.5, 7.5, 2, 10], "texture": "#0"}, 37 | "south": {"uv": [2, 7.5, 3.5, 10], "texture": "#0"} 38 | } 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /src/Resource/Item/Properties/NumberProperty.php: -------------------------------------------------------------------------------- 1 | 0, 11 | "minecraft:damage" => 0, 12 | "minecraft:count" => 0, 13 | "minecraft:cooldown" => 0, 14 | "minecraft:time" => 0, 15 | "minecraft:compass" => 0, 16 | "minecraft:crossbow/pull" => 0, 17 | "minecraft:use_duration" => 0, 18 | "minecraft:use_cycle" => 0, 19 | "minecraft:custom_model_data" => 0 20 | ]; 21 | 22 | /** 23 | * @param string $name 24 | * @param float|null $value 25 | */ 26 | public function __construct( 27 | string $name, 28 | protected ?float $value = null 29 | ) 30 | { 31 | parent::__construct($name); 32 | } 33 | 34 | /** 35 | * @inheritDoc 36 | */ 37 | public function get(stdClass $options): float 38 | { 39 | if ($this->value !== null) { 40 | return $this->value; 41 | } 42 | return static::DEFAULT[$this->name] ?? 0; 43 | } 44 | 45 | /** 46 | * @param float|null $value 47 | * @return $this 48 | */ 49 | public function setValue(?float $value): static 50 | { 51 | $this->value = $value; 52 | return $this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/armadillo.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 64], 5 | "textures": { 6 | "0": "entity/armadillo" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [6.125, 3, 8], 11 | "to": [9.875, 9.25, 10.5], 12 | "rotation": {"angle": 22.5, "axis": "x", "origin": [7.375, 9.25, 9.25]}, 13 | "faces": { 14 | "north": {"uv": [11.25, 4.25, 12, 5.5], "texture": "#0"}, 15 | "east": {"uv": [10.75, 4.25, 11.25, 5.5], "texture": "#0"}, 16 | "south": {"uv": [12.5, 4.25, 13.25, 5.5], "texture": "#0"}, 17 | "west": {"uv": [12, 4.25, 12.5, 5.5], "texture": "#0"}, 18 | "up": {"uv": [11.25, 3.75, 12, 4.25], "rotation": 180, "texture": "#0"}, 19 | "down": {"uv": [12, 3.75, 12.75, 4.25], "texture": "#0"} 20 | } 21 | }, 22 | { 23 | "from": [3.625, 8, 8], 24 | "to": [6.125, 13, 8], 25 | "rotation": {"angle": -22.5, "axis": "y", "origin": [6.125, 9.25, 8]}, 26 | "faces": { 27 | "north": {"uv": [11.75, 2.5, 12.25, 3.5], "texture": "#0"}, 28 | "south": {"uv": [12.25, 2.5, 11.75, 3.5], "texture": "#0"} 29 | } 30 | }, 31 | { 32 | "from": [9.875, 8, 8], 33 | "to": [12.375, 13, 8], 34 | "rotation": {"angle": 22.5, "axis": "y", "origin": [9.875, 9.25, 8]}, 35 | "faces": { 36 | "north": {"uv": [10.75, 2.5, 11.25, 3.5], "texture": "#0"}, 37 | "south": {"uv": [11.25, 2.5, 10.75, 3.5], "texture": "#0"} 38 | } 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/Resource/Item/Properties/StringProperty.php: -------------------------------------------------------------------------------- 1 | "right", 11 | "minecraft:charge_type" => "none", 12 | "minecraft:trim_material" => "none", 13 | "minecraft:block_state" => "", 14 | "minecraft:display_context" => "gui", 15 | "minecraft:local_time" => "", 16 | "minecraft:context_dimension" => "minecraft:overworld", 17 | "minecraft:context_entity_type" => "minecraft:player", 18 | "minecraft:custom_model_data" => "" 19 | ]; 20 | 21 | /** 22 | * @param string $name 23 | * @param string|null $value 24 | */ 25 | public function __construct( 26 | string $name, 27 | protected ?string $value = null 28 | ) 29 | { 30 | parent::__construct($name); 31 | } 32 | 33 | /** 34 | * @inheritDoc 35 | */ 36 | public function get(stdClass $options): string 37 | { 38 | if ($this->value !== null) { 39 | return $this->value; 40 | } 41 | return static::DEFAULT[$this->name] ?? ""; 42 | } 43 | 44 | /** 45 | * @param string|null $value 46 | * @return $this 47 | */ 48 | public function setValue(?string $value): static 49 | { 50 | $this->value = $value; 51 | return $this; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Output/CSS/StyleSheet.php: -------------------------------------------------------------------------------- 1 | entries = $entries; 19 | return $this; 20 | } 21 | 22 | /** 23 | * @return array 24 | */ 25 | public function getEntries(): array 26 | { 27 | return $this->entries; 28 | } 29 | 30 | /** 31 | * @param CSSEntry $entry 32 | * @return $this 33 | */ 34 | public function addEntry(CSSEntry $entry): static 35 | { 36 | $this->entries[] = $entry; 37 | return $this; 38 | } 39 | 40 | /** 41 | * @param CSSEntry[] $entries 42 | * @return $this 43 | */ 44 | public function addEntries(array $entries): static 45 | { 46 | array_push($this->entries, ...$entries); 47 | return $this; 48 | } 49 | 50 | /** 51 | * @return string 52 | */ 53 | public function getContent(): string 54 | { 55 | $res = []; 56 | foreach ($this->entries as $entry) { 57 | $res[] = $entry->getEntryString(); 58 | } 59 | return implode("\n\n", $res); 60 | } 61 | 62 | /** 63 | * @return string 64 | */ 65 | public function __toString(): string 66 | { 67 | return $this->getContent(); 68 | } 69 | } -------------------------------------------------------------------------------- /src/Model/ModelInterface.php: -------------------------------------------------------------------------------- 1 | false, 11 | "minecraft:broken" => false, 12 | "minecraft:damaged" => false, 13 | "minecraft:has_component" => false, 14 | "minecraft:fishing_rod/cast" => false, 15 | "minecraft:bundle/has_selected_item" => false, 16 | "minecraft:selected" => false, 17 | "minecraft:carried" => false, 18 | "minecraft:extended_view" => false, 19 | "minecraft:keybind_down" => false, 20 | "minecraft:view_entity" => true, 21 | "minecraft:custom_model_data" => false, 22 | ]; 23 | 24 | /** 25 | * @param string $name 26 | * @param bool $value 27 | */ 28 | public function __construct( 29 | string $name, 30 | protected ?bool $value = null 31 | ) 32 | { 33 | parent::__construct($name); 34 | } 35 | 36 | /** 37 | * @inheritDoc 38 | */ 39 | public function get(stdClass $options): bool 40 | { 41 | if ($this->value !== null) { 42 | return $this->value; 43 | } 44 | return static::DEFAULT[$this->name] ?? false; 45 | } 46 | 47 | /** 48 | * @param bool|null $value 49 | * @return $this 50 | */ 51 | public function setValue(?bool $value): static 52 | { 53 | $this->value = $value; 54 | return $this; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Resource/AtlasSource/TextureSource/Permutations/PermutatedTextureInfo.php: -------------------------------------------------------------------------------- 1 | baseTextureLocator->getPath(); 19 | if (str_ends_with($path, ".png")) { 20 | $path = substr($path, 0, -4); 21 | } 22 | $this->locator = $this->baseTextureLocator->clone()->setPath($path . $this->separator . $this->suffix); 23 | } 24 | 25 | /** 26 | * @return ResourceLocator 27 | */ 28 | public function getBaseTextureLocator(): ResourceLocator 29 | { 30 | return $this->baseTextureLocator; 31 | } 32 | 33 | /** 34 | * @return ResourceLocator 35 | */ 36 | public function getPermutationLocator(): ResourceLocator 37 | { 38 | return $this->permutationLocator; 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | public function getSuffix(): string 45 | { 46 | return $this->suffix; 47 | } 48 | 49 | /** 50 | * @return ResourceLocator 51 | */ 52 | public function getLocator(): ResourceLocator 53 | { 54 | return $this->locator; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/breeze.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [32, 32], 5 | "textures": { 6 | "0": "entity/breeze/breeze", 7 | "1": "entity/breeze/breeze_eyes" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [4, 4, 4], 12 | "to": [12, 12, 12], 13 | "faces": { 14 | "north": {"uv": [4, 4, 8, 8], "texture": "#0"}, 15 | "east": {"uv": [0, 4, 4, 8], "texture": "#0"}, 16 | "south": {"uv": [12, 4, 16, 8], "texture": "#0"}, 17 | "west": {"uv": [8, 4, 12, 8], "texture": "#0"}, 18 | "up": {"uv": [4, 0, 8, 4], "rotation": 180, "texture": "#0"}, 19 | "down": {"uv": [8, 0, 12, 4], "texture": "#0"} 20 | } 21 | }, 22 | { 23 | "from": [4, 4, 4], 24 | "to": [12, 12, 12], 25 | "shade": false, 26 | "faces": { 27 | "north": {"uv": [4, 4, 8, 8], "texture": "#1"}, 28 | "east": {"uv": [0, 4, 4, 8], "texture": "#1"}, 29 | "south": {"uv": [12, 4, 16, 8], "texture": "#1"}, 30 | "west": {"uv": [8, 4, 12, 8], "texture": "#1"}, 31 | "up": {"uv": [4, 0, 8, 4], "rotation": 180, "texture": "#1"}, 32 | "down": {"uv": [8, 0, 12, 4], "texture": "#1"} 33 | } 34 | }, 35 | { 36 | "from": [3, 6, 3.75], 37 | "to": [13, 9, 7.75], 38 | "shade": false, 39 | "faces": { 40 | "north": {"uv": [4, 14, 9, 15.5], "texture": "#1"}, 41 | "east": {"uv": [2, 14, 4, 15.5], "texture": "#1"}, 42 | "south": {"uv": [11, 14, 16, 15.5], "texture": "#1"}, 43 | "west": {"uv": [9, 14, 11, 15.5], "texture": "#1"}, 44 | "up": {"uv": [4, 12, 9, 14], "rotation": 180, "texture": "#1"}, 45 | "down": {"uv": [9, 12, 14, 14], "texture": "#1"} 46 | } 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/base/villager.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 64], 5 | "elements": [ 6 | { 7 | "from": [4, 2.75, 4], 8 | "to": [12, 12.75, 12], 9 | "faces": { 10 | "north": {"uv": [2, 2, 4, 4.5], "texture": "#texture"}, 11 | "east": {"uv": [0, 2, 2, 4.5], "texture": "#texture"}, 12 | "south": {"uv": [6, 2, 8, 4.5], "texture": "#texture"}, 13 | "west": {"uv": [4, 2, 6, 4.5], "texture": "#texture"}, 14 | "up": {"uv": [2, 0, 4, 2], "rotation": 180, "texture": "#texture"}, 15 | "down": {"uv": [4, 0, 6, 2], "texture": "#texture"} 16 | } 17 | }, 18 | { 19 | "from": [3.5, 2.25, 3.5], 20 | "to": [12.5, 13.25, 12.5], 21 | "faces": { 22 | "north": {"uv": [10, 2, 12, 4.5], "texture": "#texture"}, 23 | "east": {"uv": [8, 2, 10, 4.5], "texture": "#texture"}, 24 | "south": {"uv": [14, 2, 16, 4.5], "texture": "#texture"}, 25 | "west": {"uv": [12, 2, 14, 4.5], "texture": "#texture"}, 26 | "up": {"uv": [10, 0, 12, 2], "rotation": 180, "texture": "#texture"}, 27 | "down": {"uv": [12, 0, 14, 2], "texture": "#texture"} 28 | } 29 | }, 30 | { 31 | "from": [7, 1.75, 2], 32 | "to": [9, 5.75, 4], 33 | "faces": { 34 | "north": {"uv": [6.5, 0.5, 7, 1.5], "texture": "#texture"}, 35 | "east": {"uv": [6, 0.5, 6.5, 1.5], "texture": "#texture"}, 36 | "south": {"uv": [7.5, 0.5, 8, 1.5], "texture": "#texture"}, 37 | "west": {"uv": [7, 0.5, 7.5, 1.5], "texture": "#texture"}, 38 | "up": {"uv": [6.5, 0, 7, 0.5], "rotation": 180, "texture": "#texture"}, 39 | "down": {"uv": [7, 0, 7.5, 0.5], "texture": "#texture"} 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /src/Output/CSS/PropertyListEntry.php: -------------------------------------------------------------------------------- 1 | $value) { 23 | $this->setProperty($name, $value); 24 | } 25 | return $this; 26 | } 27 | 28 | /** 29 | * @return array 30 | */ 31 | public function getProperties(): array 32 | { 33 | return $this->properties; 34 | } 35 | 36 | /** 37 | * @param string $name 38 | * @param string|int|float $value 39 | * @return $this 40 | */ 41 | public function setProperty(string $name, string|int|float $value): static 42 | { 43 | $this->properties[$name] = strval($value); 44 | return $this; 45 | } 46 | 47 | /** 48 | * @param string $selector 49 | * @return $this 50 | */ 51 | public function setSelector(string $selector): static 52 | { 53 | $this->selector = $selector; 54 | return $this; 55 | } 56 | 57 | /** 58 | * @inheritDoc 59 | */ 60 | protected function getContent(): string 61 | { 62 | $res = []; 63 | foreach ($this->properties as $name => $value) { 64 | $res[] = $name . ": " . $value . ";"; 65 | } 66 | return implode("\n", $res); 67 | } 68 | 69 | /** 70 | * @inheritDoc 71 | */ 72 | protected function getSelector(): string 73 | { 74 | return $this->selector; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/Constants.php: -------------------------------------------------------------------------------- 1 | resourceManager->getTexture($this->getColorMap()); 31 | $mapImage = $map->getImage(); 32 | $width = $mapImage->getImageWidth(); 33 | $height = $mapImage->getImageHeight(); 34 | $x = floor($this->sampleX * $width); 35 | $y = floor($this->sampleY * $height); 36 | 37 | $index = $y * $width + $x; 38 | if ($index < 0 || $index >= $width * $height) { 39 | return new ImagickPixel("#ff00ff"); 40 | } 41 | 42 | $x = floor($index % $width); 43 | $y = intdiv($index, $width); 44 | 45 | return $mapImage->getImagePixelColor($x, $y); 46 | } 47 | 48 | /** 49 | * @param float $x 50 | * @param float $y 51 | * @return $this 52 | */ 53 | public function setSamplePosition(float $x, float $y): static 54 | { 55 | $this->sampleX = $x; 56 | $this->sampleY = $y; 57 | return $this; 58 | } 59 | 60 | /** 61 | * @return ResourceLocator 62 | */ 63 | abstract protected function getColorMap(): ResourceLocator; 64 | } 65 | -------------------------------------------------------------------------------- /builtin/renderchest/models/item/decorated_pot.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "renderchest:item/decorated_pot_base", 4 | "elements": [ 5 | { 6 | "from": [1, 0, 1], 7 | "to": [15, 16, 15], 8 | "faces": { 9 | "up": {"uv": [0, 6.5, 7, 13.5], "texture": "#base"}, 10 | "down": {"uv": [7, 6.5, 14, 13.5], "texture": "#base"} 11 | } 12 | }, 13 | { 14 | "from": [4, 17, 4], 15 | "to": [12, 20, 12], 16 | "faces": { 17 | "north": {"uv": [4, 4, 8, 5.5], "texture": "#base"}, 18 | "east": {"uv": [0, 4, 4, 5.5], "texture": "#base"}, 19 | "south": {"uv": [12, 4, 16, 5.5], "texture": "#base"}, 20 | "west": {"uv": [8, 4, 12, 5.5], "texture": "#base"}, 21 | "up": {"uv": [4, 0, 8, 4], "texture": "#base"}, 22 | "down": {"uv": [8, 0, 12, 4], "texture": "#base"} 23 | } 24 | }, 25 | { 26 | "from": [5, 16, 5], 27 | "to": [11, 17, 11], 28 | "faces": { 29 | "north": {"uv": [3, 5.5, 6, 6], "texture": "#base"}, 30 | "east": {"uv": [0, 5.5, 3, 6], "texture": "#base"}, 31 | "south": {"uv": [9, 5.5, 12, 6], "texture": "#base"}, 32 | "west": {"uv": [6, 5.5, 9, 6], "texture": "#base"} 33 | } 34 | }, 35 | { 36 | "name": "north3", 37 | "from": [1, 0, 1], 38 | "to": [15, 16, 1], 39 | "color": 4, 40 | "faces": { 41 | "north": {"uv": [0, 0, 7, 8], "texture": "#north"} 42 | } 43 | }, 44 | { 45 | "name": "south1", 46 | "from": [1, 0, 15], 47 | "to": [15, 16, 15], 48 | "faces": { 49 | "south": {"uv": [1, 0, 15, 16], "texture": "#south"} 50 | } 51 | }, 52 | { 53 | "name": "west0", 54 | "from": [1, 0, 1], 55 | "to": [1, 16, 15], 56 | "faces": { 57 | "west": {"uv": [1, 0, 15, 16], "texture": "#west"} 58 | } 59 | }, 60 | { 61 | "name": "east2", 62 | "from": [15, 0, 1], 63 | "to": [15, 16, 15], 64 | "faces": { 65 | "east": {"uv": [1, 0, 15, 16], "texture": "#east"} 66 | } 67 | } 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /src/Resource/Item/Properties/Properties.php: -------------------------------------------------------------------------------- 1 | set(new LocalTimeProperty()); 25 | } 26 | 27 | /** 28 | * @param Property $property 29 | * @return $this 30 | */ 31 | public function set(Property $property): static 32 | { 33 | $name = $property->getName(); 34 | if ($property instanceof ConditionProperty) { 35 | $this->conditionProperties[$name] = $property; 36 | } elseif ($property instanceof NumberProperty) { 37 | $this->numberProperties[$name] = $property; 38 | } elseif ($property instanceof StringProperty) { 39 | $this->stringProperties[$name] = $property; 40 | } 41 | return $this; 42 | } 43 | 44 | /** 45 | * @param string $name 46 | * @return ConditionProperty 47 | */ 48 | public function getCondition(string $name): ConditionProperty 49 | { 50 | return $this->conditionProperties[$name] ?? new ConditionProperty($name); 51 | } 52 | 53 | /** 54 | * @param string $name 55 | * @return NumberProperty 56 | */ 57 | public function getNumber(string $name): NumberProperty 58 | { 59 | return $this->numberProperties[$name] ?? new NumberProperty($name); 60 | } 61 | 62 | /** 63 | * @param string $name 64 | * @return StringProperty 65 | */ 66 | public function getString(string $name): StringProperty 67 | { 68 | return $this->stringProperties[$name] ?? new StringProperty($name); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/Resource/ResourceManagerInterface.php: -------------------------------------------------------------------------------- 1 | assets); 38 | $locator = ResourceLocator::parse($this->itemName); 39 | $key = strval($locator); 40 | 41 | try { 42 | $item = $resourceManager->getItem($locator); 43 | } catch (ItemResolutionException) { 44 | return null; 45 | } 46 | 47 | try { 48 | $out = $item->render($this->size * $this->quality, $this->size * $this->quality); 49 | } catch (TextureResolutionException) { 50 | return null; 51 | } 52 | 53 | if ($this->quality !== 1) { 54 | foreach ($out as $frame) { 55 | $frame->resizeImage($this->size, $this->size, Imagick::FILTER_BOX, 1); 56 | } 57 | } 58 | 59 | Item::writeImageFile($out, $key, $this->format, $this->output, $this->createPngFallback); 60 | return $key; 61 | } 62 | 63 | /** 64 | * @return string 65 | */ 66 | #[OnBoth] public function getItemName(): string 67 | { 68 | return $this->itemName; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /builtin/renderchest/models/item/banner.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "minecraft:item/template_banner", 4 | "texture_size": [64, 64], 5 | "textures": { 6 | "texture": "entity/banner_base" 7 | }, 8 | "elements": [ 9 | { 10 | "name": "base", 11 | "from": [7.3334, 0.0008, 7.3334], 12 | "to": [8.6666, 27.998, 8.6666], 13 | "rotation": {"angle": 0, "axis": "y", "origin": [8, 27.998, 8]}, 14 | "faces": { 15 | "north": {"uv": [12.5, 0.5, 13, 11], "texture": "#texture"}, 16 | "east": {"uv": [12, 0.5, 12.5, 11], "texture": "#texture"}, 17 | "south": {"uv": [11.5, 0.5, 12, 11], "texture": "#texture"}, 18 | "west": {"uv": [11, 0.5, 11.5, 11], "texture": "#texture"}, 19 | "up": {"uv": [11.5, 0, 12, 0.5], "texture": "#texture"}, 20 | "down": {"uv": [12, 0, 12.5, 0.5], "rotation": 180, "texture": "#texture"} 21 | } 22 | }, 23 | { 24 | "from": [1.334, 2.6672, 8.6666], 25 | "to": [14.666, 29.3312, 9.3332], 26 | "rotation": {"angle": 0, "axis": "y", "origin": [8, 27.998, 8]}, 27 | "faces": { 28 | "north": {"uv": [5.5, 0.25, 10.5, 10.25], "texture": "#texture", "tintindex": 0}, 29 | "east": {"uv": [5.25, 0.25, 5.5, 10.25], "texture": "#texture", "tintindex": 0}, 30 | "south": {"uv": [0.25, 0.25, 5.25, 10.25], "texture": "#texture", "tintindex": 0}, 31 | "west": {"uv": [0, 0.25, 0.25, 10.25], "texture": "#texture", "tintindex": 0}, 32 | "up": {"uv": [0.25, 0, 5.25, 0.25], "texture": "#texture", "tintindex": 0}, 33 | "down": {"uv": [5.25, 0, 10.25, 0.25], "rotation": 180, "texture": "#texture", "tintindex": 0} 34 | } 35 | }, 36 | { 37 | "from": [1.334, 27.998, 7.3334], 38 | "to": [14.666, 29.3312, 8.6666], 39 | "rotation": {"angle": 0, "axis": "y", "origin": [8, 27.998, 8]}, 40 | "faces": { 41 | "north": {"uv": [6, 11, 11, 11.5], "texture": "#texture"}, 42 | "east": {"uv": [5.5, 11, 6, 11.5], "texture": "#texture"}, 43 | "south": {"uv": [0.5, 11, 5.5, 11.5], "texture": "#texture"}, 44 | "west": {"uv": [0, 11, 0.5, 11.5], "texture": "#texture"}, 45 | "up": {"uv": [0.5, 10.5, 5.5, 11], "texture": "#texture"}, 46 | "down": {"uv": [5.5, 10.5, 10.5, 11], "rotation": 180, "texture": "#texture"} 47 | } 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /src/Resource/DynamicResources/ArmorTrimModelGenerator.php: -------------------------------------------------------------------------------- 1 | models !== null) { 30 | return; 31 | } 32 | $this->models = []; 33 | foreach (Constants::ARMOR_ITEM_TYPES as $type) { 34 | foreach (Constants::TRIM_MATERIALS as $trimMaterial) { 35 | $this->models[] = $type . "_trim_" . $trimMaterial; 36 | if (in_array($trimMaterial, Constants::TRIM_DARKER_MATERIALS)) { 37 | $this->models[] = $type . "_trim_" . $trimMaterial . "_darker"; 38 | } 39 | } 40 | } 41 | } 42 | 43 | /** 44 | * @inheritDoc 45 | */ 46 | public function getAllItems(string $namespace): array 47 | { 48 | $this->initializeModels(); 49 | $items = []; 50 | foreach ($this->models as $model) { 51 | $items[] = strval(new ResourceLocator(static::getNamespace(), $model)); 52 | } 53 | return $items; 54 | } 55 | 56 | /** 57 | * @inheritDoc 58 | */ 59 | public function getModel(ResourceLocator $locator): ModelInterface 60 | { 61 | $model = new GeneratedItem(); 62 | try { 63 | $model->getTextures()->set("layer0", "minecraft:trims/items/" . $locator->getPath(), $this->resourceManager); 64 | } catch (Exception $e) { 65 | throw new ModelResolutionException("Cannot resolve model locator " . $locator, 0, $e); 66 | } 67 | return $model; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/base/cow.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 64], 5 | "elements": [ 6 | { 7 | "from": [4, 4, 5], 8 | "to": [12, 12, 11], 9 | "faces": { 10 | "north": {"uv": [1.5, 1.5, 3.5, 3.5], "texture": "#texture"}, 11 | "east": {"uv": [0, 1.5, 1.5, 3.5], "texture": "#texture"}, 12 | "south": {"uv": [5, 1.5, 7, 3.5], "texture": "#texture"}, 13 | "west": {"uv": [3.5, 1.5, 5, 3.5], "texture": "#texture"}, 14 | "up": {"uv": [1.5, 0, 3.5, 1.5], "rotation": 180, "texture": "#texture"}, 15 | "down": {"uv": [3.5, 0, 5.5, 1.5], "texture": "#texture"} 16 | } 17 | }, 18 | { 19 | "from": [3, 10, 7], 20 | "to": [4, 13, 8], 21 | "faces": { 22 | "north": {"uv": [5.75, 0.25, 6, 1], "texture": "#texture"}, 23 | "east": {"uv": [5.5, 0.25, 5.75, 1], "texture": "#texture"}, 24 | "south": {"uv": [6.25, 0.25, 6.5, 1], "texture": "#texture"}, 25 | "west": {"uv": [6, 0.25, 6.25, 1], "texture": "#texture"}, 26 | "up": {"uv": [5.75, 0, 6, 0.25], "texture": "#texture"}, 27 | "down": {"uv": [6, 0, 6.25, 0.25], "texture": "#texture"} 28 | } 29 | }, 30 | { 31 | "from": [12, 10, 7], 32 | "to": [13, 13, 8], 33 | "faces": { 34 | "north": {"uv": [5.75, 0.25, 6, 1], "texture": "#texture"}, 35 | "east": {"uv": [5.5, 0.25, 5.75, 1], "texture": "#texture"}, 36 | "south": {"uv": [6.25, 0.25, 6.5, 1], "texture": "#texture"}, 37 | "west": {"uv": [6, 0.25, 6.25, 1], "texture": "#texture"}, 38 | "up": {"uv": [5.75, 0, 6, 0.25], "texture": "#texture"}, 39 | "down": {"uv": [6, 0, 6.25, 0.25], "texture": "#texture"} 40 | } 41 | }, 42 | { 43 | "from": [5, 4, 4], 44 | "to": [11, 7, 6], 45 | "rotation": {"angle": 0, "axis": "y", "origin": [5, 4, 4]}, 46 | "faces": { 47 | "north": {"uv": [0.5, 8.5, 2, 9.25], "texture": "#texture"}, 48 | "east": {"uv": [0, 8.5, 0.5, 9.25], "texture": "#texture"}, 49 | "south": {"uv": [2.5, 8.5, 4, 9.25], "texture": "#texture"}, 50 | "west": {"uv": [2, 8.5, 2.5, 9.25], "texture": "#texture"}, 51 | "up": {"uv": [0.5, 8, 2, 8.5], "rotation": 180, "texture": "#texture"}, 52 | "down": {"uv": [2, 8, 3.5, 8.5], "texture": "#texture"} 53 | } 54 | } 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /src/Resource/Texture/TextureList.php: -------------------------------------------------------------------------------- 1 | getTexture(ResourceLocator::parse($ref)); 32 | } 33 | $this->textures[$name] = $texture; 34 | return $this; 35 | } 36 | 37 | /** 38 | * @param string $name 39 | * @return TextureInterface 40 | * @throws TextureResolutionException 41 | */ 42 | public function get(string $name): TextureInterface 43 | { 44 | if (str_starts_with($name, "#")) { 45 | $name = substr($name, 1); 46 | } 47 | if (!isset($this->textures[$name])) { 48 | throw new TextureResolutionException("Unknown texture '" . $name . "'"); 49 | } 50 | return $this->textures[$name]; 51 | } 52 | 53 | /** 54 | * @param string $name 55 | * @return TextureInterface 56 | * @throws Exception 57 | */ 58 | public function getResolvable(string $name): TextureInterface 59 | { 60 | if (str_starts_with($name, "#")) { 61 | $name = substr($name, 1); 62 | } 63 | return new ResolvableTexture($this, $name); 64 | } 65 | 66 | /** 67 | * @return TextureInterface[] 68 | */ 69 | public function getAll(): array 70 | { 71 | return $this->textures; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/wolf.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 32], 5 | "textures": { 6 | "0": "minecraft:entity/wolf/wolf" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4.1, 2.5, 7.1], 11 | "to": [11.9, 10.3, 12.3], 12 | "rotation": {"angle": 0, "axis": "y", "origin": [-2.4, 0, -2.4]}, 13 | "faces": { 14 | "north": {"uv": [1, 2, 2.5, 5], "texture": "#0"}, 15 | "east": {"uv": [0, 2, 1, 5], "texture": "#0"}, 16 | "south": {"uv": [3.5, 2, 5, 5], "texture": "#0"}, 17 | "west": {"uv": [2.5, 2, 3.5, 5], "texture": "#0"}, 18 | "up": {"uv": [1, 0, 2.5, 2], "rotation": 180, "texture": "#0"}, 19 | "down": {"uv": [2.5, 0, 4, 2], "texture": "#0"} 20 | } 21 | }, 22 | { 23 | "from": [6.05, 2.5, 3.2], 24 | "to": [9.95, 6.4, 7.1], 25 | "rotation": {"angle": 0, "axis": "y", "origin": [-2.4, 0, -2.4]}, 26 | "faces": { 27 | "north": {"uv": [1, 7, 1.75, 8.5], "texture": "#0"}, 28 | "east": {"uv": [0.25, 7, 1, 8.5], "texture": "#0"}, 29 | "west": {"uv": [1.75, 7, 2.5, 8.5], "texture": "#0"}, 30 | "up": {"uv": [1, 5.5, 1.75, 7], "rotation": 180, "texture": "#0"}, 31 | "down": {"uv": [1.75, 5.5, 2.5, 7], "texture": "#0"} 32 | } 33 | }, 34 | { 35 | "from": [4.1, 10.3, 9.7], 36 | "to": [6.7, 12.9, 11], 37 | "rotation": {"angle": 0, "axis": "y", "origin": [-2.4, 0, -2.4]}, 38 | "faces": { 39 | "north": {"uv": [4.25, 7.5, 4.75, 8.5], "texture": "#0"}, 40 | "east": {"uv": [4, 7.5, 4.25, 8.5], "texture": "#0"}, 41 | "south": {"uv": [5, 7.5, 5.5, 8.5], "texture": "#0"}, 42 | "west": {"uv": [4.75, 7.5, 5, 8.5], "texture": "#0"}, 43 | "up": {"uv": [4.25, 7, 4.75, 7.5], "rotation": 180, "texture": "#0"} 44 | } 45 | }, 46 | { 47 | "from": [9.3, 10.3, 9.7], 48 | "to": [11.9, 12.9, 11], 49 | "rotation": {"angle": 0, "axis": "y", "origin": [-2.4, 0, -2.4]}, 50 | "faces": { 51 | "north": {"uv": [4.25, 7.5, 4.75, 8.5], "texture": "#0"}, 52 | "east": {"uv": [4, 7.5, 4.25, 8.5], "texture": "#0"}, 53 | "south": {"uv": [5, 7.5, 5.5, 8.5], "texture": "#0"}, 54 | "west": {"uv": [4.75, 7.5, 5, 8.5], "texture": "#0"}, 55 | "up": {"uv": [4.25, 7, 4.75, 7.5], "rotation": 180, "texture": "#0"} 56 | } 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /src/Resource/AtlasSource/TextureSource/UnstitchAtlasTextureSource.php: -------------------------------------------------------------------------------- 1 | getSpriteInfo($locator); 21 | if ($sprite === null) { 22 | return null; 23 | } 24 | return parent::getTextureLocator(ResourceLocator::parse($this->settings->resource, $this->namespace)); 25 | } 26 | 27 | /** 28 | * @param ResourceLocator $locator 29 | * @return stdClass|null 30 | * @throws Exception 31 | */ 32 | protected function getSpriteInfo(ResourceLocator $locator): ?stdClass 33 | { 34 | foreach ($this->settings->regions as $region) { 35 | if ($locator->is(ResourceLocator::parse($region->sprite, $this->namespace))) { 36 | return $region; 37 | } 38 | } 39 | return null; 40 | } 41 | 42 | /** 43 | * @inheritDoc 44 | */ 45 | public function getTexture(ResourceLocator $locator): TextureInterface 46 | { 47 | $texture = parent::getTexture($locator); 48 | $spriteInfo = $this->getSpriteInfo($locator); 49 | $image = clone $texture->getImage(); 50 | 51 | $divisorX = $this->settings->divisor_x; 52 | $divisorY = $this->settings->divisor_y; 53 | $baseWidth = $image->getImageWidth(); 54 | $baseHeight = $image->getImageWidth(); 55 | 56 | $image->cropImage( 57 | round($spriteInfo->width / $divisorX * $baseWidth), 58 | round($spriteInfo->height / $divisorY * $baseHeight), 59 | round($spriteInfo->x / $divisorX * $baseWidth), 60 | round($spriteInfo->y / $divisorY * $baseHeight) 61 | ); 62 | 63 | return new ImagickTexture($image, new TextureMeta()); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Output/Item.php: -------------------------------------------------------------------------------- 1 | setFormat($format); 33 | $image->setOption('webp:lossless', 'true'); 34 | 35 | $path = $output . "/" . static::getItemImageFilePath($locator, $format); 36 | if (!file_exists(dirname($path))) { 37 | @mkdir(dirname($path), recursive: true); 38 | } 39 | $image->writeImages($path, true); 40 | 41 | if ($createPngFallback) { 42 | $image->setFormat("png"); 43 | file_put_contents($output . "/" . static::getItemImageFilePath($locator, "png"), $image); 44 | } 45 | } 46 | 47 | /** 48 | * @param string $locator 49 | * @param ItemLibraryGenerator $generator 50 | */ 51 | public function __construct( 52 | protected string $locator, 53 | protected ItemLibraryGenerator $generator 54 | ) 55 | { 56 | } 57 | 58 | /** 59 | * @param string|null $format 60 | * @return string 61 | */ 62 | public function getImageFilePath(?string $format = null): string 63 | { 64 | return static::getItemImageFilePath($this->locator, $format ?? $this->generator->getFormat()); 65 | } 66 | 67 | /** 68 | * @return string 69 | */ 70 | public function getLocator(): string 71 | { 72 | return $this->locator; 73 | } 74 | 75 | /** 76 | * @return ItemLibraryGenerator 77 | */ 78 | public function getGenerator(): ItemLibraryGenerator 79 | { 80 | return $this->generator; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /builtin/mobheads/models/item/endermite.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "parent": "mobheads:item/base/head_display", 4 | "texture_size": [64, 32], 5 | "textures": { 6 | "texture": "minecraft:entity/endermite" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [4.6, 4.7, 1.25], 11 | "to": [11.4, 9.8, 4.65], 12 | "rotation": {"angle": 0, "axis": "y", "origin": [-5.6, -5.5, -5.6]}, 13 | "faces": { 14 | "north": {"uv": [0.5, 1, 1.5, 2.5], "texture": "#texture"}, 15 | "east": {"uv": [0, 1, 0.5, 2.5], "texture": "#texture"}, 16 | "west": {"uv": [1.5, 1, 2, 2.5], "texture": "#texture"}, 17 | "up": {"uv": [0.5, 0, 1.5, 1], "texture": "#texture"}, 18 | "down": {"uv": [1.5, 0, 2.5, 1], "texture": "#texture"} 19 | } 20 | }, 21 | { 22 | "from": [2.9, 4.7, 4.65], 23 | "to": [13.1, 11.5, 13.15], 24 | "rotation": {"angle": 0, "axis": "y", "origin": [-5.6, -5.5, -5.6]}, 25 | "faces": { 26 | "north": {"uv": [1.25, 5, 2.75, 7], "texture": "#texture"}, 27 | "east": {"uv": [0, 5, 1.25, 7], "texture": "#texture"}, 28 | "south": {"uv": [4, 5, 5.5, 7], "texture": "#texture"}, 29 | "west": {"uv": [2.75, 5, 4, 7], "texture": "#texture"}, 30 | "up": {"uv": [1.25, 2.5, 2.75, 5], "texture": "#texture"}, 31 | "down": {"uv": [2.75, 2.5, 4.25, 5], "texture": "#texture"} 32 | } 33 | }, 34 | { 35 | "from": [5.45, 4.7, 13.15], 36 | "to": [10.55, 9.8, 14.85], 37 | "rotation": {"angle": 0, "axis": "y", "origin": [-5.6, -5.5, -5.6]}, 38 | "faces": { 39 | "east": {"uv": [0, 7.5, 0.25, 9], "texture": "#texture"}, 40 | "south": {"uv": [1.25, 7.5, 2, 9], "texture": "#texture"}, 41 | "west": {"uv": [1, 7.5, 1.25, 9], "texture": "#texture"}, 42 | "up": {"uv": [0.25, 7, 1, 7.5], "texture": "#texture"}, 43 | "down": {"uv": [1, 7, 1.75, 7.5], "texture": "#texture"} 44 | } 45 | }, 46 | { 47 | "from": [7.15, 4.7, 14.85], 48 | "to": [8.85, 8.1, 16.55], 49 | "rotation": {"angle": 0, "axis": "y", "origin": [-5.6, -5.5, -5.6]}, 50 | "faces": { 51 | "east": {"uv": [0, 9.5, 0.25, 10.5], "texture": "#texture"}, 52 | "south": {"uv": [0.75, 9.5, 1, 10.5], "texture": "#texture"}, 53 | "west": {"uv": [0.5, 9.5, 0.75, 10.5], "texture": "#texture"}, 54 | "up": {"uv": [0.25, 9, 0.5, 9.5], "texture": "#texture"}, 55 | "down": {"uv": [0.5, 9, 0.75, 9.5], "texture": "#texture"} 56 | } 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /builtin/renderchest/models/item/decorated_pot_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": { 3 | "brick": "minecraft:entity/decorated_pot/decorated_pot_side", 4 | "angler_pottery_sherd": "minecraft:entity/decorated_pot/angler_pottery_pattern", 5 | "heartbreak_pottery_sherd": "minecraft:entity/decorated_pot/heartbreak_pottery_pattern", 6 | "archer_pottery_sherd": "minecraft:entity/decorated_pot/archer_pottery_pattern", 7 | "heart_pottery_sherd": "minecraft:entity/decorated_pot/heart_pottery_pattern", 8 | "arms_up_pottery_sherd": "minecraft:entity/decorated_pot/arms_up_pottery_pattern", 9 | "howl_pottery_sherd": "minecraft:entity/decorated_pot/howl_pottery_pattern", 10 | "blade_pottery_sherd": "minecraft:entity/decorated_pot/blade_pottery_pattern", 11 | "miner_pottery_sherd": "minecraft:entity/decorated_pot/miner_pottery_pattern", 12 | "brewer_pottery_sherd": "minecraft:entity/decorated_pot/brewer_pottery_pattern", 13 | "mourner_pottery_sherd": "minecraft:entity/decorated_pot/mourner_pottery_pattern", 14 | "burn_pottery_sherd": "minecraft:entity/decorated_pot/burn_pottery_pattern", 15 | "plenty_pottery_sherd": "minecraft:entity/decorated_pot/plenty_pottery_pattern", 16 | "danger_pottery_sherd": "minecraft:entity/decorated_pot/danger_pottery_pattern", 17 | "prize_pottery_sherd": "minecraft:entity/decorated_pot/prize_pottery_pattern", 18 | "sheaf_pottery_sherd": "minecraft:entity/decorated_pot/sheaf_pottery_pattern", 19 | "shelter_pottery_sherd": "minecraft:entity/decorated_pot/shelter_pottery_pattern", 20 | "explorer_pottery_sherd": "minecraft:entity/decorated_pot/explorer_pottery_pattern", 21 | "skull_pottery_sherd": "minecraft:entity/decorated_pot/skull_pottery_pattern", 22 | "friend_pottery_sherd": "minecraft:entity/decorated_pot/friend_pottery_pattern", 23 | "snort_pottery_sherd": "minecraft:entity/decorated_pot/snort_pottery_pattern", 24 | "flow_pottery_sherd": "minecraft:entity/decorated_pot/flow_pottery_pattern", 25 | "guster_pottery_sherd": "minecraft:entity/decorated_pot/guster_pottery_pattern", 26 | "scrape_pottery_sherd": "minecraft:entity/decorated_pot/scrape_pottery_pattern", 27 | 28 | "base": "minecraft:entity/decorated_pot/decorated_pot_base" 29 | }, 30 | "gui_light": "side", 31 | "display": { 32 | "gui": { 33 | "rotation": [30, 45, 0], 34 | "scale": [0.625, 0.625, 0.625] 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Output/ItemStyle/MapItemStyleGenerator.php: -------------------------------------------------------------------------------- 1 | getLocator() === "minecraft:filled_map"; 23 | } 24 | 25 | /** 26 | * @inheritDoc 27 | */ 28 | public static function getGlobalStyles(ItemLibraryGenerator $generator): array 29 | { 30 | return []; 31 | } 32 | 33 | /** 34 | * @param bool $fallback 35 | * @return CSSEntry[] 36 | */ 37 | protected function getStyles(bool $fallback): array 38 | { 39 | $prefix = $this->item->getGenerator()->getPrefix(); 40 | return [ 41 | (new PropertyListEntry($this->getCssSelector())) 42 | ->setProperties([ 43 | "background-image" => $this->item->getGenerator()->getItemCSSUrl(static::BASE, $fallback), 44 | "-webkit-mask-image" => $this->item->getGenerator()->getItemCSSUrl(static::MASK, $fallback), 45 | "--" . $prefix . "layer-2-tint" => static::DEFAULT_MAP_COLOR 46 | ]), 47 | (new PropertyListEntry($this->getCssSelector() . ":before")) 48 | ->setProperties([ 49 | "background-image" => $this->item->getGenerator()->getItemCSSUrl(static::OVERLAY, $fallback), 50 | "-webkit-mask-image" => $this->item->getGenerator()->getItemCSSUrl(static::OVERLAY, $fallback), 51 | ]) 52 | ]; 53 | } 54 | 55 | /** 56 | * @inheritDoc 57 | */ 58 | public function getItemStyles(): array 59 | { 60 | return $this->getStyles(false); 61 | } 62 | 63 | /** 64 | * @inheritDoc 65 | */ 66 | public function getItemFallbackStyles(): array 67 | { 68 | return $this->getStyles(true); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/Model/LightSource.php: -------------------------------------------------------------------------------- 1 | normalize(), 0.18); 19 | } 20 | return static::$sideLight; 21 | } 22 | 23 | /** 24 | * @return static 25 | */ 26 | static function getFrontLight(): self 27 | { 28 | if (static::$frontLight === null) { 29 | static::$frontLight = new static(false, new Vector3(0, 0, 1), 1); 30 | } 31 | return static::$frontLight; 32 | } 33 | 34 | /** 35 | * @param bool $isActive 36 | * @param Vector3 $direction 37 | * @param float $baseLight 38 | */ 39 | public function __construct(protected bool $isActive, protected Vector3 $direction, protected float $baseLight) 40 | { 41 | } 42 | 43 | /** 44 | * @return bool 45 | */ 46 | public function isActive(): bool 47 | { 48 | return $this->isActive; 49 | } 50 | 51 | /** 52 | * @param bool $isActive 53 | * @return LightSource 54 | */ 55 | public function setIsActive(bool $isActive): LightSource 56 | { 57 | $this->isActive = $isActive; 58 | return $this; 59 | } 60 | 61 | /** 62 | * @return Vector3|null 63 | */ 64 | public function getDirection(): ?Vector3 65 | { 66 | return $this->direction; 67 | } 68 | 69 | /** 70 | * @param Vector3|null $direction 71 | * @return LightSource 72 | */ 73 | public function setDirection(?Vector3 $direction): LightSource 74 | { 75 | $this->direction = $direction; 76 | return $this; 77 | } 78 | 79 | /** 80 | * @return float 81 | */ 82 | public function getBaseLight(): float 83 | { 84 | return $this->baseLight; 85 | } 86 | 87 | /** 88 | * @param float $baseLight 89 | * @return LightSource 90 | */ 91 | public function setBaseLight(float $baseLight): LightSource 92 | { 93 | $this->baseLight = $baseLight; 94 | return $this; 95 | } 96 | } -------------------------------------------------------------------------------- /src/Output/ItemStyle/FireWorkStarItemStyleGenerator.php: -------------------------------------------------------------------------------- 1 | getLocator() === "minecraft:firework_star"; 23 | } 24 | 25 | /** 26 | * @inheritDoc 27 | */ 28 | public static function getGlobalStyles(ItemLibraryGenerator $generator): array 29 | { 30 | return []; 31 | } 32 | 33 | /** 34 | * @param bool $fallback 35 | * @return CSSEntry[] 36 | */ 37 | protected function getStyles(bool $fallback): array 38 | { 39 | $prefix = $this->item->getGenerator()->getPrefix(); 40 | return [ 41 | (new PropertyListEntry($this->getCssSelector())) 42 | ->setProperties([ 43 | "background-image" => $this->item->getGenerator()->getItemCSSUrl(static::BASE, $fallback), 44 | "-webkit-mask-image" => $this->item->getGenerator()->getItemCSSUrl(static::MASK, $fallback), 45 | "--" . $prefix . "layer-2-tint" => static::DEFAULT_COLOR 46 | ]), 47 | (new PropertyListEntry($this->getCssSelector() . ":before")) 48 | ->setProperties([ 49 | "background-image" => $this->item->getGenerator()->getItemCSSUrl(static::OVERLAY, $fallback), 50 | "-webkit-mask-image" => $this->item->getGenerator()->getItemCSSUrl(static::OVERLAY, $fallback), 51 | ]) 52 | ]; 53 | } 54 | 55 | /** 56 | * @inheritDoc 57 | */ 58 | public function getItemStyles(): array 59 | { 60 | return $this->getStyles(false); 61 | } 62 | 63 | /** 64 | * @inheritDoc 65 | */ 66 | public function getItemFallbackStyles(): array 67 | { 68 | return $this->getStyles(true); 69 | } 70 | } 71 | --------------------------------------------------------------------------------