From d7460b237efb1a203afec8b168b3a78b1ecd5d85 Mon Sep 17 00:00:00 2001 From: BluSunrize Date: Thu, 13 Jun 2024 13:32:14 +0200 Subject: [PATCH] Add the blueprint shelf, a block that can store up to 9 blueprints! --- changelog.md | 1 + .../data/blockstates/BlockStates.java | 33 +- .../data/tags/IEBlockTags.java | 1 + .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 3 +- .../619000d5325dea258e481d2612f9a5c790da2123 | 4 +- .../8861e8b56b8339d4437e7f8f8306e4a1ccd9b173 | 12 +- .../blockstates/blueprint_shelf.json | 588 ++++++++++++++++++ .../models/item/blueprint_shelf.json | 3 + .../loot_tables/blocks/blueprint_shelf.json | 21 + .../minecraft/tags/blocks/mineable/axe.json | 1 + .../common/blocks/IEBlockInterfaces.java | 6 +- .../common/blocks/PlacementLimitation.java | 4 + .../blocks/wooden/BlueprintShelfBlock.java | 60 ++ .../wooden/BlueprintShelfBlockEntity.java | 191 ++++++ .../common/register/IEBlockEntities.java | 3 + .../common/register/IEBlocks.java | 3 + .../immersiveengineering/lang/en_us.json | 1 + .../block/blueprint_shelf/blueprint_0.json | 22 + .../block/blueprint_shelf/blueprint_1.json | 21 + .../block/blueprint_shelf/blueprint_2.json | 21 + .../block/blueprint_shelf/blueprint_3.json | 21 + .../block/blueprint_shelf/blueprint_4.json | 21 + .../block/blueprint_shelf/blueprint_5.json | 21 + .../block/blueprint_shelf/blueprint_6.json | 21 + .../block/blueprint_shelf/blueprint_7.json | 21 + .../block/blueprint_shelf/blueprint_8.json | 21 + .../models/block/blueprint_shelf/frame.json | 197 ++++++ .../block/wooden_device/blueprint_roll.png | Bin 0 -> 157 bytes 28 files changed, 1308 insertions(+), 14 deletions(-) create mode 100644 src/generated/resources/assets/immersiveengineering/blockstates/blueprint_shelf.json create mode 100644 src/generated/resources/assets/immersiveengineering/models/item/blueprint_shelf.json create mode 100644 src/generated/resources/data/immersiveengineering/loot_tables/blocks/blueprint_shelf.json create mode 100644 src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlock.java create mode 100644 src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlockEntity.java create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_0.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_1.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_2.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_3.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_4.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_5.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_6.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_7.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_8.json create mode 100644 src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/frame.json create mode 100644 src/main/resources/assets/immersiveengineering/textures/block/wooden_device/blueprint_roll.png diff --git a/changelog.md b/changelog.md index e0a5eb4092..80969b6761 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ - Allow survey tools to be used on more blocks (voidsong-dragonfly) - Add cloche recipes for ferns and grass (voidsong-dragonfly) - Add crushing recipes for stone and deepslate (voidsong-dragonfly) +- Add the blueprint shelf, a block that can store up to 9 blueprints! (BluSunrize) - Fix crusher not accepting multiple stacks of the same ore (BluSunrize) - Fix stone multiblocks being washed away by water (BluSunrize) - Fix potential race condition with wires damaging entities (BluSunrize) diff --git a/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java b/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java index 389f1d8373..97673f179f 100644 --- a/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java +++ b/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java @@ -22,6 +22,7 @@ import blusunrize.immersiveengineering.common.blocks.metal.*; import blusunrize.immersiveengineering.common.blocks.metal.MetalLadderBlock.CoverType; import blusunrize.immersiveengineering.common.blocks.plant.HempBlock; +import blusunrize.immersiveengineering.common.blocks.wooden.BlueprintShelfBlock; import blusunrize.immersiveengineering.common.blocks.wooden.SawdustBlock; import blusunrize.immersiveengineering.common.blocks.wooden.TreatedWoodStyles; import blusunrize.immersiveengineering.common.register.IEBlocks.*; @@ -49,11 +50,8 @@ import net.minecraft.world.level.block.state.properties.Property; import net.minecraft.world.level.material.Fluid; import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; -import net.neoforged.neoforge.client.model.generators.BlockModelBuilder; -import net.neoforged.neoforge.client.model.generators.ConfiguredModel; -import net.neoforged.neoforge.client.model.generators.ModelFile; +import net.neoforged.neoforge.client.model.generators.*; import net.neoforged.neoforge.client.model.generators.ModelFile.ExistingModelFile; -import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder; import net.neoforged.neoforge.client.model.generators.loaders.CompositeModelBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; import org.apache.commons.lang3.mutable.Mutable; @@ -362,6 +360,33 @@ protected void registerStatesAndModels() simpleBlock(StoneDecoration.CONCRETE_SPRAYED.get(), obj("block/sprayed_concrete.obj", cutout())); createHorizontalRotatedBlock(WoodenDevices.CRAFTING_TABLE, obj("block/wooden_device/craftingtable.obj")); + { + MultiPartBlockStateBuilder multipartBuilder = getMultipartBuilder(WoodenDevices.BLUEPRINT_SHELF.get()); + for(Direction d : Direction.values()) + { + int rotX = d.getAxis()==Axis.Y?-90: 0; + int rotY = d.getAxis()==Axis.Y?0: getAngle(d, 180); + // add the frame + multipartBuilder.part() + .modelFile(models().getExistingFile(modLoc("block/blueprint_shelf/frame"))) + .rotationX(rotX) + .rotationY(rotY) + .addModel() + .condition(IEProperties.FACING_ALL, d) + .end(); + // add the blueprints + for(int i = 0; i < BlueprintShelfBlock.BLUEPRINT_SLOT_FILLED.length; i++) + multipartBuilder.part() + .modelFile(models().getExistingFile(modLoc("block/blueprint_shelf/blueprint_"+i))) + .rotationX(rotX) + .rotationY(rotY) + .addModel() + .condition(IEProperties.FACING_ALL, d) + .condition(BlueprintShelfBlock.BLUEPRINT_SLOT_FILLED[i], true) + .end(); + } + itemModel(WoodenDevices.BLUEPRINT_SHELF, models().getExistingFile(modLoc("block/blueprint_shelf/frame"))); + } cubeAll(WoodenDevices.CRATE, modLoc("block/wooden_device/crate")); cubeAll(WoodenDevices.REINFORCED_CRATE, modLoc("block/wooden_device/reinforced_crate")); { diff --git a/src/datagen/java/blusunrize/immersiveengineering/data/tags/IEBlockTags.java b/src/datagen/java/blusunrize/immersiveengineering/data/tags/IEBlockTags.java index 9dea594f1a..8a6342c9f6 100644 --- a/src/datagen/java/blusunrize/immersiveengineering/data/tags/IEBlockTags.java +++ b/src/datagen/java/blusunrize/immersiveengineering/data/tags/IEBlockTags.java @@ -339,6 +339,7 @@ private void registerAxeMineable() tag, WoodenDevices.CRAFTING_TABLE, WoodenDevices.WORKBENCH, + WoodenDevices.BLUEPRINT_SHELF, WoodenDevices.CIRCUIT_TABLE, WoodenDevices.GUNPOWDER_BARREL, WoodenDevices.WOODEN_BARREL, diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 44786304dc..3f82e228c6 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.20.4 2024-06-08T20:15:15.1327493 Loot Tables +// 1.20.4 2024-06-13T02:45:28.7756292 Loot Tables 75b6cfb9c9c9e099efa206255bb357c3ce17b802 data/immersiveengineering/loot_tables/advancements/shader_epic.json 6ac241971170fd9eb94669ba6fb44e37946e694c data/immersiveengineering/loot_tables/advancements/shader_masterwork.json 171edf84bfedad7b42d82bf64192615fe2172c67 data/immersiveengineering/loot_tables/advancements/shader_rare.json @@ -23,6 +23,7 @@ c30d60bf940fb7abcd398e3c89036693140d43a4 data/immersiveengineering/loot_tables/b 129a09d27a498d629382050d7bed1d7050f8c56f data/immersiveengineering/loot_tables/blocks/blastbrick_reinforced.json 6403d4f76dc81b1b319f972c19a16b2535e44c8f data/immersiveengineering/loot_tables/blocks/blastfurnace_preheater.json 86a4fb8dc0205e91a2e13d0cc14c23bf9e3c7e22 data/immersiveengineering/loot_tables/blocks/blast_furnace.json +68dc3df6b139089ea47eae759145db0fd37a5f54 data/immersiveengineering/loot_tables/blocks/blueprint_shelf.json 28d0b224d1aaf80c2fb62f1547844163ecd6526d data/immersiveengineering/loot_tables/blocks/bottling_machine.json 11040f25d84a797c85c4dd82d115a2a969dd18ff data/immersiveengineering/loot_tables/blocks/breaker_switch.json c4c697d3468c0a19f62e5882f76b2dfc93f02794 data/immersiveengineering/loot_tables/blocks/bucket_wheel.json diff --git a/src/generated/resources/.cache/619000d5325dea258e481d2612f9a5c790da2123 b/src/generated/resources/.cache/619000d5325dea258e481d2612f9a5c790da2123 index 7275832ceb..7b9dc535b2 100644 --- a/src/generated/resources/.cache/619000d5325dea258e481d2612f9a5c790da2123 +++ b/src/generated/resources/.cache/619000d5325dea258e481d2612f9a5c790da2123 @@ -1,4 +1,4 @@ -// 1.20.4 2024-06-08T20:15:15.1357496 Block States: immersiveengineering +// 1.20.4 2024-06-13T12:46:06.6055241 Block States: immersiveengineering 4c68c9f8b259aa39377c5dc7dc91979f52266b4e assets/immersiveengineering/blockstates/acetaldehyde_fluid_block.json 62840bb00a251db76f13a7006027e4fb82f42f91 assets/immersiveengineering/blockstates/alloybrick.json 1c3516f9e78d46bd772ab5bfbc902b042dd18f80 assets/immersiveengineering/blockstates/alu_fence.json @@ -12,6 +12,7 @@ cc0bc74c05c6cd963198fa003e57a573e2c6127d assets/immersiveengineering/blockstates 638b3bae5e7422448b042bed082d1dbb2cb99f20 assets/immersiveengineering/blockstates/biodiesel_fluid_block.json 24d6745d22e4cb22bc74c1dbaaa0f80e3ea41b7a assets/immersiveengineering/blockstates/blastbrick.json f4b0e6d2843e37c8653f000d2fd37771f1a46bfb assets/immersiveengineering/blockstates/blastbrick_reinforced.json +3b3e1e55b002f8ea1177eb73e04ff34298f71d2f assets/immersiveengineering/blockstates/blueprint_shelf.json 2ad245c0d6162f07b62e701da7da14c105af0413 assets/immersiveengineering/blockstates/bucket_wheel.json c4fbee7445819d640d8eaa40e87daf55f7722a00 assets/immersiveengineering/blockstates/capacitor_creative.json dc9d0d5ba7963e5514eb2004302b0f75d175747e assets/immersiveengineering/blockstates/capacitor_hv.json @@ -1105,6 +1106,7 @@ bdac5ec7f8ceda285338455cc325981312341772 assets/immersiveengineering/models/item 37393a27bfd5848daf4573ec2db0263df5af2d24 assets/immersiveengineering/models/item/alu_window.json b4d13563471d6e15a6115b7cc7ab2a5d41bb9e45 assets/immersiveengineering/models/item/blastbrick.json b2977285e58056a65b9a1011107c1e568a6f9007 assets/immersiveengineering/models/item/blastbrick_reinforced.json +e339ee1a2a2c5f5da2b418fa74e8370476b2f67e assets/immersiveengineering/models/item/blueprint_shelf.json 2ab4f3a4623aff3ed44126309a89b0ae5b1b9832 assets/immersiveengineering/models/item/capacitor_creative.json 2d9e4d6019ef1496a7a398f926ce44cd3d35ed3b assets/immersiveengineering/models/item/capacitor_hv.json 8f033322e8d3be3a17b7041d73a6275bd2d88598 assets/immersiveengineering/models/item/capacitor_lv.json diff --git a/src/generated/resources/.cache/8861e8b56b8339d4437e7f8f8306e4a1ccd9b173 b/src/generated/resources/.cache/8861e8b56b8339d4437e7f8f8306e4a1ccd9b173 index 6c03c77896..f7cce27de8 100644 --- a/src/generated/resources/.cache/8861e8b56b8339d4437e7f8f8306e4a1ccd9b173 +++ b/src/generated/resources/.cache/8861e8b56b8339d4437e7f8f8306e4a1ccd9b173 @@ -1,9 +1,8 @@ -// 1.20.4 2024-06-11T23:23:33.407974165 Tags for minecraft:block mod id immersiveengineering +// 1.20.4 2024-06-13T02:45:28.7826294 Tags for minecraft:block mod id immersiveengineering 23e0570e60d941c629a243d8c02fbf74523eee75 data/chiselsandbits/tags/blocks/chiselable/forced.json bb2e9cd3d85c96526d774c4c6023d900f99a15bc data/forge/tags/blocks/fences/aluminum.json c9ee95be2edb84e91278b0fef1cbc9dea336b664 data/forge/tags/blocks/fences/steel.json 798333dba3595d9304d05418ce04a44f69a7d6c1 data/forge/tags/blocks/gravel.json -03803ad3e358573f495ef5a2b28fff69483d9903 data/forge/tags/blocks/ore_rates/singular.json 096b05ce0e1511fdf1f849355b7214fd71c6727d data/forge/tags/blocks/ores.json 996364607181408578d2a18b0cd5941fe3251ffd data/forge/tags/blocks/ores/aluminum.json 2d5302798c26775d656807ac1d209b4b7430ff17 data/forge/tags/blocks/ores/lead.json @@ -12,9 +11,9 @@ c9ee95be2edb84e91278b0fef1cbc9dea336b664 data/forge/tags/blocks/fences/steel.jso e10e19eb1ecd0d4fbd2270995a9c4b14c981af49 data/forge/tags/blocks/ores/uranium.json ad7cc89e6b8ad6b0c7c3544c0abd3446c612060c data/forge/tags/blocks/ores_in_ground/deepslate.json 81467f7c9399b301ac496bf424b8c8b807db752a data/forge/tags/blocks/ores_in_ground/stone.json +03803ad3e358573f495ef5a2b28fff69483d9903 data/forge/tags/blocks/ore_rates/singular.json c0ba8fbc5bb958978c15dbbbf9109c2f235e20ec data/forge/tags/blocks/sandstone/colorless.json 6a91d4acdb80541d81cbf2ccc3347b0749b64363 data/forge/tags/blocks/sandstone/red.json -f8407d8b86459d08f321ad472e23df8b11f04807 data/forge/tags/blocks/sheetmetal_slabs.json edecb36d2c51c53656e146c80bbf300e4d52de39 data/forge/tags/blocks/sheetmetals.json 685fe54ad50bcb90d1857662c38ad1e2e89bb8a6 data/forge/tags/blocks/sheetmetals/aluminum.json 208b8916c3964147d79703c1eb7096e8775aa78f data/forge/tags/blocks/sheetmetals/constantan.json @@ -27,6 +26,7 @@ ff543a6161432e4e8dd2bd8775ab99af16c0315c data/forge/tags/blocks/sheetmetals/nick bc8cb8d4f41333ae547eb75f529beb92a7a62dd9 data/forge/tags/blocks/sheetmetals/silver.json 44df194bae79ecbc6ba642f28825d7d55f640865 data/forge/tags/blocks/sheetmetals/steel.json 517af5879eee0eaacb6ec77424a19790f680f6bd data/forge/tags/blocks/sheetmetals/uranium.json +f8407d8b86459d08f321ad472e23df8b11f04807 data/forge/tags/blocks/sheetmetal_slabs.json c0afad8eab5f9b2dac5ccf01d9dbec3d9c080202 data/forge/tags/blocks/storage_blocks.json a252494dc3a9a5b9aab17e82ae7ff504ca84a099 data/forge/tags/blocks/storage_blocks/aluminum.json da1d12f678963493519caaff63a76241b220579f data/forge/tags/blocks/storage_blocks/clay.json @@ -57,12 +57,12 @@ cbf85412255d24b479f6ffd05374a23bb4e18d6f data/immersiveengineering/tags/blocks/m 7204f37efe73e4ab8e5d05aef0e7c1fc973a8771 data/immersiveengineering/tags/blocks/mineable/hammer.json 2c887477b8e0a8ee24392b29c8b0488279730574 data/immersiveengineering/tags/blocks/mineable/rockcutter.json 22c291dd8a303b2f6629a7430880a0678e679ac4 data/immersiveengineering/tags/blocks/mineable/wirecutter.json +586d8c57de0cdcef9e768494366ce79e22d75223 data/immersiveengineering/tags/blocks/scaffoldings/aluminum.json +8f3e0a730467c3941f6d1bc9e6c02d4dac7200f0 data/immersiveengineering/tags/blocks/scaffoldings/steel.json c3d387e89fbb8dfb53e5e91ad3b45e07f5202650 data/immersiveengineering/tags/blocks/scaffolding_slabs/aluminum.json 56c051f4ddf6a8bfb51631d88f7553d13e908a69 data/immersiveengineering/tags/blocks/scaffolding_slabs/steel.json b7ae6076dcdde66b8bd7c303e7f5ea5e58ba24f1 data/immersiveengineering/tags/blocks/scaffolding_stairs/aluminum.json 58bcbaec9e8e1403838cbc28eb4bae9fdfa0dc3d data/immersiveengineering/tags/blocks/scaffolding_stairs/steel.json -586d8c57de0cdcef9e768494366ce79e22d75223 data/immersiveengineering/tags/blocks/scaffoldings/aluminum.json -8f3e0a730467c3941f6d1bc9e6c02d4dac7200f0 data/immersiveengineering/tags/blocks/scaffoldings/steel.json 6e3f4f3271f5fb23cf7dbf161c0e3f5cff0cc0bf data/immersiveengineering/tags/blocks/survey_tool_targets.json 7719335563ce8d10e5dbd9d148c5be1d25ae89a5 data/immersiveengineering/tags/blocks/teleport_blocking.json 9acd1b4c75ce6ff1914c8b9852a3e6d29bb85403 data/minecraft/tags/blocks/azalea_root_replaceable.json @@ -72,7 +72,7 @@ b7ae6076dcdde66b8bd7c303e7f5ea5e58ba24f1 data/immersiveengineering/tags/blocks/s a2a8f45efe8798f97765aeee47cf9da51ffd3c30 data/minecraft/tags/blocks/dead_bush_may_place_on.json 0511dcf97836e0d1cc478ba194d697cc75d7c5fc data/minecraft/tags/blocks/fences.json 1e227ef3a7c211db28ed17222728fdae19bba054 data/minecraft/tags/blocks/flower_pots.json -117ee5563fdc984a5105b6733e4639ea13d8d847 data/minecraft/tags/blocks/mineable/axe.json +f69756fdcfb7179f00c13eab1a854386669c340b data/minecraft/tags/blocks/mineable/axe.json b7347cb59f89e6b5530acf11100d5339e662af12 data/minecraft/tags/blocks/mineable/pickaxe.json e7b3d543ed682892c21185336e0c74f17019df84 data/minecraft/tags/blocks/mineable/shovel.json 7664fa2d24e4cac313d34871e35bfc4550d30dd8 data/minecraft/tags/blocks/needs_iron_tool.json diff --git a/src/generated/resources/assets/immersiveengineering/blockstates/blueprint_shelf.json b/src/generated/resources/assets/immersiveengineering/blockstates/blueprint_shelf.json new file mode 100644 index 0000000000..6e52d0f983 --- /dev/null +++ b/src/generated/resources/assets/immersiveengineering/blockstates/blueprint_shelf.json @@ -0,0 +1,588 @@ +{ + "multipart": [ + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/frame", + "x": -90 + }, + "when": { + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_0", + "x": -90 + }, + "when": { + "blueprint_0": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_1", + "x": -90 + }, + "when": { + "blueprint_1": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_2", + "x": -90 + }, + "when": { + "blueprint_2": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_3", + "x": -90 + }, + "when": { + "blueprint_3": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_4", + "x": -90 + }, + "when": { + "blueprint_4": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_5", + "x": -90 + }, + "when": { + "blueprint_5": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_6", + "x": -90 + }, + "when": { + "blueprint_6": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_7", + "x": -90 + }, + "when": { + "blueprint_7": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_8", + "x": -90 + }, + "when": { + "blueprint_8": "true", + "facing": "down" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/frame", + "x": -90 + }, + "when": { + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_0", + "x": -90 + }, + "when": { + "blueprint_0": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_1", + "x": -90 + }, + "when": { + "blueprint_1": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_2", + "x": -90 + }, + "when": { + "blueprint_2": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_3", + "x": -90 + }, + "when": { + "blueprint_3": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_4", + "x": -90 + }, + "when": { + "blueprint_4": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_5", + "x": -90 + }, + "when": { + "blueprint_5": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_6", + "x": -90 + }, + "when": { + "blueprint_6": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_7", + "x": -90 + }, + "when": { + "blueprint_7": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_8", + "x": -90 + }, + "when": { + "blueprint_8": "true", + "facing": "up" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/frame" + }, + "when": { + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_0" + }, + "when": { + "blueprint_0": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_1" + }, + "when": { + "blueprint_1": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_2" + }, + "when": { + "blueprint_2": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_3" + }, + "when": { + "blueprint_3": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_4" + }, + "when": { + "blueprint_4": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_5" + }, + "when": { + "blueprint_5": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_6" + }, + "when": { + "blueprint_6": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_7" + }, + "when": { + "blueprint_7": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_8" + }, + "when": { + "blueprint_8": "true", + "facing": "north" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/frame", + "y": 180 + }, + "when": { + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_0", + "y": 180 + }, + "when": { + "blueprint_0": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_1", + "y": 180 + }, + "when": { + "blueprint_1": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_2", + "y": 180 + }, + "when": { + "blueprint_2": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_3", + "y": 180 + }, + "when": { + "blueprint_3": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_4", + "y": 180 + }, + "when": { + "blueprint_4": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_5", + "y": 180 + }, + "when": { + "blueprint_5": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_6", + "y": 180 + }, + "when": { + "blueprint_6": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_7", + "y": 180 + }, + "when": { + "blueprint_7": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_8", + "y": 180 + }, + "when": { + "blueprint_8": "true", + "facing": "south" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/frame", + "y": 270 + }, + "when": { + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_0", + "y": 270 + }, + "when": { + "blueprint_0": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_1", + "y": 270 + }, + "when": { + "blueprint_1": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_2", + "y": 270 + }, + "when": { + "blueprint_2": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_3", + "y": 270 + }, + "when": { + "blueprint_3": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_4", + "y": 270 + }, + "when": { + "blueprint_4": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_5", + "y": 270 + }, + "when": { + "blueprint_5": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_6", + "y": 270 + }, + "when": { + "blueprint_6": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_7", + "y": 270 + }, + "when": { + "blueprint_7": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_8", + "y": 270 + }, + "when": { + "blueprint_8": "true", + "facing": "west" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/frame", + "y": 90 + }, + "when": { + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_0", + "y": 90 + }, + "when": { + "blueprint_0": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_1", + "y": 90 + }, + "when": { + "blueprint_1": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_2", + "y": 90 + }, + "when": { + "blueprint_2": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_3", + "y": 90 + }, + "when": { + "blueprint_3": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_4", + "y": 90 + }, + "when": { + "blueprint_4": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_5", + "y": 90 + }, + "when": { + "blueprint_5": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_6", + "y": 90 + }, + "when": { + "blueprint_6": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_7", + "y": 90 + }, + "when": { + "blueprint_7": "true", + "facing": "east" + } + }, + { + "apply": { + "model": "immersiveengineering:block/blueprint_shelf/blueprint_8", + "y": 90 + }, + "when": { + "blueprint_8": "true", + "facing": "east" + } + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/assets/immersiveengineering/models/item/blueprint_shelf.json b/src/generated/resources/assets/immersiveengineering/models/item/blueprint_shelf.json new file mode 100644 index 0000000000..b0f3e47e95 --- /dev/null +++ b/src/generated/resources/assets/immersiveengineering/models/item/blueprint_shelf.json @@ -0,0 +1,3 @@ +{ + "parent": "immersiveengineering:block/blueprint_shelf/frame" +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveengineering/loot_tables/blocks/blueprint_shelf.json b/src/generated/resources/data/immersiveengineering/loot_tables/blocks/blueprint_shelf.json new file mode 100644 index 0000000000..827630a812 --- /dev/null +++ b/src/generated/resources/data/immersiveengineering/loot_tables/blocks/blueprint_shelf.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "immersiveengineering:blueprint_shelf" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "immersiveengineering:blocks/blueprint_shelf" +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index e4a99250de..8321e344c9 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,5 +1,6 @@ { "values": [ + "immersiveengineering:blueprint_shelf", "immersiveengineering:circuit_table", "immersiveengineering:craftingtable", "immersiveengineering:crate", diff --git a/src/main/java/blusunrize/immersiveengineering/common/blocks/IEBlockInterfaces.java b/src/main/java/blusunrize/immersiveengineering/common/blocks/IEBlockInterfaces.java index b9ee9e8b76..33a4175561 100644 --- a/src/main/java/blusunrize/immersiveengineering/common/blocks/IEBlockInterfaces.java +++ b/src/main/java/blusunrize/immersiveengineering/common/blocks/IEBlockInterfaces.java @@ -56,7 +56,9 @@ public interface IBlockOverlayText Component[] getOverlayText(Player player, HitResult mop, boolean hammer); @Deprecated - boolean useNixieFont(Player player, HitResult mop); + default boolean useNixieFont(Player player, HitResult mop) { + return false; + }; } public interface ISoundBE @@ -315,7 +317,7 @@ public interface IHasDummyBlocks extends IGeneralMultiblock } /** - * super-interface for {@link MultiblockPartBlockEntity} and {@link IHasDummyBlocks} + * super-interface for {@link IHasDummyBlocks} */ public interface IGeneralMultiblock extends BlockstateProvider { diff --git a/src/main/java/blusunrize/immersiveengineering/common/blocks/PlacementLimitation.java b/src/main/java/blusunrize/immersiveengineering/common/blocks/PlacementLimitation.java index b81948e49e..6d32fda613 100644 --- a/src/main/java/blusunrize/immersiveengineering/common/blocks/PlacementLimitation.java +++ b/src/main/java/blusunrize/immersiveengineering/common/blocks/PlacementLimitation.java @@ -20,6 +20,10 @@ public enum PlacementLimitation SIDE_CLICKED((side, placer, hitPos) -> side), PISTON_LIKE((side, placer, hitPos) -> Direction.orderedByNearest(placer)[0]), PISTON_INVERTED((side, placer, hitPos) -> Direction.orderedByNearest(placer)[0].getOpposite()), + PISTON_INVERTED_NO_DOWN((side, placer, hitPos) -> { + Direction f = Direction.orderedByNearest(placer)[0]; + return f==Direction.DOWN?Direction.UP: f.getOpposite(); + }), HORIZONTAL((side, placer, hitPos) -> Direction.fromYRot(placer.getYRot())), VERTICAL((side, placer, hitPos) -> (side!=Direction.DOWN&&(side==Direction.UP||hitPos.y <= .5))?Direction.UP: Direction.DOWN), HORIZONTAL_AXIS((side, placer, hitPos) -> { diff --git a/src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlock.java b/src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlock.java new file mode 100644 index 0000000000..a3a5807a92 --- /dev/null +++ b/src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlock.java @@ -0,0 +1,60 @@ +/* + * BluSunrize + * Copyright (c) 2024 + * + * This code is licensed under "Blu's License of Common Sense" + * Details can be found in the license file in the root folder of this project + */ + +package blusunrize.immersiveengineering.common.blocks.wooden; + +import blusunrize.immersiveengineering.api.IEProperties; +import blusunrize.immersiveengineering.common.blocks.generic.AnyFacingEntityBlock; +import blusunrize.immersiveengineering.common.register.IEBlockEntities; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition.Builder; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; + +import java.util.EnumMap; + +public class BlueprintShelfBlock extends AnyFacingEntityBlock +{ + public static final BooleanProperty[] BLUEPRINT_SLOT_FILLED = new BooleanProperty[9]; + private static final EnumMap SHAPES = new EnumMap(Direction.class); + + static + { + for(int i = 0; i < BLUEPRINT_SLOT_FILLED.length; i++) + BLUEPRINT_SLOT_FILLED[i] = BooleanProperty.create("blueprint_"+i); + for(Direction d : Direction.values()) + SHAPES.put(d, Block.box(d==Direction.WEST?3: 0, 0, d==Direction.NORTH?3: 0, d==Direction.EAST?13: 16, d==Direction.UP?13: 16, d==Direction.SOUTH?13: 16)); + } + + public BlueprintShelfBlock(Properties blockProps) + { + super(IEBlockEntities.BLUEPRINT_SHELF, blockProps); + BlockState defaultState = this.stateDefinition.any().setValue(IEProperties.FACING_ALL, Direction.NORTH); + for(BooleanProperty booleanProperty : BLUEPRINT_SLOT_FILLED) + defaultState = defaultState.setValue(booleanProperty, false); + this.registerDefaultState(defaultState); + } + + @Override + protected void createBlockStateDefinition(Builder builder) + { + super.createBlockStateDefinition(builder); + builder.add(BLUEPRINT_SLOT_FILLED); + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) + { + return SHAPES.get(state.getValue(IEProperties.FACING_ALL)); + } +} diff --git a/src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlockEntity.java b/src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlockEntity.java new file mode 100644 index 0000000000..64d1f978e0 --- /dev/null +++ b/src/main/java/blusunrize/immersiveengineering/common/blocks/wooden/BlueprintShelfBlockEntity.java @@ -0,0 +1,191 @@ +/* + * BluSunrize + * Copyright (c) 2024 + * + * This code is licensed under "Blu's License of Common Sense" + * Details can be found in the license file in the root folder of this project + */ + +package blusunrize.immersiveengineering.common.blocks.wooden; + +import blusunrize.immersiveengineering.api.IEProperties; +import blusunrize.immersiveengineering.api.Lib; +import blusunrize.immersiveengineering.common.blocks.IEBaseBlockEntity; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IBlockEntityDrop; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IBlockOverlayText; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IPlayerInteraction; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IStateBasedDirectional; +import blusunrize.immersiveengineering.common.blocks.PlacementLimitation; +import blusunrize.immersiveengineering.common.items.EngineersBlueprintItem; +import blusunrize.immersiveengineering.common.register.IEBlockEntities; +import blusunrize.immersiveengineering.common.util.inventory.IIEInventory; +import net.minecraft.client.resources.language.I18n; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.world.ContainerHelper; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; + +import javax.annotation.Nullable; +import java.util.function.Consumer; + +public class BlueprintShelfBlockEntity extends IEBaseBlockEntity implements IIEInventory, IBlockEntityDrop, + IStateBasedDirectional, IPlayerInteraction, IBlockOverlayText +{ + public static final int NUM_SLOTS = 9; + + private final NonNullList inventory = NonNullList.withSize(NUM_SLOTS, ItemStack.EMPTY); + + public BlueprintShelfBlockEntity(BlockPos pos, BlockState state) + { + super(IEBlockEntities.BLUEPRINT_SHELF.get(), pos, state); + } + + @Override + public Property getFacingProperty() + { + return IEProperties.FACING_ALL; + } + + @Override + public PlacementLimitation getFacingLimitation() + { + return PlacementLimitation.PISTON_INVERTED_NO_DOWN; + } + + @Override + public boolean mirrorFacingOnPlacement(LivingEntity placer) + { + return placer.isShiftKeyDown(); + } + + @Override + public void readCustomNBT(CompoundTag nbt, boolean descPacket) + { + ContainerHelper.loadAllItems(nbt, inventory); + } + + @Override + public void writeCustomNBT(CompoundTag nbt, boolean descPacket) + { + ContainerHelper.saveAllItems(nbt, inventory); + } + + @Override + public void getBlockEntityDrop(LootContext context, Consumer drop) + { + ItemStack stack = new ItemStack(getBlockState().getBlock(), 1); + CompoundTag nbt = new CompoundTag(); + ContainerHelper.saveAllItems(nbt, inventory); + if(!nbt.isEmpty()) + stack.setTag(nbt); + drop.accept(stack); + } + + @Override + public void onBEPlaced(BlockPlaceContext ctx) + { + final ItemStack stack = ctx.getItemInHand(); + if(stack.hasTag()) + readCustomNBT(stack.getOrCreateTag(), false); + } + + @Override + public NonNullList getInventory() + { + return inventory; + } + + @Override + public boolean isStackValid(int slot, ItemStack stack) + { + return stack.getItem() instanceof EngineersBlueprintItem; + } + + @Override + public int getSlotLimit(int slot) + { + return 1; + } + + @Override + public void doGraphicalUpdates() + { + this.setChanged(); + markContainingBlockForUpdate(null); + } + + private static int getTargetedSlot(Direction side, float hitX, float hitY, float hitZ) + { + float targetU = switch(side) + { + case SOUTH -> hitX; + case DOWN, UP, NORTH -> 1-hitX; + case WEST -> hitZ; + case EAST -> 1-hitZ; + }; + float targetV = side==Direction.UP?hitZ: hitY; + return (int)Math.floor(targetU*3)+(targetV < 0.33?6: targetV < 0.66?3: 0); + } + + @Override + public boolean interact(Direction side, Player player, InteractionHand hand, ItemStack heldItem, float hitX, float hitY, float hitZ) + { + int targetedSlot = getTargetedSlot(side, hitX, hitY, hitZ); + ItemStack stackInSlot = this.inventory.get(targetedSlot); + BlockState state = getLevelNonnull().getBlockState(getBlockPos()); + if(!stackInSlot.isEmpty()) + { + if(heldItem.isEmpty()) + player.setItemInHand(hand, stackInSlot); + else if(!getLevelNonnull().isClientSide()) + player.spawnAtLocation(stackInSlot, 0); + this.inventory.set(targetedSlot, ItemStack.EMPTY); + this.setState(state.setValue(BlueprintShelfBlock.BLUEPRINT_SLOT_FILLED[targetedSlot], false)); + return true; + } + else if(isStackValid(targetedSlot, heldItem)) + { + this.inventory.set(targetedSlot, heldItem.copyWithCount(1)); + heldItem.shrink(1); + this.setState(state.setValue(BlueprintShelfBlock.BLUEPRINT_SLOT_FILLED[targetedSlot], true)); + return true; + } + return false; + } + + @Nullable + @Override + public Component[] getOverlayText(Player player, HitResult mop, boolean hammer) + { + if(mop instanceof BlockHitResult bhr) + { + final float hitX = (float)bhr.getLocation().x-bhr.getBlockPos().getX(); + final float hitY = (float)bhr.getLocation().y-bhr.getBlockPos().getY(); + final float hitZ = (float)bhr.getLocation().z-bhr.getBlockPos().getZ(); + int targetedSlot = getTargetedSlot(bhr.getDirection(), hitX, hitY, hitZ); + ItemStack stackInSlot = this.inventory.get(targetedSlot); + String key = EngineersBlueprintItem.getCategory(stackInSlot); + if(key.isEmpty()) + return null; + String formatKey = Lib.DESC_INFO+"blueprint."+key; + String formatted = I18n.get(formatKey); + if(formatKey.equals(formatted)) + return new Component[]{Component.literal(key)}; + else + return new Component[]{Component.translatable(formatKey)}; + } + return null; + } +} \ No newline at end of file diff --git a/src/main/java/blusunrize/immersiveengineering/common/register/IEBlockEntities.java b/src/main/java/blusunrize/immersiveengineering/common/register/IEBlockEntities.java index ca7937ab24..a3c486f46f 100644 --- a/src/main/java/blusunrize/immersiveengineering/common/register/IEBlockEntities.java +++ b/src/main/java/blusunrize/immersiveengineering/common/register/IEBlockEntities.java @@ -67,6 +67,9 @@ public class IEBlockEntities public static final DeferredHolder, BlockEntityType> MOD_WORKBENCH = REGISTER.register( "modworkbench", makeType(ModWorkbenchBlockEntity::new, WoodenDevices.WORKBENCH) ); + public static final DeferredHolder, BlockEntityType> BLUEPRINT_SHELF = REGISTER.register( + "blueprint_shelf", makeType(BlueprintShelfBlockEntity::new, WoodenDevices.BLUEPRINT_SHELF) + ); public static final DeferredHolder, BlockEntityType> CIRCUIT_TABLE = REGISTER.register( "circuittable", makeType(CircuitTableBlockEntity::new, WoodenDevices.CIRCUIT_TABLE) ); diff --git a/src/main/java/blusunrize/immersiveengineering/common/register/IEBlocks.java b/src/main/java/blusunrize/immersiveengineering/common/register/IEBlocks.java index 0fe7b511c6..be8d5d18e4 100644 --- a/src/main/java/blusunrize/immersiveengineering/common/register/IEBlocks.java +++ b/src/main/java/blusunrize/immersiveengineering/common/register/IEBlocks.java @@ -382,6 +382,9 @@ public static final class WoodenDevices public static final BlockEntry> WORKBENCH = new BlockEntry<>( "workbench", DeskBlock.PROPERTIES, p -> new DeskBlock<>(IEBlockEntities.MOD_WORKBENCH, p) ); + public static final BlockEntry BLUEPRINT_SHELF = new BlockEntry<>( + "blueprint_shelf", STANDARD_WOOD_PROPERTIES_NO_OCCLUSION, BlueprintShelfBlock::new + ); public static final BlockEntry> CIRCUIT_TABLE = new BlockEntry<>( "circuit_table", DeskBlock.PROPERTIES, p -> new DeskBlock<>(IEBlockEntities.CIRCUIT_TABLE, p) ); diff --git a/src/main/resources/assets/immersiveengineering/lang/en_us.json b/src/main/resources/assets/immersiveengineering/lang/en_us.json index 4ba71801c4..63817fb2dc 100644 --- a/src/main/resources/assets/immersiveengineering/lang/en_us.json +++ b/src/main/resources/assets/immersiveengineering/lang/en_us.json @@ -938,6 +938,7 @@ "block.immersiveengineering.craftingtable": "Engineer's Crafting Table", "block.immersiveengineering.crate": "Wooden Storage Crate", "block.immersiveengineering.workbench": "Engineer's Workbench", + "block.immersiveengineering.blueprint_shelf": "Blueprint Shelf", "block.immersiveengineering.circuit_table": "Engineer's Circuit Workbench", "block.immersiveengineering.sorter": "Item Router", "block.immersiveengineering.item_batcher": "Item Batcher", diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_0.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_0.json new file mode 100644 index 0000000000..8a350669e8 --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_0.json @@ -0,0 +1,22 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "name": "blueprint0", + "from": [11, 11, 2], + "to": [14, 14, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [10, 11, 10]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_1.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_1.json new file mode 100644 index 0000000000..ba2e0ad8ef --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_1.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [6, 11, 1], + "to": [9, 14, 13], + "rotation": {"angle": 0, "axis": "x", "origin": [5, 11, 9]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_2.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_2.json new file mode 100644 index 0000000000..503e3a60f1 --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_2.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [1, 11, 3], + "to": [4, 14, 15], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 11, 11]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_3.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_3.json new file mode 100644 index 0000000000..c8deb4fb8d --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_3.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [11, 6, 2], + "to": [14, 9, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [10, 6, 10]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_4.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_4.json new file mode 100644 index 0000000000..195cbf6eaa --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_4.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [6, 6, 2], + "to": [9, 9, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [5, 6, 10]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_5.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_5.json new file mode 100644 index 0000000000..ada4e16452 --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_5.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [1, 6, 1], + "to": [4, 9, 13], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 6, 9]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_6.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_6.json new file mode 100644 index 0000000000..5eca79ee78 --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_6.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [11, 1, 1], + "to": [14, 4, 13], + "rotation": {"angle": 0, "axis": "x", "origin": [10, 1, 9]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_7.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_7.json new file mode 100644 index 0000000000..461f759b0f --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_7.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [6, 1, 2], + "to": [9, 4, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [5, 1, 10]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_8.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_8.json new file mode 100644 index 0000000000..300ee56212 --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/blueprint_8.json @@ -0,0 +1,21 @@ +{ + "textures": { + "3": "immersiveengineering:block/wooden_device/blueprint_roll" + }, + "elements": [ + { + "from": [1, 1, 3], + "to": [4, 4, 15], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 1, 11]}, + "faces": { + "north": {"uv": [3, 16, 0, 13], "rotation": 180, "texture": "#3"}, + "east": {"uv": [15, 13, 3, 16], "texture": "#3"}, + "south": {"uv": [0, 13, 3, 16], "texture": "#3"}, + "west": {"uv": [3, 13, 15, 16], "texture": "#3"}, + "up": {"uv": [3, 13, 0, 1], "texture": "#3"}, + "down": {"uv": [0, 1, 3, 13], "texture": "#3"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/frame.json b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/frame.json new file mode 100644 index 0000000000..300ee19a3a --- /dev/null +++ b/src/main/resources/assets/immersiveengineering/models/block/blueprint_shelf/frame.json @@ -0,0 +1,197 @@ +{ + "parent": "block/block", + "textures": { + "0": "immersiveengineering:block/wooden_decoration/treated_wood_vertical", + "2": "immersiveengineering:block/wooden_decoration/treated_wood_packaged", + "particle": "immersiveengineering:block/wooden_decoration/treated_wood_vertical" + }, + "elements": [ + { + "from": [6, 5, 3], + "to": [10, 6, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [5, 5, 15]}, + "faces": { + "north": {"uv": [6, 0, 10, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [6, 0, 10, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [6, 2, 10, 13], "texture": "#0"}, + "down": {"uv": [6, 2, 10, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [1, 5, 3], + "to": [5, 6, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 5, 15]}, + "faces": { + "north": {"uv": [1, 0, 5, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [1, 0, 5, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [1, 2, 5, 13], "texture": "#0"}, + "down": {"uv": [1, 2, 5, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [11, 5, 3], + "to": [15, 6, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [10, 5, 15]}, + "faces": { + "north": {"uv": [11, 0, 15, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [11, 0, 15, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [11, 2, 15, 13], "texture": "#0"}, + "down": {"uv": [11, 2, 15, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [11, 10, 3], + "to": [15, 11, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [10, 10, 15]}, + "faces": { + "north": {"uv": [11, 0, 15, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [11, 0, 15, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [11, 2, 15, 14], "texture": "#0"}, + "down": {"uv": [11, 2, 15, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [6, 10, 3], + "to": [10, 11, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [5, 10, 15]}, + "faces": { + "north": {"uv": [6, 0, 10, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [6, 0, 10, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [6, 2, 10, 14], "texture": "#0"}, + "down": {"uv": [6, 2, 10, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [1, 10, 3], + "to": [5, 11, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 10, 15]}, + "faces": { + "north": {"uv": [1, 0, 5, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [1, 0, 5, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [1, 2, 5, 14], "texture": "#0"}, + "down": {"uv": [1, 2, 5, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [5, 1, 3], + "to": [6, 15, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [5, 1, 15]}, + "faces": { + "north": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"}, + "east": {"uv": [1, 2, 15, 13], "rotation": 90, "texture": "#0"}, + "south": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"}, + "west": {"uv": [1, 2, 15, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 2, 1, 14], "texture": "#0"}, + "down": {"uv": [0, 2, 1, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [10, 1, 3], + "to": [11, 15, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [10, 1, 15]}, + "faces": { + "north": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"}, + "east": {"uv": [1, 2, 15, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"}, + "west": {"uv": [1, 2, 15, 13], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 2, 1, 14], "texture": "#0"}, + "down": {"uv": [0, 2, 1, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [15, 1, 3], + "to": [16, 15, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [15, 1, 15]}, + "faces": { + "north": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"}, + "east": {"uv": [1, 2, 15, 13], "rotation": 90, "texture": "#0"}, + "south": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"}, + "west": {"uv": [1, 2, 15, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 2, 1, 14], "texture": "#0"}, + "down": {"uv": [0, 2, 1, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [0, 1, 3], + "to": [1, 15, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 1, 15]}, + "faces": { + "north": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"}, + "east": {"uv": [1, 2, 15, 14], "rotation": 90, "texture": "#0"}, + "south": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"}, + "west": {"uv": [1, 2, 15, 13], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 2, 1, 14], "texture": "#0"}, + "down": {"uv": [0, 2, 1, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [0, 15, 3], + "to": [16, 16, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 15, 15]}, + "faces": { + "north": {"uv": [0, 0, 16, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 13], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 0, 16, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 2, 16, 13], "texture": "#0"}, + "down": {"uv": [0, 2, 16, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [0, 0, 3], + "to": [16, 1, 14], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 0, 15]}, + "faces": { + "north": {"uv": [0, 0, 16, 1], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 2, 1, 13], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 0, 16, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 14], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 2, 16, 14], "texture": "#0"}, + "down": {"uv": [0, 2, 16, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [0, 0, 14], + "to": [16, 16, 16], + "rotation": {"angle": 0, "axis": "x", "origin": [0, 0, 15]}, + "faces": { + "north": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#2"}, + "east": {"uv": [0, 14, 16, 16], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#2"}, + "west": {"uv": [0, 14, 16, 16], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 14, 16, 16], "texture": "#0"}, + "down": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#0"} + } + } + ], + "display": { + "ground": { + "translation": [0, 1.75, 0], + "scale": [0.2, 0.2, 0.2] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_righthand": { + "rotation": [3, 69, 23], + "translation": [1, 1, -2.25], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_righthand": { + "rotation": [0, -61, 0], + "scale": [0.4, 0.4, 0.4] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveengineering/textures/block/wooden_device/blueprint_roll.png b/src/main/resources/assets/immersiveengineering/textures/block/wooden_device/blueprint_roll.png new file mode 100644 index 0000000000000000000000000000000000000000..446cc33f34719d62cf568d38ea7bcb0a1c378044 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^3h)VW1=1=`1*-1#ntt8d!IKT5 z7d@EX5(X4yED7=pW^j0RBMr#0^mK6y;fPL7XkbiaE@|U1>|u~N%s5w(OT2NVVWVM; yv-8v`Q+Qb=T%2O(^sun9O0YP`^z=@dBEpdC&S6vd;9Wb=5C%_IKbLh*2~7Zw$SL;# literal 0 HcmV?d00001