From 85e47dbfa8548220273e252d348b123cd9c1425f Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 24 Oct 2020 22:37:04 -0400 Subject: [PATCH] Part 1 of reimplementing Ritual Diviner Finished the placement of the Ritual Stones from the ItemRitualDiviner. Still need to finish the rendering system for the ghost blocks. --- src/generated/resources/.cache/cache | 24 +- .../blockstates/masterritualstone.json | 7 + .../assets/bloodmagic/lang/en_us.json | 61 ++ .../models/block/masterritualstone.json | 6 + .../item/activationcrystalawakened.json | 6 + .../item/activationcrystalcreative.json | 6 + .../models/item/activationcrystalweak.json | 6 + .../bloodmagic/models/item/airscribetool.json | 6 + .../models/item/duskscribetool.json | 6 + .../models/item/earthscribetool.json | 6 + .../models/item/firescribetool.json | 6 + .../models/item/masterritualstone.json | 3 + .../bloodmagic/models/item/ritualdiviner.json | 6 + .../models/item/waterscribetool.json | 6 + .../bloodmagictab/ritual_stone_blank.json | 32 + .../bloodmagictab/ritual_stone_master.json | 32 + .../loot_tables/blocks/masterritualstone.json | 19 + .../bloodmagic/recipes/altar/air_tool.json | 14 + .../bloodmagic/recipes/altar/dusk_tool.json | 14 + .../bloodmagic/recipes/altar/earth_tool.json | 14 + .../bloodmagic/recipes/altar/fire_tool.json | 14 + .../bloodmagic/recipes/altar/water_tool.json | 14 + .../recipes/ritual_stone_blank.json | 24 + .../recipes/ritual_stone_master.json | 23 + .../java/WayofTime/bloodmagic/BloodMagic.java | 2 + .../client/render/block/RenderAltar.java | 2 - .../java/WayofTime/bloodmagic/util/Utils.java | 7 + .../client/render/block/RenderFakeBlocks.java | 66 ++ .../common/block/BlockMasterRitualStone.java | 6 +- .../common/block/BlockRitualStone.java | 2 +- .../common/data/GeneratorBaseRecipes.java | 2 + .../common/data/GeneratorLanguage.java | 70 +++ .../common/item/BloodMagicItems.java | 12 + .../common/item/ItemActivationCrystal.java | 2 +- .../common/item/ItemInscriptionTool.java | 66 ++ .../common/item/ItemRitualDiviner.java | 591 ++++++++++++++++++ .../recipe/BloodAltarRecipeProvider.java | 5 + .../tile/TileMasterRitualStone.java | 2 +- .../bloodmagic/tile/base/TileTicking.java | 4 +- .../util/handler/event/ClientHandler.java | 303 +++++++++ 40 files changed, 1486 insertions(+), 11 deletions(-) create mode 100644 src/generated/resources/assets/bloodmagic/blockstates/masterritualstone.json create mode 100644 src/generated/resources/assets/bloodmagic/models/block/masterritualstone.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/activationcrystalawakened.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/activationcrystalcreative.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/activationcrystalweak.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/airscribetool.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/duskscribetool.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/earthscribetool.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/firescribetool.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/masterritualstone.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/ritualdiviner.json create mode 100644 src/generated/resources/assets/bloodmagic/models/item/waterscribetool.json create mode 100644 src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_blank.json create mode 100644 src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_master.json create mode 100644 src/generated/resources/data/bloodmagic/loot_tables/blocks/masterritualstone.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/altar/air_tool.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/altar/dusk_tool.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/altar/earth_tool.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/altar/fire_tool.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/altar/water_tool.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/ritual_stone_blank.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/ritual_stone_master.json create mode 100644 src/main/java/wayoftime/bloodmagic/client/render/block/RenderFakeBlocks.java create mode 100644 src/main/java/wayoftime/bloodmagic/common/item/ItemInscriptionTool.java create mode 100644 src/main/java/wayoftime/bloodmagic/common/item/ItemRitualDiviner.java create mode 100644 src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 79d86fc3..2564ed42 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -10,13 +10,14 @@ ba1cd8a9475212843e3b26232c8a9943fa0d2d20 assets/bloodmagic/blockstates/duskritua bb3db171734f511fc0c259d86e869b49aa1d0c77 assets/bloodmagic/blockstates/earthritualstone.json e780d6d9e891082dc6ce83fde1697ce36281a02a assets/bloodmagic/blockstates/fireritualstone.json 002795212cc7bf2cad2a91f873d85e2204c6367d assets/bloodmagic/blockstates/lightritualstone.json +e1a98bd53fca155e4bbb03c1e548341af0f84bd7 assets/bloodmagic/blockstates/masterritualstone.json 372ecd737f7082a4c2c70e46745f893b1179f885 assets/bloodmagic/blockstates/orbcapacityrune.json 90daa355e528ab8a6582f796951201882f3c56da assets/bloodmagic/blockstates/ritualstone.json 285618c1a8ec36e36d479f577190579ae7616529 assets/bloodmagic/blockstates/sacrificerune.json b03040d7a168653bf8df3600033b8fde2383db30 assets/bloodmagic/blockstates/selfsacrificerune.json 487ffdc02ab7b65aafcb932e3b5cf6ea0500b21d assets/bloodmagic/blockstates/speedrune.json e6d9cf699667aaa47efff37b2b033895dee29c15 assets/bloodmagic/blockstates/waterritualstone.json -f7a92ca94cbd68344d89b92dc6c26c15cd1b85b5 assets/bloodmagic/lang/en_us.json +c2662c44f07cfb61b565f1918b4fee1d176ed6f7 assets/bloodmagic/lang/en_us.json 34445195b9f2459475cde53454bc8e37d32865d7 assets/bloodmagic/models/block/accelerationrune.json bcdbccc49d4509571be6988762ab87126275a4c8 assets/bloodmagic/models/block/airritualstone.json 3c98a88c2283ad54f0efb9d7194361bbc3e93c17 assets/bloodmagic/models/block/altarcapacityrune.json @@ -29,6 +30,7 @@ bcdbccc49d4509571be6988762ab87126275a4c8 assets/bloodmagic/models/block/airritua c30064f4aa09c42d23e94d118ae5b148eadb3a6c assets/bloodmagic/models/block/earthritualstone.json 4ff1cab1014cd8f655e5f032ecf60dd371f421c3 assets/bloodmagic/models/block/fireritualstone.json 2e1a81c758bfeec2aee807b48239f23241302268 assets/bloodmagic/models/block/lightritualstone.json +eab1713a8879decb2ae05258a6bcfa9da78ec67b assets/bloodmagic/models/block/masterritualstone.json c3a813b735cd229f8597e41d04465926b2e65fe1 assets/bloodmagic/models/block/orbcapacityrune.json 9b2bf2a44b788cbaecbe63a3e085e8de76672e1b assets/bloodmagic/models/block/ritualstone.json a8a1d06fcc2f8395530c72d2846133fff37d5537 assets/bloodmagic/models/block/sacrificerune.json @@ -36,7 +38,11 @@ a8a1d06fcc2f8395530c72d2846133fff37d5537 assets/bloodmagic/models/block/sacrific 65fe5e01ed2660e45a5c329ff2389a87e4d791ec assets/bloodmagic/models/block/speedrune.json 6041f2e47f5437d90a58586e42d18dadc42df439 assets/bloodmagic/models/block/waterritualstone.json 9462d62d9bc9408359d30728de8651dc104aacf1 assets/bloodmagic/models/item/accelerationrune.json +1aad9b00930b996e3680223cfcb631db2d9cb5ce assets/bloodmagic/models/item/activationcrystalawakened.json +5b8a9b260de9e5eccac525b3fa665ae973f5d23f assets/bloodmagic/models/item/activationcrystalcreative.json +80d2bbc93783663f605b360e6df25bd6497c704a assets/bloodmagic/models/item/activationcrystalweak.json fe8e3deb3ad0107ca3ebd70694c1fc55a987d912 assets/bloodmagic/models/item/airritualstone.json +0bcf230493163a43357cbee7c26b8756089cb548 assets/bloodmagic/models/item/airscribetool.json 17cbe9142ef3950ea1b6be11694b849f55e93f13 assets/bloodmagic/models/item/airsigil.json f150f178edf7d6d250bcfd84af1c28a21cff09c6 assets/bloodmagic/models/item/altarcapacityrune.json 866b8cdd3da56e2e82dbd5f16ab5117b5a503749 assets/bloodmagic/models/item/apprenticebloodorb.json @@ -56,9 +62,12 @@ f404148f9df3a61da3c18175885ffa56b2a85a6a assets/bloodmagic/models/item/daggerofs 7af07ab578bbd20e2f834b26d9cafb5fe23bc7d4 assets/bloodmagic/models/item/dislocationrune.json f4531e22aa1db1cff324db5ccb344d3b9fa85c8d assets/bloodmagic/models/item/divinationsigil.json 10aceefca3ad3f0da773cb317c4effc6c06051ea assets/bloodmagic/models/item/duskritualstone.json +5783901af844ab0a741958dbe684d668a9c293c4 assets/bloodmagic/models/item/duskscribetool.json 4d56efd7fdbf430f49903ce201577047687c3804 assets/bloodmagic/models/item/earthritualstone.json +98ee75786f9d0ab2a8c0835896d07d18df77de0f assets/bloodmagic/models/item/earthscribetool.json 4c39378f6c14dc243a7d52564e5a21df94683415 assets/bloodmagic/models/item/etherealslate.json c36bde4f98c0aeb3bf0f369ad3bc067e5f0dc916 assets/bloodmagic/models/item/fireritualstone.json +b5708a8cc7259fd36ffeabd155ea085b9fdef0fd assets/bloodmagic/models/item/firescribetool.json 44663089f348642bcca1c5020b5081c3ab172f92 assets/bloodmagic/models/item/growthsigil.json f68825f667ca73b4373fd5068a47f0d1ca9b2aad assets/bloodmagic/models/item/icesigil.json 109b5485c25d978af55b46682d5bfa7008909458 assets/bloodmagic/models/item/infusedslate.json @@ -66,6 +75,7 @@ f68825f667ca73b4373fd5068a47f0d1ca9b2aad assets/bloodmagic/models/item/icesigil. 5a76914a87fc9b99079bb6afed1d4cfe3e4a532e assets/bloodmagic/models/item/lightritualstone.json 15d8178b626da912334774142d40d1012fb21fa0 assets/bloodmagic/models/item/magicianbloodorb.json 0a3566d3c86403f24c22977dd32ffaec727a9ad3 assets/bloodmagic/models/item/masterbloodorb.json +9e377ab2c131993f96ab6fb544bda4dbba0ab87e assets/bloodmagic/models/item/masterritualstone.json 7596826c5b40c2809eb0a42eb5f5f2089290e3e5 assets/bloodmagic/models/item/miningsigil.json ff9b802098659824626dc90dbb5a0d8960234228 assets/bloodmagic/models/item/orbcapacityrune.json b4e1259784354b048cd7ec5ef888a182e3909dc6 assets/bloodmagic/models/item/reagentair.json @@ -77,6 +87,7 @@ baafdb5915c5fbc99b84a54670ed64a6f26cb0fe assets/bloodmagic/models/item/reagentma 95b2925e96a7df71d72568e0ed7b03290293cbe7 assets/bloodmagic/models/item/reagentvoid.json fd1447d943ddc4540a51a72dcbb245d77d45da71 assets/bloodmagic/models/item/reagentwater.json 50bf796adbed412488df48ed9250fc9b0ecd851f assets/bloodmagic/models/item/reinforcedslate.json +8b727eee7b06ffa735e6ba49f0c13042b73c45c0 assets/bloodmagic/models/item/ritualdiviner.json 2722891c9c40b124d85bf9ff8eb885e175f5e6ff assets/bloodmagic/models/item/ritualstone.json db73abb3bcb1731b6fc389e3577910b6aab87b10 assets/bloodmagic/models/item/sacrificerune.json 9403d6195d4d38d5876c2a42f4edfb9bdcd05210 assets/bloodmagic/models/item/sacrificialdagger.json @@ -123,6 +134,7 @@ ec6f6bf7f520182b2044f3cc5a10f1d4c7a8d7ab assets/bloodmagic/models/item/variants/ 0f5a3e1e5993a03ccda156eed855b71fbd0be0a2 assets/bloodmagic/models/item/variants/soulsword_vengeful_deactivated.json 836b5a7f19915af809795a72983a23f0d5f9c5b2 assets/bloodmagic/models/item/voidsigil.json a31019db55828cb937a071ac2f74b125a2d0c955 assets/bloodmagic/models/item/waterritualstone.json +4130e8907fe8fcf0a5de805f9c2b7ba9166323e9 assets/bloodmagic/models/item/waterscribetool.json 7426fed5f833ce3d08602f727f1467dd3e107991 assets/bloodmagic/models/item/watersigil.json f72efc172699d43405019add97f455bd6b7f452b assets/bloodmagic/models/item/weakbloodorb.json 828c0f89e747d48d37c6a86030a8ec59ca5c29cb data/bloodmagic/advancements/recipes/bloodmagictab/blood_altar.json @@ -133,6 +145,8 @@ e897d6f91e2a0bd12b0da0a50e5c897294989e7c data/bloodmagic/advancements/recipes/bl 4a53004c651901cd1245de452810161736d9b067 data/bloodmagic/advancements/recipes/bloodmagictab/blood_rune_sacrifice.json 263f7c251d2f163db5bd229f2ab8a222f23ae03a data/bloodmagic/advancements/recipes/bloodmagictab/blood_rune_self_sacrifice.json 7ca400d1141ff4be1b529cd060950b42cf3b9bfb data/bloodmagic/advancements/recipes/bloodmagictab/blood_rune_speed.json +c8e5cdac0e7328640ab1cb0eab0a46f0733b59b3 data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_blank.json +1578416eb302aecb3fd61e481634c5c021541f51 data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_master.json 832301a424345b7ca70b43cb214faa104179f0fb data/bloodmagic/advancements/recipes/bloodmagictab/sacrificial_dagger.json 2d29dd0c24c4c11d7438cdeeb26b9357d4359e2c data/bloodmagic/advancements/recipes/bloodmagictab/soul_forge.json 7a7f9f995d2414289d07c0a145647c8e735a6b78 data/bloodmagic/advancements/recipes/bloodmagictab/soul_snare.json @@ -150,6 +164,7 @@ a9fcfc656fab957328c10ee1d9d33807e697b7f7 data/bloodmagic/loot_tables/blocks/disl 26e3f34021426def32602e5ae7755e4672878320 data/bloodmagic/loot_tables/blocks/earthritualstone.json 26e3f34021426def32602e5ae7755e4672878320 data/bloodmagic/loot_tables/blocks/fireritualstone.json 26e3f34021426def32602e5ae7755e4672878320 data/bloodmagic/loot_tables/blocks/lightritualstone.json +72610188b4538d98ffcd015c2813d63d19889d5f data/bloodmagic/loot_tables/blocks/masterritualstone.json 95442c1bb740fab2eb8ee051f7184813f6023afa data/bloodmagic/loot_tables/blocks/orbcapacityrune.json 26e3f34021426def32602e5ae7755e4672878320 data/bloodmagic/loot_tables/blocks/ritualstone.json e0239eff7762a414a4e4faa0158d844dffb8c1f6 data/bloodmagic/loot_tables/blocks/sacrificerune.json @@ -157,13 +172,18 @@ e0239eff7762a414a4e4faa0158d844dffb8c1f6 data/bloodmagic/loot_tables/blocks/sacr f748a5ba8838b50de0502f132fe2a65f4726dae6 data/bloodmagic/loot_tables/blocks/soulforge.json 015e07226fd90935f7ec663f4bcf3873a57a82d1 data/bloodmagic/loot_tables/blocks/speedrune.json 26e3f34021426def32602e5ae7755e4672878320 data/bloodmagic/loot_tables/blocks/waterritualstone.json +3c9d829f7bff8a4d607c46fc3ff4f86dffa28fd5 data/bloodmagic/recipes/altar/air_tool.json f41b0e9dfab608c42a85c3c5c5bbc050b03f02a1 data/bloodmagic/recipes/altar/apprenticebloodorb.json 2a67e37497a571b5ee944375d315fddccea87697 data/bloodmagic/recipes/altar/daggerofsacrifice.json c5a4a256a7437f2e13c574a6f0c4d75fc2e718cb data/bloodmagic/recipes/altar/demonicslate.json +d79a96eb3eed597f1c18a8983764a6362a24748c data/bloodmagic/recipes/altar/dusk_tool.json +7272cdd4e1469cf83849e5444b4b93a7563a6bf2 data/bloodmagic/recipes/altar/earth_tool.json +37913b1babf9b8159332db09b114c919b1b49473 data/bloodmagic/recipes/altar/fire_tool.json 9aeb0d2d33d839eedb2d9bbdaf76fc73e0b39941 data/bloodmagic/recipes/altar/imbuedslate.json 2643d1516f6dae79128fdc8c48c4cfe23453f171 data/bloodmagic/recipes/altar/magicianbloodorb.json f38355165034ce314a9f0344ebc3a6cad22c76c8 data/bloodmagic/recipes/altar/reinforcedslate.json 584d01dff4d64bb88bd3783751a29723700f1728 data/bloodmagic/recipes/altar/slate.json +926d4a0e165c87a15a609744d832d2f5f04a40d0 data/bloodmagic/recipes/altar/water_tool.json 7551501cf361667ec7454c307b9d2368536fbed6 data/bloodmagic/recipes/altar/weakbloodorb.json e1285ec51100f2336c1ea1a1a3057e74a0dd84d1 data/bloodmagic/recipes/array/airsigil.json d1ac23080f72f21adb5908befefe965ffb4efd4f data/bloodmagic/recipes/array/bloodlightsigil.json @@ -182,6 +202,8 @@ f905c1a8ca4d3a9f841ca6c44caa91de327fc29d data/bloodmagic/recipes/blood_rune_char b63d77c3762f86d4a91f62e192c3e9b26e3b52ca data/bloodmagic/recipes/blood_rune_sacrifice.json 7c4e247c1df6ef594bbb2fc2196afb102f45982b data/bloodmagic/recipes/blood_rune_self_sacrifice.json e2bcf2a6f951fbcef45554ec90ba28d14e261d18 data/bloodmagic/recipes/blood_rune_speed.json +7757e5fd52f71b0d21595e072593fc592210dd64 data/bloodmagic/recipes/ritual_stone_blank.json +8608f828f997b1a8015287bd9cd436e9d7dff2ff data/bloodmagic/recipes/ritual_stone_master.json aefbf1fd258f1cda8d04db7e0794b9612993e6bf data/bloodmagic/recipes/sacrificial_dagger.json d699e777c72a5f61c4e6cdfea8705628e1c2b855 data/bloodmagic/recipes/soul_forge.json 2455bf8c205c7244fef2b7d7afeef060e30520b7 data/bloodmagic/recipes/soul_snare.json diff --git a/src/generated/resources/assets/bloodmagic/blockstates/masterritualstone.json b/src/generated/resources/assets/bloodmagic/blockstates/masterritualstone.json new file mode 100644 index 00000000..c6276d28 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/blockstates/masterritualstone.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "bloodmagic:block/masterritualstone" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/lang/en_us.json b/src/generated/resources/assets/bloodmagic/lang/en_us.json index bc3f1ecf..174a9763 100644 --- a/src/generated/resources/assets/bloodmagic/lang/en_us.json +++ b/src/generated/resources/assets/bloodmagic/lang/en_us.json @@ -1,16 +1,32 @@ { "block.bloodmagic.accelerationrune": "Acceleration Rune", + "block.bloodmagic.airritualstone": "Air Ritual Stone", "block.bloodmagic.altar": "Blood Altar", "block.bloodmagic.altarcapacityrune": "Rune of Capacity", "block.bloodmagic.bettercapacityrune": "Rune of Augmented Capacity", "block.bloodmagic.blankrune": "Blank Rune", "block.bloodmagic.chargingrune": "Charging Rune", "block.bloodmagic.dislocationrune": "DisplacementRune", + "block.bloodmagic.duskritualstone": "Dusk Ritual Stone", + "block.bloodmagic.earthritualstone": "Earth Ritual Stone", + "block.bloodmagic.fireritualstone": "Fire Ritual Stone", + "block.bloodmagic.lightritualstone": "Dawn Ritual Stone", + "block.bloodmagic.masterritualstone": "Master Ritual Stone", "block.bloodmagic.orbcapacityrune": "Rune of the Orb", + "block.bloodmagic.ritualstone": "Ritual Stone", "block.bloodmagic.sacrificerune": "Rune of Sacrifice", "block.bloodmagic.selfsacrificerune": "Rune of Self Sacrifice", "block.bloodmagic.soulforge": "Hellfire Forge", "block.bloodmagic.speedrune": "Speed Rune", + "block.bloodmagic.waterritualstone": "Water Ritual Stone", + "chat.bloodmagic.ritual.activate": "A rush of energy flows through the ritual!", + "chat.bloodmagic.ritual.notValid": "You feel that these runes are not configured correctly...", + "chat.bloodmagic.ritual.prevent": "The ritual is actively resisting you!", + "chat.bloodmagic.ritual.weak": "You feel a push, but are too weak to perform this ritual.", + "item.bloodmagic.activationcrystalawakened": "Awakened Activation Crystal", + "item.bloodmagic.activationcrystalcreative": "Creative Activation Crystal", + "item.bloodmagic.activationcrystalweak": "Weak Activation Crystal", + "item.bloodmagic.airscribetool": "Inscription Tool: Air", "item.bloodmagic.airsigil": "Air Sigil", "item.bloodmagic.apprenticebloodorb": "Apprentice Blood Orb", "item.bloodmagic.arcaneashes": "Arcane Ashes", @@ -24,7 +40,10 @@ "item.bloodmagic.daggerofsacrifice": "Dagger of Sacrifice", "item.bloodmagic.demonslate": "Demonic Slate", "item.bloodmagic.divinationsigil": "Divination Sigil", + "item.bloodmagic.duskscribetool": "Inscription Tool: Dusk", + "item.bloodmagic.earthscribetool": "Inscription Tool: Earth", "item.bloodmagic.etherealslate": "Ethereal Slate", + "item.bloodmagic.firescribetool": "Inscription Tool: Fire", "item.bloodmagic.growthsigil": "Sigil of the Green Grove", "item.bloodmagic.icesigil": "Sigil of the Frozen Lake", "item.bloodmagic.infusedslate": "Imbued Slate", @@ -50,6 +69,7 @@ "item.bloodmagic.soulsnare": "Soul Snare", "item.bloodmagic.soulsword": "Sentient Sword", "item.bloodmagic.voidsigil": "Void Sigil", + "item.bloodmagic.waterscribetool": "Inscription Tool: Water", "item.bloodmagic.watersigil": "Water Sigil", "item.bloodmagic.weakbloodorb": "Weak Blood Orb", "itemGroup.bloodmagic.creativeTab": "Blood Magic", @@ -63,7 +83,37 @@ "jei.bloodmagic.recipe.requiredtier": "Tier: %d", "jei.bloodmagic.recipe.soulforge": "Hellfire Forge", "jei.bloodmagic.recipe.soulsdrained": "Drained: %s Will", + "ritual.bloodmagic.altarBuilderRitual": "The Assembly of the High Altar", + "ritual.bloodmagic.animalGrowthRitual": "Ritual of the Shepherd", + "ritual.bloodmagic.armourEvolveRitual": "Ritual of Living Evolution", + "ritual.bloodmagic.cobblestoneRitual": "Le Vulcanos Frigius", + "ritual.bloodmagic.containmentRitual": "Ritual of Containment", + "ritual.bloodmagic.crushingRitual": "Ritual of the Crusher", + "ritual.bloodmagic.expulsionRitual": "Aura of Expulsion", + "ritual.bloodmagic.featheredKnifeRitual": "Ritual of the Feathered Knife", + "ritual.bloodmagic.fellingRitual": "The Timberman", + "ritual.bloodmagic.fullStomachRitual": "Ritual of the Satiated Stomach", + "ritual.bloodmagic.greenGroveRitual": "Ritual of the Green Grove", + "ritual.bloodmagic.harvestRitual": "Reap of the Harvest Moon", + "ritual.bloodmagic.interdictionRitual": "Ritual of Interdiction", + "ritual.bloodmagic.jumpRitual": "Ritual of the High Jump", + "ritual.bloodmagic.lavaRitual": "Serenade of the Nether", + "ritual.bloodmagic.magneticRitual": "Ritual of Magnetism", + "ritual.bloodmagic.placerRitual": "The Filler", + "ritual.bloodmagic.portalRitual": "The Gate of the Fold", + "ritual.bloodmagic.pumpRitual": "Hymn of Siphoning", + "ritual.bloodmagic.regenerationRitual": "Ritual of Regeneration", + "ritual.bloodmagic.speedRitual": "Ritual of Speed", + "ritual.bloodmagic.suppressionRitual": "Ritual of Suppression", + "ritual.bloodmagic.testRitual": "Test Ritual", + "ritual.bloodmagic.upgradeRemoveRitual": "Sound of the Cleansing Soul", + "ritual.bloodmagic.waterRitual": "Ritual of the Full Spring", + "ritual.bloodmagic.wellOfSufferingRitual": "Well of Suffering", + "ritual.bloodmagic.zephyrRitual": "Call of the Zephyr", "tile.bloodmagic.soulforge.name": "Hellfire Forge", + "tooltip.bloodmagic.activationcrystal.awakened": "Activates more powerful rituals", + "tooltip.bloodmagic.activationcrystal.creative": "Creative Only - Activates any ritual", + "tooltip.bloodmagic.activationcrystal.weak": "Activates low-level rituals", "tooltip.bloodmagic.arcaneAshes": "Ashes used to draw an alchemy circle", "tooltip.bloodmagic.config.disabled": "Currently disabled in the Config", "tooltip.bloodmagic.currentBaseType.corrosive": "Corrosive", @@ -80,6 +130,17 @@ "tooltip.bloodmagic.currentType.vengeful": "Contains: Vengeful Will", "tooltip.bloodmagic.decoration.notSafe": "Dangerous for decoration", "tooltip.bloodmagic.decoration.safe": "Safe for decoration", + "tooltip.bloodmagic.diviner.airRune": "Air Runes: %d", + "tooltip.bloodmagic.diviner.blankRune": "Blank Runes: %d", + "tooltip.bloodmagic.diviner.currentDirection": "Current Direction: %s", + "tooltip.bloodmagic.diviner.currentRitual": "Current Ritual: %s", + "tooltip.bloodmagic.diviner.dawnRune": "Dawn Runes: %d", + "tooltip.bloodmagic.diviner.duskRune": "Dusk Runes: %d", + "tooltip.bloodmagic.diviner.earthRune": "Earth Runes: %d", + "tooltip.bloodmagic.diviner.extraInfo": "Press shift for extra info", + "tooltip.bloodmagic.diviner.fireRune": "Fire Runes: %d", + "tooltip.bloodmagic.diviner.totalRune": "Total Runes: %d", + "tooltip.bloodmagic.diviner.waterRune": "Water Runes: %d", "tooltip.bloodmagic.extraInfo": "&9-Hold shift for more info-", "tooltip.bloodmagic.orb.desc": "Stores raw Life Essence", "tooltip.bloodmagic.orb.owner": "Added by: %s", diff --git a/src/generated/resources/assets/bloodmagic/models/block/masterritualstone.json b/src/generated/resources/assets/bloodmagic/models/block/masterritualstone.json new file mode 100644 index 00000000..cbb503be --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/block/masterritualstone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "bloodmagic:block/masterritualstone" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/activationcrystalawakened.json b/src/generated/resources/assets/bloodmagic/models/item/activationcrystalawakened.json new file mode 100644 index 00000000..649ad064 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/activationcrystalawakened.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/activationcrystalawakened" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/activationcrystalcreative.json b/src/generated/resources/assets/bloodmagic/models/item/activationcrystalcreative.json new file mode 100644 index 00000000..3492cbfa --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/activationcrystalcreative.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/activationcrystalcreative" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/activationcrystalweak.json b/src/generated/resources/assets/bloodmagic/models/item/activationcrystalweak.json new file mode 100644 index 00000000..ad573a49 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/activationcrystalweak.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/activationcrystalweak" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/airscribetool.json b/src/generated/resources/assets/bloodmagic/models/item/airscribetool.json new file mode 100644 index 00000000..a8fef50d --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/airscribetool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/airscribetool" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/duskscribetool.json b/src/generated/resources/assets/bloodmagic/models/item/duskscribetool.json new file mode 100644 index 00000000..4f2c111c --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/duskscribetool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/duskscribetool" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/earthscribetool.json b/src/generated/resources/assets/bloodmagic/models/item/earthscribetool.json new file mode 100644 index 00000000..6cb9308c --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/earthscribetool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/earthscribetool" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/firescribetool.json b/src/generated/resources/assets/bloodmagic/models/item/firescribetool.json new file mode 100644 index 00000000..f5e0d3af --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/firescribetool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/firescribetool" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/masterritualstone.json b/src/generated/resources/assets/bloodmagic/models/item/masterritualstone.json new file mode 100644 index 00000000..84e36366 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/masterritualstone.json @@ -0,0 +1,3 @@ +{ + "parent": "bloodmagic:block/masterritualstone" +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/ritualdiviner.json b/src/generated/resources/assets/bloodmagic/models/item/ritualdiviner.json new file mode 100644 index 00000000..d0a26bd9 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/ritualdiviner.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/ritualdiviner" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/waterscribetool.json b/src/generated/resources/assets/bloodmagic/models/item/waterscribetool.json new file mode 100644 index 00000000..1c9aec5b --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/waterscribetool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/waterscribetool" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_blank.json b/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_blank.json new file mode 100644 index 00000000..ef6c9fdb --- /dev/null +++ b/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_blank.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "bloodmagic:ritual_stone_blank" + ] + }, + "criteria": { + "has_apprentice_orb": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "bloodmagic:apprenticebloodorb" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "bloodmagic:ritual_stone_blank" + } + } + }, + "requirements": [ + [ + "has_apprentice_orb", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_master.json b/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_master.json new file mode 100644 index 00000000..878c9ebb --- /dev/null +++ b/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/ritual_stone_master.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "bloodmagic:ritual_stone_master" + ] + }, + "criteria": { + "has_magician_orb": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "bloodmagic:magicianbloodorb" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "bloodmagic:ritual_stone_master" + } + } + }, + "requirements": [ + [ + "has_magician_orb", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/loot_tables/blocks/masterritualstone.json b/src/generated/resources/data/bloodmagic/loot_tables/blocks/masterritualstone.json new file mode 100644 index 00000000..8b9eb94d --- /dev/null +++ b/src/generated/resources/data/bloodmagic/loot_tables/blocks/masterritualstone.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "bloodmagic:masterritualstone" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/altar/air_tool.json b/src/generated/resources/data/bloodmagic/recipes/altar/air_tool.json new file mode 100644 index 00000000..a34cb046 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/altar/air_tool.json @@ -0,0 +1,14 @@ +{ + "type": "bloodmagic:altar", + "input": { + "item": "minecraft:ghast_tear" + }, + "output": { + "item": "bloodmagic:airscribetool", + "nbt": "{Damage:0}" + }, + "upgradeLevel": 2, + "altarSyphon": 1000, + "consumptionRate": 5, + "drainRate": 5 +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/altar/dusk_tool.json b/src/generated/resources/data/bloodmagic/recipes/altar/dusk_tool.json new file mode 100644 index 00000000..a8a08519 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/altar/dusk_tool.json @@ -0,0 +1,14 @@ +{ + "type": "bloodmagic:altar", + "input": { + "tag": "forge:storage_blocks/coal" + }, + "output": { + "item": "bloodmagic:duskscribetool", + "nbt": "{Damage:0}" + }, + "upgradeLevel": 3, + "altarSyphon": 2000, + "consumptionRate": 20, + "drainRate": 10 +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/altar/earth_tool.json b/src/generated/resources/data/bloodmagic/recipes/altar/earth_tool.json new file mode 100644 index 00000000..72ddfcc8 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/altar/earth_tool.json @@ -0,0 +1,14 @@ +{ + "type": "bloodmagic:altar", + "input": { + "tag": "forge:obsidian" + }, + "output": { + "item": "bloodmagic:earthscribetool", + "nbt": "{Damage:0}" + }, + "upgradeLevel": 2, + "altarSyphon": 1000, + "consumptionRate": 5, + "drainRate": 5 +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/altar/fire_tool.json b/src/generated/resources/data/bloodmagic/recipes/altar/fire_tool.json new file mode 100644 index 00000000..859c6e17 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/altar/fire_tool.json @@ -0,0 +1,14 @@ +{ + "type": "bloodmagic:altar", + "input": { + "item": "minecraft:magma_cream" + }, + "output": { + "item": "bloodmagic:firescribetool", + "nbt": "{Damage:0}" + }, + "upgradeLevel": 2, + "altarSyphon": 1000, + "consumptionRate": 5, + "drainRate": 5 +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/altar/water_tool.json b/src/generated/resources/data/bloodmagic/recipes/altar/water_tool.json new file mode 100644 index 00000000..95508bc1 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/altar/water_tool.json @@ -0,0 +1,14 @@ +{ + "type": "bloodmagic:altar", + "input": { + "tag": "forge:storage_blocks/lapis" + }, + "output": { + "item": "bloodmagic:waterscribetool", + "nbt": "{Damage:0}" + }, + "upgradeLevel": 2, + "altarSyphon": 1000, + "consumptionRate": 5, + "drainRate": 5 +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/ritual_stone_blank.json b/src/generated/resources/data/bloodmagic/recipes/ritual_stone_blank.json new file mode 100644 index 00000000..aa493752 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/ritual_stone_blank.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "aba", + "bcb", + "aba" + ], + "key": { + "a": { + "tag": "forge:obsidian" + }, + "b": { + "item": "bloodmagic:reinforcedslate" + }, + "c": { + "type": "bloodmagic:bloodorb", + "orb_tier": 2 + } + }, + "result": { + "item": "bloodmagic:ritualstone", + "count": 4 + } +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/ritual_stone_master.json b/src/generated/resources/data/bloodmagic/recipes/ritual_stone_master.json new file mode 100644 index 00000000..4cdb269e --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/ritual_stone_master.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "aba", + "bcb", + "aba" + ], + "key": { + "a": { + "tag": "forge:obsidian" + }, + "b": { + "item": "bloodmagic:ritualstone" + }, + "c": { + "type": "bloodmagic:bloodorb", + "orb_tier": 3 + } + }, + "result": { + "item": "bloodmagic:masterritualstone" + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/BloodMagic.java b/src/main/java/WayofTime/bloodmagic/BloodMagic.java index fb69752f..2fc39a67 100644 --- a/src/main/java/WayofTime/bloodmagic/BloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/BloodMagic.java @@ -52,6 +52,7 @@ import wayoftime.bloodmagic.potion.BloodMagicPotions; import wayoftime.bloodmagic.ritual.RitualManager; import wayoftime.bloodmagic.tile.TileAlchemyArray; import wayoftime.bloodmagic.tile.TileAltar; +import wayoftime.bloodmagic.tile.TileMasterRitualStone; import wayoftime.bloodmagic.tile.TileSoulForge; import wayoftime.bloodmagic.util.handler.event.GenericHandler; import wayoftime.bloodmagic.util.handler.event.WillHandler; @@ -149,6 +150,7 @@ public class BloodMagic event.getRegistry().register(TileEntityType.Builder.create(TileAltar::new, BloodMagicBlocks.BLOOD_ALTAR.get()).build(null).setRegistryName("altar")); event.getRegistry().register(TileEntityType.Builder.create(TileAlchemyArray::new, BloodMagicBlocks.ALCHEMY_ARRAY.get()).build(null).setRegistryName("alchemyarray")); event.getRegistry().register(TileEntityType.Builder.create(TileSoulForge::new, BloodMagicBlocks.SOUL_FORGE.get()).build(null).setRegistryName("soulforge")); + event.getRegistry().register(TileEntityType.Builder.create(TileMasterRitualStone::new, BloodMagicBlocks.MASTER_RITUAL_STONE.get()).build(null).setRegistryName("masterritualstone")); } @SubscribeEvent diff --git a/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java b/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java index e30c3cb1..ed85e794 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java @@ -3,7 +3,6 @@ package wayoftime.bloodmagic.client.render.block; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; -import net.minecraft.block.RedstoneBlock; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Atlases; import net.minecraft.client.renderer.IRenderTypeBuffer; @@ -40,7 +39,6 @@ public class RenderAltar extends TileEntityRenderer @Override public void render(TileAltar tileAltar, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLightIn, int combinedOverlayIn) { - RedstoneBlock d; ItemStack inputStack = tileAltar.getStackInSlot(0); float level = ((float) tileAltar.getCurrentBlood()) / (float) tileAltar.getCapacity(); diff --git a/src/main/java/WayofTime/bloodmagic/util/Utils.java b/src/main/java/WayofTime/bloodmagic/util/Utils.java index 4c78886f..061e85ea 100644 --- a/src/main/java/WayofTime/bloodmagic/util/Utils.java +++ b/src/main/java/WayofTime/bloodmagic/util/Utils.java @@ -1,5 +1,7 @@ package wayoftime.bloodmagic.util; +import java.util.Locale; + import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraftforge.items.ItemHandlerHelper; @@ -48,4 +50,9 @@ public class Utils return false; } + + public static String toFancyCasing(String input) + { + return String.valueOf(input.charAt(0)).toUpperCase(Locale.ENGLISH) + input.substring(1); + } } diff --git a/src/main/java/wayoftime/bloodmagic/client/render/block/RenderFakeBlocks.java b/src/main/java/wayoftime/bloodmagic/client/render/block/RenderFakeBlocks.java new file mode 100644 index 00000000..50f5a5f2 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/client/render/block/RenderFakeBlocks.java @@ -0,0 +1,66 @@ +package wayoftime.bloodmagic.client.render.block; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.AtlasTexture; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; + +public class RenderFakeBlocks +{ + public static void drawFakeBlock(TextureAtlasSprite texture, double minX, double minY, double minZ) + { + if (texture == null) + return; + + double maxX = minX + 1; + double maxY = minY + 1; + double maxZ = minZ + 1; + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder wr = tessellator.getBuffer(); + + Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(texture.getName()); + + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + + float texMinU = texture.getMinU(); + float texMinV = texture.getMinV(); + float texMaxU = texture.getMaxU(); + float texMaxV = texture.getMaxV(); + + wr.pos(minX, minY, minZ).tex(texMinU, texMinV).endVertex(); + wr.pos(maxX, minY, minZ).tex(texMaxU, texMinV).endVertex(); + wr.pos(maxX, minY, maxZ).tex(texMaxU, texMaxV).endVertex(); + wr.pos(minX, minY, maxZ).tex(texMinU, texMaxV).endVertex(); + + wr.pos(minX, maxY, maxZ).tex(texMinU, texMaxV).endVertex(); + wr.pos(maxX, maxY, maxZ).tex(texMaxU, texMaxV).endVertex(); + wr.pos(maxX, maxY, minZ).tex(texMaxU, texMinV).endVertex(); + wr.pos(minX, maxY, minZ).tex(texMinU, texMinV).endVertex(); + + wr.pos(maxX, minY, minZ).tex(texMinU, texMaxV).endVertex(); + wr.pos(minX, minY, minZ).tex(texMaxU, texMaxV).endVertex(); + wr.pos(minX, maxY, minZ).tex(texMaxU, texMinV).endVertex(); + wr.pos(maxX, maxY, minZ).tex(texMinU, texMinV).endVertex(); + + wr.pos(minX, minY, maxZ).tex(texMinU, texMaxV).endVertex(); + wr.pos(maxX, minY, maxZ).tex(texMaxU, texMaxV).endVertex(); + wr.pos(maxX, maxY, maxZ).tex(texMaxU, texMinV).endVertex(); + wr.pos(minX, maxY, maxZ).tex(texMinU, texMinV).endVertex(); + + wr.pos(minX, minY, minZ).tex(texMinU, texMaxV).endVertex(); + wr.pos(minX, minY, maxZ).tex(texMaxU, texMaxV).endVertex(); + wr.pos(minX, maxY, maxZ).tex(texMaxU, texMinV).endVertex(); + wr.pos(minX, maxY, minZ).tex(texMinU, texMinV).endVertex(); + + wr.pos(maxX, minY, maxZ).tex(texMinU, texMaxV).endVertex(); + wr.pos(maxX, minY, minZ).tex(texMaxU, texMaxV).endVertex(); + wr.pos(maxX, maxY, minZ).tex(texMaxU, texMinV).endVertex(); + wr.pos(maxX, maxY, maxZ).tex(texMinU, texMinV).endVertex(); + + tessellator.draw(); + } +} diff --git a/src/main/java/wayoftime/bloodmagic/common/block/BlockMasterRitualStone.java b/src/main/java/wayoftime/bloodmagic/common/block/BlockMasterRitualStone.java index 7fb09854..f1113705 100644 --- a/src/main/java/wayoftime/bloodmagic/common/block/BlockMasterRitualStone.java +++ b/src/main/java/wayoftime/bloodmagic/common/block/BlockMasterRitualStone.java @@ -66,15 +66,15 @@ public class BlockMasterRitualStone extends Block } } else { - player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true); + player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notvalid"), true); } } else { - player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true); + player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notvalid"), true); } } else { - player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true); + player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notvalid"), true); } } } diff --git a/src/main/java/wayoftime/bloodmagic/common/block/BlockRitualStone.java b/src/main/java/wayoftime/bloodmagic/common/block/BlockRitualStone.java index d76bfe60..e8600607 100644 --- a/src/main/java/wayoftime/bloodmagic/common/block/BlockRitualStone.java +++ b/src/main/java/wayoftime/bloodmagic/common/block/BlockRitualStone.java @@ -58,7 +58,7 @@ public class BlockRitualStone extends Block implements IRitualStone public void setRuneType(World world, BlockPos pos, EnumRuneType runeType) { Block runeBlock = this; - switch (type) + switch (runeType) { case AIR: runeBlock = BloodMagicBlocks.AIR_RITUAL_STONE.get(); diff --git a/src/main/java/wayoftime/bloodmagic/common/data/GeneratorBaseRecipes.java b/src/main/java/wayoftime/bloodmagic/common/data/GeneratorBaseRecipes.java index 60f56a5f..1d445664 100644 --- a/src/main/java/wayoftime/bloodmagic/common/data/GeneratorBaseRecipes.java +++ b/src/main/java/wayoftime/bloodmagic/common/data/GeneratorBaseRecipes.java @@ -45,6 +45,8 @@ public class GeneratorBaseRecipes extends BaseRecipeProvider ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.CAPACITY_RUNE.get()).key('a', Tags.Items.STONE).key('b', Items.BUCKET).key('c', BloodMagicBlocks.BLANK_RUNE.get()).key('d', BloodMagicItems.IMBUED_SLATE.get()).patternLine("aba").patternLine("bcb").patternLine("ada").addCriterion("has_imbued_slate", hasItem(BloodMagicItems.IMBUED_SLATE.get())).build(consumer, BloodMagic.rl("blood_rune_capacity")); ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.ORB_RUNE.get()).key('a', Tags.Items.STONE).key('b', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_WEAK.get())).key('c', BloodMagicBlocks.BLANK_RUNE.get()).key('d', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MASTER.get())).patternLine("aba").patternLine("cdc").patternLine("aba").addCriterion("has_master_orb", hasItem(BloodMagicItems.MASTER_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("blood_rune_orb")); ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.CHARGING_RUNE.get()).key('R', Tags.Items.DUSTS_REDSTONE).key('r', BloodMagicBlocks.BLANK_RUNE.get()).key('s', BloodMagicItems.DEMONIC_SLATE.get()).key('e', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MASTER.get())).key('G', Tags.Items.DUSTS_GLOWSTONE).patternLine("RsR").patternLine("GrG").patternLine("ReR").addCriterion("has_master_orb", hasItem(BloodMagicItems.MASTER_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("blood_rune_charging")); + ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.BLANK_RITUAL_STONE.get(), 4).key('a', Tags.Items.OBSIDIAN).key('b', BloodMagicItems.REINFORCED_SLATE.get()).key('c', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_APPRENTICE.get())).patternLine("aba").patternLine("bcb").patternLine("aba").addCriterion("has_apprentice_orb", hasItem(BloodMagicItems.APPRENTICE_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("ritual_stone_blank")); + ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.MASTER_RITUAL_STONE.get()).key('a', Tags.Items.OBSIDIAN).key('b', BloodMagicBlocks.BLANK_RITUAL_STONE.get()).key('c', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MAGICIAN.get())).patternLine("aba").patternLine("bcb").patternLine("aba").addCriterion("has_magician_orb", hasItem(BloodMagicItems.MAGICIAN_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("ritual_stone_master")); // ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.SPEED_RUNE.get()).key('s', Items.GLASS).key('o', Ingredient.fromItems(Items.DIAMOND)).patternLine("sss").patternLine("sos").patternLine("sss").addCriterion("has_diamond", hasItem(Items.DIAMOND)).build(consumer, new ResourceLocation(BloodMagic.MODID, "speed_rune_from_standard")); // ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.SPEED_RUNE.get()).key('s', Items.GLASS).key('o', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_WEAK.get())).patternLine("sss").patternLine("sos").patternLine("sss").addCriterion("has_diamond", hasItem(Items.DIAMOND)).build(consumer, new ResourceLocation(BloodMagic.MODID, "speed_rune_from_orb")); } diff --git a/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java b/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java index e72dabd6..1f9f67dc 100644 --- a/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java +++ b/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java @@ -81,8 +81,54 @@ public class GeneratorLanguage extends LanguageProvider add("tooltip.bloodmagic.sigil.air.desc", "I feel lighter already..."); add("tooltip.bloodmagic.sigil.bloodlight.desc", "I see a light!"); + add("tooltip.bloodmagic.activationcrystal.weak", "Activates low-level rituals"); + add("tooltip.bloodmagic.activationcrystal.awakened", "Activates more powerful rituals"); + add("tooltip.bloodmagic.activationcrystal.creative", "Creative Only - Activates any ritual"); + add("itemGroup.bloodmagictab", "Blood Magic"); + // Ritual info + add("tooltip.bloodmagic.diviner.currentRitual", "Current Ritual: %s"); + add("tooltip.bloodmagic.diviner.blankRune", "Blank Runes: %d"); + add("tooltip.bloodmagic.diviner.waterRune", "Water Runes: %d"); + add("tooltip.bloodmagic.diviner.airRune", "Air Runes: %d"); + add("tooltip.bloodmagic.diviner.fireRune", "Fire Runes: %d"); + add("tooltip.bloodmagic.diviner.earthRune", "Earth Runes: %d"); + add("tooltip.bloodmagic.diviner.duskRune", "Dusk Runes: %d"); + add("tooltip.bloodmagic.diviner.dawnRune", "Dawn Runes: %d"); + add("tooltip.bloodmagic.diviner.totalRune", "Total Runes: %d"); + add("tooltip.bloodmagic.diviner.extraInfo", "Press shift for extra info"); + add("tooltip.bloodmagic.diviner.currentDirection", "Current Direction: %s"); + + add("ritual.bloodmagic.testRitual", "Test Ritual"); + add("ritual.bloodmagic.waterRitual", "Ritual of the Full Spring"); + add("ritual.bloodmagic.lavaRitual", "Serenade of the Nether"); + add("ritual.bloodmagic.greenGroveRitual", "Ritual of the Green Grove"); + add("ritual.bloodmagic.jumpRitual", "Ritual of the High Jump"); + add("ritual.bloodmagic.wellOfSufferingRitual", "Well of Suffering"); + add("ritual.bloodmagic.featheredKnifeRitual", "Ritual of the Feathered Knife"); + add("ritual.bloodmagic.regenerationRitual", "Ritual of Regeneration"); + add("ritual.bloodmagic.harvestRitual", "Reap of the Harvest Moon"); + add("ritual.bloodmagic.magneticRitual", "Ritual of Magnetism"); + add("ritual.bloodmagic.crushingRitual", "Ritual of the Crusher"); + add("ritual.bloodmagic.fullStomachRitual", "Ritual of the Satiated Stomach"); + add("ritual.bloodmagic.interdictionRitual", "Ritual of Interdiction"); + add("ritual.bloodmagic.containmentRitual", "Ritual of Containment"); + add("ritual.bloodmagic.speedRitual", "Ritual of Speed"); + add("ritual.bloodmagic.suppressionRitual", "Ritual of Suppression"); + add("ritual.bloodmagic.expulsionRitual", "Aura of Expulsion"); + add("ritual.bloodmagic.zephyrRitual", "Call of the Zephyr"); + add("ritual.bloodmagic.upgradeRemoveRitual", "Sound of the Cleansing Soul"); + add("ritual.bloodmagic.armourEvolveRitual", "Ritual of Living Evolution"); + add("ritual.bloodmagic.animalGrowthRitual", "Ritual of the Shepherd"); + + add("ritual.bloodmagic.cobblestoneRitual", "Le Vulcanos Frigius"); + add("ritual.bloodmagic.placerRitual", "The Filler"); + add("ritual.bloodmagic.fellingRitual", "The Timberman"); + add("ritual.bloodmagic.pumpRitual", "Hymn of Siphoning"); + add("ritual.bloodmagic.altarBuilderRitual", "The Assembly of the High Altar"); + add("ritual.bloodmagic.portalRitual", "The Gate of the Fold"); + // Block names addBlock(BloodMagicBlocks.BLANK_RUNE, "Blank Rune"); addBlock(BloodMagicBlocks.SPEED_RUNE, "Speed Rune"); @@ -96,6 +142,14 @@ public class GeneratorLanguage extends LanguageProvider addBlock(BloodMagicBlocks.CHARGING_RUNE, "Charging Rune"); addBlock(BloodMagicBlocks.BLOOD_ALTAR, "Blood Altar"); addBlock(BloodMagicBlocks.SOUL_FORGE, "Hellfire Forge"); + addBlock(BloodMagicBlocks.BLANK_RITUAL_STONE, "Ritual Stone"); + addBlock(BloodMagicBlocks.AIR_RITUAL_STONE, "Air Ritual Stone"); + addBlock(BloodMagicBlocks.WATER_RITUAL_STONE, "Water Ritual Stone"); + addBlock(BloodMagicBlocks.FIRE_RITUAL_STONE, "Fire Ritual Stone"); + addBlock(BloodMagicBlocks.EARTH_RITUAL_STONE, "Earth Ritual Stone"); + addBlock(BloodMagicBlocks.DUSK_RITUAL_STONE, "Dusk Ritual Stone"); + addBlock(BloodMagicBlocks.DAWN_RITUAL_STONE, "Dawn Ritual Stone"); + addBlock(BloodMagicBlocks.MASTER_RITUAL_STONE, "Master Ritual Stone"); // Item names addItem(BloodMagicItems.WEAK_BLOOD_ORB, "Weak Blood Orb"); @@ -144,6 +198,15 @@ public class GeneratorLanguage extends LanguageProvider addItem(BloodMagicItems.SOUL_SNARE, "Soul Snare"); addItem(BloodMagicItems.SENTIENT_SWORD, "Sentient Sword"); + addItem(BloodMagicItems.WEAK_ACTIVATION_CRYSTAL, "Weak Activation Crystal"); + addItem(BloodMagicItems.AWAKENED_ACTIVATION_CRYSTAL, "Awakened Activation Crystal"); + addItem(BloodMagicItems.CREATIVE_ACTIVATION_CRYSTAL, "Creative Activation Crystal"); + addItem(BloodMagicItems.WATER_INSCRIPTION_TOOL, "Inscription Tool: Water"); + addItem(BloodMagicItems.FIRE_INSCRIPTION_TOOL, "Inscription Tool: Fire"); + addItem(BloodMagicItems.EARTH_INSCRIPTION_TOOL, "Inscription Tool: Earth"); + addItem(BloodMagicItems.AIR_INSCRIPTION_TOOL, "Inscription Tool: Air"); + addItem(BloodMagicItems.DUSK_INSCRIPTION_TOOL, "Inscription Tool: Dusk"); + // addItem(BloodMagicItems , ""); // JEI @@ -157,5 +220,12 @@ public class GeneratorLanguage extends LanguageProvider add("jei.bloodmagic.recipe.altar", "Blood Altar"); add("jei.bloodmagic.recipe.soulforge", "Hellfire Forge"); add("jei.bloodmagic.recipe.alchemyarraycrafting", "Alchemy Array"); + + // Chat + add("chat.bloodmagic.ritual.weak", "You feel a push, but are too weak to perform this ritual."); + add("chat.bloodmagic.ritual.prevent", "The ritual is actively resisting you!"); + add("chat.bloodmagic.ritual.activate", "A rush of energy flows through the ritual!"); + add("chat.bloodmagic.ritual.notValid", "You feel that these runes are not configured correctly..."); + } } diff --git a/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java b/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java index f79ae7b2..86307df1 100644 --- a/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java +++ b/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java @@ -25,6 +25,7 @@ import wayoftime.bloodmagic.common.item.soul.ItemSoulSnare; import wayoftime.bloodmagic.common.registration.impl.BloodOrbDeferredRegister; import wayoftime.bloodmagic.common.registration.impl.BloodOrbRegistryObject; import wayoftime.bloodmagic.orb.BloodOrb; +import wayoftime.bloodmagic.ritual.EnumRuneType; import wayoftime.bloodmagic.will.EnumDemonWillType; public class BloodMagicItems @@ -62,6 +63,8 @@ public class BloodMagicItems public static final RegistryObject DUSK_RITUAL_STONE_ITEM = ITEMS.register("duskritualstone", () -> new BlockItem(BloodMagicBlocks.DUSK_RITUAL_STONE.get(), new Item.Properties().group(BloodMagic.TAB))); public static final RegistryObject DAWN_RITUAL_STONE_ITEM = ITEMS.register("lightritualstone", () -> new BlockItem(BloodMagicBlocks.DAWN_RITUAL_STONE.get(), new Item.Properties().group(BloodMagic.TAB))); + public static final RegistryObject MASTER_RITUAL_STONE_ITEM = ITEMS.register("masterritualstone", () -> new BlockItem(BloodMagicBlocks.MASTER_RITUAL_STONE.get(), new Item.Properties().group(BloodMagic.TAB))); + public static final RegistryObject BLOOD_ALTAR_ITEM = ITEMS.register("altar", () -> new BlockItem(BloodMagicBlocks.BLOOD_ALTAR.get(), new Item.Properties().group(BloodMagic.TAB))); // TODO: Need to rework the above instantiations for the ItemBlocks so that it's @@ -94,10 +97,19 @@ public class BloodMagicItems public static final RegistryObject ARCANE_ASHES = BASICITEMS.register("arcaneashes", () -> new ItemArcaneAshes()); public static final RegistryObject DAGGER_OF_SACRIFICE = BASICITEMS.register("daggerofsacrifice", () -> new ItemDaggerOfSacrifice()); + // Ritual stuffs public static final RegistryObject WEAK_ACTIVATION_CRYSTAL = BASICITEMS.register("activationcrystalweak", () -> new ItemActivationCrystal(ItemActivationCrystal.CrystalType.WEAK)); public static final RegistryObject AWAKENED_ACTIVATION_CRYSTAL = BASICITEMS.register("activationcrystalawakened", () -> new ItemActivationCrystal(ItemActivationCrystal.CrystalType.AWAKENED)); public static final RegistryObject CREATIVE_ACTIVATION_CRYSTAL = BASICITEMS.register("activationcrystalcreative", () -> new ItemActivationCrystal(ItemActivationCrystal.CrystalType.CREATIVE)); + public static final RegistryObject AIR_INSCRIPTION_TOOL = BASICITEMS.register("airscribetool", () -> new ItemInscriptionTool(EnumRuneType.AIR)); + public static final RegistryObject FIRE_INSCRIPTION_TOOL = BASICITEMS.register("firescribetool", () -> new ItemInscriptionTool(EnumRuneType.FIRE)); + public static final RegistryObject WATER_INSCRIPTION_TOOL = BASICITEMS.register("waterscribetool", () -> new ItemInscriptionTool(EnumRuneType.WATER)); + public static final RegistryObject EARTH_INSCRIPTION_TOOL = BASICITEMS.register("earthscribetool", () -> new ItemInscriptionTool(EnumRuneType.EARTH)); + public static final RegistryObject DUSK_INSCRIPTION_TOOL = BASICITEMS.register("duskscribetool", () -> new ItemInscriptionTool(EnumRuneType.DUSK)); + + public static final RegistryObject BASE_RITUAL_DIVINER = BASICITEMS.register("ritualdiviner", () -> new ItemRitualDiviner(0)); + // Reagents used to make the Sigils public static final RegistryObject REAGENT_WATER = BASICITEMS.register("reagentwater", () -> new ItemBase()); public static final RegistryObject REAGENT_LAVA = BASICITEMS.register("reagentlava", () -> new ItemBase()); diff --git a/src/main/java/wayoftime/bloodmagic/common/item/ItemActivationCrystal.java b/src/main/java/wayoftime/bloodmagic/common/item/ItemActivationCrystal.java index 83d97492..f6df51f4 100644 --- a/src/main/java/wayoftime/bloodmagic/common/item/ItemActivationCrystal.java +++ b/src/main/java/wayoftime/bloodmagic/common/item/ItemActivationCrystal.java @@ -30,7 +30,7 @@ public class ItemActivationCrystal extends Item implements IBindable @OnlyIn(Dist.CLIENT) public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag flag) { - tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.activation_crystal." + type.name().toLowerCase())); + tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.activationcrystal." + type.name().toLowerCase())); if (!stack.hasTag()) return; diff --git a/src/main/java/wayoftime/bloodmagic/common/item/ItemInscriptionTool.java b/src/main/java/wayoftime/bloodmagic/common/item/ItemInscriptionTool.java new file mode 100644 index 00000000..2b2c7f74 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/common/item/ItemInscriptionTool.java @@ -0,0 +1,66 @@ +package wayoftime.bloodmagic.common.item; + +import java.util.List; + +import net.minecraft.block.BlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.inventory.EquipmentSlotType; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUseContext; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import wayoftime.bloodmagic.BloodMagic; +import wayoftime.bloodmagic.common.block.BlockRitualStone; +import wayoftime.bloodmagic.ritual.EnumRuneType; +import wayoftime.bloodmagic.util.helper.TextHelper; + +public class ItemInscriptionTool extends Item +{ + private final EnumRuneType type; + + public ItemInscriptionTool(EnumRuneType type) + { + super(new Item.Properties().maxStackSize(1).group(BloodMagic.TAB).maxDamage(40)); + + this.type = type; + } + + @Override + public ActionResultType onItemUse(ItemUseContext context) + { + ItemStack stack = context.getItem(); + BlockPos pos = context.getPos(); + World world = context.getWorld(); + PlayerEntity player = context.getPlayer(); + BlockState state = world.getBlockState(pos); + + if (state.getBlock() instanceof BlockRitualStone + && !((BlockRitualStone) state.getBlock()).isRuneType(world, pos, type)) + { + ((BlockRitualStone) state.getBlock()).setRuneType(world, pos, type); + if (!player.isCreative()) + { + stack.damageItem(1, player, (entity) -> { + entity.sendBreakAnimation(EquipmentSlotType.MAINHAND); + }); + } + return ActionResultType.SUCCESS; + } + + return ActionResultType.FAIL; + } + + @Override + @OnlyIn(Dist.CLIENT) + public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag flag) + { + tooltip.add(new TranslationTextComponent(TextHelper.localizeEffect("tooltip.bloodmagic.inscriber.desc"))); + } +} diff --git a/src/main/java/wayoftime/bloodmagic/common/item/ItemRitualDiviner.java b/src/main/java/wayoftime/bloodmagic/common/item/ItemRitualDiviner.java new file mode 100644 index 00000000..f3ace9d3 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/common/item/ItemRitualDiviner.java @@ -0,0 +1,591 @@ +package wayoftime.bloodmagic.common.item; + +import java.util.Collections; +import java.util.List; + +import com.google.common.collect.Lists; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUseContext; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResult; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; +import net.minecraft.util.Hand; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceContext; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import wayoftime.bloodmagic.BloodMagic; +import wayoftime.bloodmagic.common.block.BlockRitualStone; +import wayoftime.bloodmagic.common.block.BloodMagicBlocks; +import wayoftime.bloodmagic.ritual.EnumRuneType; +import wayoftime.bloodmagic.ritual.Ritual; +import wayoftime.bloodmagic.ritual.RitualComponent; +import wayoftime.bloodmagic.tile.TileMasterRitualStone; +import wayoftime.bloodmagic.util.Constants; +import wayoftime.bloodmagic.util.Utils; +import wayoftime.bloodmagic.util.handler.event.ClientHandler; +import wayoftime.bloodmagic.util.helper.RitualHelper; +import wayoftime.bloodmagic.util.helper.TextHelper; +import wayoftime.bloodmagic.will.EnumDemonWillType; + +public class ItemRitualDiviner extends Item +{ + final int type; + public static final String tooltipBase = "tooltip.bloodmagic.diviner."; + public static String[] names = + { "normal", "dusk", "dawn" }; + + public ItemRitualDiviner(int type) + { + super(new Item.Properties().maxStackSize(1).group(BloodMagic.TAB)); + this.type = type; + } + +// @Override +// public String getHighlightTip(ItemStack stack, String displayName) +// { +// if (Strings.isNullOrEmpty(getCurrentRitual(stack))) +// return displayName; +// +// Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(getCurrentRitual(stack)); +// if (ritual == null) +// return displayName; +// +// return displayName + ": " + TextHelper.localize(ritual.getTranslationKey()); +// } + + @Override + public ActionResultType onItemUse(ItemUseContext context) + { + ItemStack stack = context.getPlayer().getHeldItem(context.getHand()); + if (context.getPlayer().isSneaking()) + { + if (context.getWorld().isRemote) + { + trySetDisplayedRitual(stack, context.getWorld(), context.getPos()); + } + + return ActionResultType.SUCCESS; + } else if (addRuneToRitual(stack, context.getWorld(), context.getPos(), context.getPlayer())) + { + if (context.getWorld().isRemote) + { + spawnParticles(context.getWorld(), context.getPos().offset(context.getFace()), 15); + } + + return ActionResultType.SUCCESS; + // TODO: Have the diviner automagically build the ritual + } + + return ActionResultType.PASS; + } + + /** + * Adds a single rune to the ritual. + * + * @param stack - The Ritual Diviner stack + * @param world - The World + * @param pos - Block Position of the MRS. + * @param player - The Player attempting to place the ritual + * @return - True if a rune was successfully added + */ + public boolean addRuneToRitual(ItemStack stack, World world, BlockPos pos, PlayerEntity player) + { + TileEntity tile = world.getTileEntity(pos); + + if (tile instanceof TileMasterRitualStone) + { + Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(this.getCurrentRitual(stack)); + if (ritual != null) + { + Direction direction = getDirection(stack); + List components = Lists.newArrayList(); + ritual.gatherComponents(components::add); + for (RitualComponent component : components) + { + if (!canPlaceRitualStone(component.getRuneType(), stack)) + { + return false; + } + BlockPos offset = component.getOffset(direction); + BlockPos newPos = pos.add(offset); + BlockState state = world.getBlockState(newPos); + Block block = state.getBlock(); + if (RitualHelper.isRune(world, newPos)) + { + if (RitualHelper.isRuneType(world, newPos, component.getRuneType())) + { + if (world.isRemote) + { + undisplayHologram(); + } + } else + { + // Replace existing ritual stone + RitualHelper.setRuneType(world, newPos, component.getRuneType()); + return true; + } + } else if (block.isAir(state, world, newPos))// || block.isReplaceable(world, newPos)) + { + if (!consumeStone(stack, world, player)) + { + return false; + } + ((BlockRitualStone) BloodMagicBlocks.BLANK_RITUAL_STONE.get()).setRuneType(world, newPos, component.getRuneType()); + return true; + } else + { + return false; // TODO: Possibly replace the block with a + // ritual stone + } + } + } + } + + return false; + } + + @OnlyIn(Dist.CLIENT) + public void trySetDisplayedRitual(ItemStack itemStack, World world, BlockPos pos) + { + TileEntity tile = world.getTileEntity(pos); + + if (tile instanceof TileMasterRitualStone) + { + Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(this.getCurrentRitual(itemStack)); + TileMasterRitualStone masterRitualStone = (TileMasterRitualStone) tile; + + if (ritual != null) + { + Direction direction = getDirection(itemStack); + ClientHandler.setRitualHolo(masterRitualStone, ritual, direction, true); + } + } + } + + @OnlyIn(Dist.CLIENT) + public void undisplayHologram() + { + ClientHandler.setRitualHoloToNull(); + } + + // TODO: Make this work for any IRitualStone + public boolean consumeStone(ItemStack stack, World world, PlayerEntity player) + { + if (player.isCreative()) + { + return true; + } + + NonNullList inventory = player.inventory.mainInventory; + for (ItemStack newStack : inventory) + { + if (newStack.isEmpty()) + { + + continue; + } + Item item = newStack.getItem(); + if (item instanceof BlockItem) + { + Block block = ((BlockItem) item).getBlock(); + if (block instanceof BlockRitualStone) + { + newStack.shrink(1); + return true; + } + } + } + + return false; + } + + @Override + @OnlyIn(Dist.CLIENT) + public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag flag) + { + if (!stack.hasTag()) + return; + + Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(this.getCurrentRitual(stack)); + if (ritual != null) + { + tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.diviner.currentRitual", new TranslationTextComponent(ritual.getTranslationKey()))); + + boolean sneaking = Screen.hasShiftDown(); +// boolean extraInfo = sneaking && Keyboard.isKeyDown(Keyboard.KEY_M); + boolean extraInfo = Screen.hasAltDown(); + + if (extraInfo) + { + tooltip.add(new StringTextComponent("")); + + for (EnumDemonWillType type : EnumDemonWillType.values()) + { + if (TextHelper.canTranslate(ritual.getTranslationKey() + "." + type.name().toLowerCase() + ".info")) + { + tooltip.add(new TranslationTextComponent(ritual.getTranslationKey() + "." + type.name().toLowerCase() + ".info")); + } + } + } else if (sneaking) + { + tooltip.add(new TranslationTextComponent(tooltipBase + "currentDirection", Utils.toFancyCasing(getDirection(stack).name()))); + tooltip.add(new StringTextComponent("")); + List components = Lists.newArrayList(); + ritual.gatherComponents(components::add); + + int blankRunes = 0; + int airRunes = 0; + int waterRunes = 0; + int fireRunes = 0; + int earthRunes = 0; + int duskRunes = 0; + int dawnRunes = 0; + int totalRunes = components.size(); + + for (RitualComponent component : components) + { + switch (component.getRuneType()) + { + case BLANK: + blankRunes++; + break; + case AIR: + airRunes++; + break; + case EARTH: + earthRunes++; + break; + case FIRE: + fireRunes++; + break; + case WATER: + waterRunes++; + break; + case DUSK: + duskRunes++; + break; + case DAWN: + dawnRunes++; + break; + } + } + + if (blankRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "blankRune", blankRunes).mergeStyle(EnumRuneType.BLANK.colorCode)); + if (waterRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "waterRune", waterRunes).mergeStyle(EnumRuneType.WATER.colorCode)); + if (airRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "airRune", airRunes).mergeStyle(EnumRuneType.AIR.colorCode)); + if (fireRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "fireRune", fireRunes).mergeStyle(EnumRuneType.FIRE.colorCode)); + if (earthRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "earthRune", earthRunes).mergeStyle(EnumRuneType.EARTH.colorCode)); + if (duskRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "duskRune", duskRunes).mergeStyle(EnumRuneType.DUSK.colorCode)); + if (dawnRunes > 0) + tooltip.add(new TranslationTextComponent(tooltipBase + "dawnRune", dawnRunes).mergeStyle(EnumRuneType.DAWN.colorCode)); + + tooltip.add(new StringTextComponent("")); + tooltip.add(new TranslationTextComponent(tooltipBase + "totalRune", totalRunes)); + } else + { + tooltip.add(new StringTextComponent("")); + if (TextHelper.canTranslate(ritual.getTranslationKey() + ".info")) + { + tooltip.add(new TranslationTextComponent(ritual.getTranslationKey() + ".info")); + tooltip.add(new StringTextComponent("")); + } + + tooltip.add(new TranslationTextComponent(tooltipBase + "extraInfo")); + tooltip.add(new TranslationTextComponent(tooltipBase + "extraExtraInfo")); + } + } + } + + @Override + public ActionResult onItemRightClick(World world, PlayerEntity player, Hand hand) + { + ItemStack stack = player.getHeldItem(hand); + + RayTraceResult ray = rayTrace(world, player, RayTraceContext.FluidMode.NONE); + + if (ray != null && ray.getType() == RayTraceResult.Type.BLOCK) + { + return new ActionResult<>(ActionResultType.PASS, stack); + } + + if (player.isSneaking()) + { + if (!world.isRemote) + { + cycleRitual(stack, player, false); + } + + return new ActionResult<>(ActionResultType.SUCCESS, stack); + } + + return new ActionResult<>(ActionResultType.PASS, stack); + } + + @Override + public void onUse(World worldIn, LivingEntity entityLiving, ItemStack stack, int count) + { + if (!entityLiving.world.isRemote && entityLiving instanceof PlayerEntity) + { + PlayerEntity player = (PlayerEntity) entityLiving; + + RayTraceResult ray = rayTrace(player.world, player, RayTraceContext.FluidMode.NONE); + + if (ray != null && ray.getType() == RayTraceResult.Type.BLOCK) + { + return; +// return false; + } + + if (!player.isSwingInProgress) + { + if (player.isSneaking()) + { + cycleRitual(stack, player, true); + } else + { + cycleDirection(stack, player); + } + } + } + +// return false; + } + + public void cycleDirection(ItemStack stack, PlayerEntity player) + { + Direction direction = getDirection(stack); + Direction newDirection; + switch (direction) + { + case NORTH: + newDirection = Direction.EAST; + break; + case EAST: + newDirection = Direction.SOUTH; + break; + case SOUTH: + newDirection = Direction.WEST; + break; + case WEST: + newDirection = Direction.NORTH; + break; + default: + newDirection = Direction.NORTH; + } + + setDirection(stack, newDirection); + notifyDirectionChange(newDirection, player); + } + + public void notifyDirectionChange(Direction direction, PlayerEntity player) + { + player.sendStatusMessage(new TranslationTextComponent(tooltipBase + "currentDirection", Utils.toFancyCasing(direction.name())), true); + } + + public void setDirection(ItemStack stack, Direction direction) + { + if (!stack.hasTag()) + { + stack.setTag(new CompoundNBT()); + } + + CompoundNBT tag = stack.getTag(); + + tag.putInt(Constants.NBT.DIRECTION, direction.getIndex()); + } + + public Direction getDirection(ItemStack stack) + { + if (!stack.hasTag()) + { + stack.setTag(new CompoundNBT()); + return Direction.NORTH; + } + + CompoundNBT tag = stack.getTag(); + + int dir = tag.getInt(Constants.NBT.DIRECTION); + if (dir == 0) + { + return Direction.NORTH; + } + + return Direction.values()[tag.getInt(Constants.NBT.DIRECTION)]; + } + + /** + * Cycles the ritual forward or backward + */ + public void cycleRitual(ItemStack stack, PlayerEntity player, boolean reverse) + { + String key = getCurrentRitual(stack); + List rituals = BloodMagic.RITUAL_MANAGER.getSortedRituals(); + if (reverse) + Collections.reverse(rituals = Lists.newArrayList(rituals)); + + String firstId = ""; + boolean foundId = false; + boolean foundFirst = false; + + for (Ritual ritual : rituals) + { + String id = BloodMagic.RITUAL_MANAGER.getId(ritual); + + if (!BloodMagic.RITUAL_MANAGER.enabled(id, false) || !canDivinerPerformRitual(stack, ritual)) + { + continue; + } + + if (!foundFirst) + { + firstId = id; + foundFirst = true; + } + + if (foundId) + { + setCurrentRitual(stack, id); + notifyRitualChange(id, player); + return; + } else if (id.equals(key)) + { + foundId = true; + } + } + + if (foundFirst) + { + setCurrentRitual(stack, firstId); + notifyRitualChange(firstId, player); + } + } + + public boolean canDivinerPerformRitual(ItemStack stack, Ritual ritual) + { + if (ritual == null) + { + return false; + } + + List components = Lists.newArrayList(); + ritual.gatherComponents(components::add); + for (RitualComponent component : components) + { + if (!canPlaceRitualStone(component.getRuneType(), stack)) + { + return false; + } + } + + return true; + } + + public void notifyRitualChange(String key, PlayerEntity player) + { + Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(key); + if (ritual != null) + { + player.sendStatusMessage(new TranslationTextComponent(ritual.getTranslationKey()), true); + } + } + + public void setCurrentRitual(ItemStack stack, String key) + { + if (!stack.hasTag()) + { + stack.setTag(new CompoundNBT()); + } + + CompoundNBT tag = stack.getTag(); + + tag.putString("current_ritual", key); + } + + public String getCurrentRitual(ItemStack stack) + { + if (!stack.hasTag()) + { + stack.setTag(new CompoundNBT()); + } + + CompoundNBT tag = stack.getTag(); + return tag.getString("current_ritual"); + } + + public boolean canPlaceRitualStone(EnumRuneType rune, ItemStack stack) + { + int meta = type; + switch (rune) + { + case BLANK: + case AIR: + case EARTH: + case FIRE: + case WATER: + return true; + case DUSK: + return meta >= 1; + case DAWN: + return meta >= 2; + } + + return false; + } + + public static void spawnParticles(World worldIn, BlockPos pos, int amount) + { + BlockState state = worldIn.getBlockState(pos); + Block block = worldIn.getBlockState(pos).getBlock(); + + if (block.isAir(state, worldIn, pos)) + { + for (int i = 0; i < amount; ++i) + { + double d0 = random.nextGaussian() * 0.02D; + double d1 = random.nextGaussian() * 0.02D; + double d2 = random.nextGaussian() * 0.02D; + worldIn.addParticle(ParticleTypes.HAPPY_VILLAGER, (double) ((float) pos.getX() + + random.nextFloat()), (double) pos.getY() + + (double) random.nextFloat(), (double) ((float) pos.getZ() + + random.nextFloat()), d0, d1, d2); + } + } else + { + for (int i1 = 0; i1 < amount; ++i1) + { + double d0 = random.nextGaussian() * 0.02D; + double d1 = random.nextGaussian() * 0.02D; + double d2 = random.nextGaussian() * 0.02D; + worldIn.addParticle(ParticleTypes.HAPPY_VILLAGER, (double) ((float) pos.getX() + + random.nextFloat()), (double) pos.getY() + + (double) random.nextFloat() + * 1.0f, (double) ((float) pos.getZ() + random.nextFloat()), d0, d1, d2); + } + } + } +} diff --git a/src/main/java/wayoftime/bloodmagic/common/recipe/BloodAltarRecipeProvider.java b/src/main/java/wayoftime/bloodmagic/common/recipe/BloodAltarRecipeProvider.java index 671843fa..05a898a3 100644 --- a/src/main/java/wayoftime/bloodmagic/common/recipe/BloodAltarRecipeProvider.java +++ b/src/main/java/wayoftime/bloodmagic/common/recipe/BloodAltarRecipeProvider.java @@ -33,9 +33,14 @@ public class BloodAltarRecipeProvider implements ISubRecipeProvider // THREE BloodAltarRecipeBuilder.altar(Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new ItemStack(BloodMagicItems.IMBUED_SLATE.get()), AltarTier.THREE.ordinal(), 5000, 15, 10).build(consumer, BloodMagic.rl(basePath + "imbuedslate")); BloodAltarRecipeBuilder.altar(Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_GOLD), new ItemStack(BloodMagicItems.MAGICIAN_BLOOD_ORB.get()), AltarTier.THREE.ordinal(), 25000, 20, 20).build(consumer, BloodMagic.rl(basePath + "magicianbloodorb")); + BloodAltarRecipeBuilder.altar(Ingredient.fromTag(Tags.Items.OBSIDIAN), new ItemStack(BloodMagicItems.EARTH_INSCRIPTION_TOOL.get()), AltarTier.THREE.ordinal(), 1000, 5, 5).build(consumer, BloodMagic.rl(basePath + "earth_tool")); + BloodAltarRecipeBuilder.altar(Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_LAPIS), new ItemStack(BloodMagicItems.WATER_INSCRIPTION_TOOL.get()), AltarTier.THREE.ordinal(), 1000, 5, 5).build(consumer, BloodMagic.rl(basePath + "water_tool")); + BloodAltarRecipeBuilder.altar(Ingredient.fromItems(Items.MAGMA_CREAM), new ItemStack(BloodMagicItems.FIRE_INSCRIPTION_TOOL.get()), AltarTier.THREE.ordinal(), 1000, 5, 5).build(consumer, BloodMagic.rl(basePath + "fire_tool")); + BloodAltarRecipeBuilder.altar(Ingredient.fromItems(Items.GHAST_TEAR), new ItemStack(BloodMagicItems.AIR_INSCRIPTION_TOOL.get()), AltarTier.THREE.ordinal(), 1000, 5, 5).build(consumer, BloodMagic.rl(basePath + "air_tool")); // FOUR BloodAltarRecipeBuilder.altar(Ingredient.fromItems(BloodMagicItems.IMBUED_SLATE.get()), new ItemStack(BloodMagicItems.DEMONIC_SLATE.get()), AltarTier.FOUR.ordinal(), 15000, 20, 20).build(consumer, BloodMagic.rl(basePath + "demonicslate")); + BloodAltarRecipeBuilder.altar(Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_COAL), new ItemStack(BloodMagicItems.DUSK_INSCRIPTION_TOOL.get()), AltarTier.FOUR.ordinal(), 2000, 20, 10).build(consumer, BloodMagic.rl(basePath + "dusk_tool")); // BloodAltarRecipeBuilder.altar(input, output, minimumTier, syphon, consumeRate, drainRate).build(consumer, BloodMagic.rl(basePath + "")); diff --git a/src/main/java/wayoftime/bloodmagic/tile/TileMasterRitualStone.java b/src/main/java/wayoftime/bloodmagic/tile/TileMasterRitualStone.java index 5e6083b7..790efcc4 100644 --- a/src/main/java/wayoftime/bloodmagic/tile/TileMasterRitualStone.java +++ b/src/main/java/wayoftime/bloodmagic/tile/TileMasterRitualStone.java @@ -220,7 +220,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS } else { if (activator != null) - activator.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notValid"), true); + activator.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.ritual.notvalid"), true); } return false; diff --git a/src/main/java/wayoftime/bloodmagic/tile/base/TileTicking.java b/src/main/java/wayoftime/bloodmagic/tile/base/TileTicking.java index 545dec20..ffc70ebc 100644 --- a/src/main/java/wayoftime/bloodmagic/tile/base/TileTicking.java +++ b/src/main/java/wayoftime/bloodmagic/tile/base/TileTicking.java @@ -1,7 +1,7 @@ package wayoftime.bloodmagic.tile.base; -import net.minecraft.client.renderer.texture.ITickable; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntityType; /** @@ -9,7 +9,7 @@ import net.minecraft.tileentity.TileEntityType; * programmatically. */ // TODO - Move implementations that depend on existed ticks to new methods from here. -public abstract class TileTicking extends TileBase implements ITickable +public abstract class TileTicking extends TileBase implements ITickableTileEntity { private int ticksExisted; private boolean shouldTick = true; diff --git a/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java b/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java new file mode 100644 index 00000000..0f3f019c --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java @@ -0,0 +1,303 @@ +package wayoftime.bloodmagic.util.handler.event; + +import java.util.List; + +import com.google.common.collect.Lists; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.vertex.IVertexBuilder; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.player.ClientPlayerEntity; +import net.minecraft.client.renderer.Atlases; +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.texture.AtlasTexture; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import wayoftime.bloodmagic.BloodMagic; +import wayoftime.bloodmagic.client.render.BloodMagicRenderer; +import wayoftime.bloodmagic.client.render.BloodMagicRenderer.Model3D; +import wayoftime.bloodmagic.client.render.RenderResizableCuboid; +import wayoftime.bloodmagic.client.render.block.RenderFakeBlocks; +import wayoftime.bloodmagic.common.item.ItemRitualDiviner; +import wayoftime.bloodmagic.ritual.Ritual; +import wayoftime.bloodmagic.ritual.RitualComponent; +import wayoftime.bloodmagic.tile.TileMasterRitualStone; + +@Mod.EventBusSubscriber(modid = BloodMagic.MODID, value = Dist.CLIENT) +@OnlyIn(Dist.CLIENT) +public class ClientHandler +{ + public static final boolean SUPPRESS_ASSET_ERRORS = true; + public static ResourceLocation ritualStoneBlank = BloodMagic.rl("block/ritualstone");; + public static ResourceLocation ritualStoneWater = BloodMagic.rl("block/waterritualstone");; + public static ResourceLocation ritualStoneFire = BloodMagic.rl("block/fireritualstone");; + public static ResourceLocation ritualStoneEarth = BloodMagic.rl("block/earthritualstone");; + public static ResourceLocation ritualStoneAir = BloodMagic.rl("block/airritualstone");; + public static ResourceLocation ritualStoneDawn = BloodMagic.rl("block/dawnritualstone");; + public static ResourceLocation ritualStoneDusk = BloodMagic.rl("block/lightritualstone");; + public static TextureAtlasSprite blankBloodRune; + public static TextureAtlasSprite stoneBrick; + public static TextureAtlasSprite glowstone; +// public static TextureAtlasSprite bloodStoneBrick; + public static TextureAtlasSprite beacon; +// public static TextureAtlasSprite crystalCluster; + public static Minecraft minecraft = Minecraft.getInstance(); + private static TileMasterRitualStone mrsHoloTile; + private static Ritual mrsHoloRitual; + private static Direction mrsHoloDirection; + private static boolean mrsHoloDisplay; + + @SubscribeEvent + public static void onTextureStitch(TextureStitchEvent.Pre event) + { + final String BLOCKS = "block/"; + +// ritualStoneBlank = Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(BloodMagic.rl(block//" + "blankrune")); +//// ritualStoneBlank = forName(event.getMap(), "ritualstone", BLOCKS); +// ritualStoneWater = forName(event.getMap(), "waterritualstone", BLOCKS); +// ritualStoneFire = forName(event.getMap(), "fireritualstone", BLOCKS); +// ritualStoneEarth = forName(event.getMap(), "earthritualstone", BLOCKS); +// ritualStoneAir = forName(event.getMap(), "airritualstone", BLOCKS); +// ritualStoneDawn = forName(event.getMap(), "lightritualstone", BLOCKS); +// ritualStoneDusk = forName(event.getMap(), "duskritualstone", BLOCKS); + + blankBloodRune = forName(event.getMap(), "blankrune", BLOCKS); + stoneBrick = event.getMap().getSprite(new ResourceLocation("minecraft:block/stonebrick")); + glowstone = event.getMap().getSprite(new ResourceLocation("minecraft:block/glowstone")); +// bloodStoneBrick = forName(event.getMap(), "BloodStoneBrick", BLOCKS); + beacon = event.getMap().getSprite(new ResourceLocation("minecraft:block/beacon")); +// crystalCluster = forName(event.getMap(), "ShardCluster", BLOCKS); + } + + @SubscribeEvent + public static void render(RenderWorldLastEvent event) + { + ClientPlayerEntity player = minecraft.player; + World world = player.getEntityWorld(); + + if (mrsHoloTile != null) + { + if (world.getTileEntity(mrsHoloTile.getPos()) instanceof TileMasterRitualStone) + { + if (mrsHoloDisplay) + { + IRenderTypeBuffer.Impl buffers = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); + MatrixStack stack = event.getMatrixStack(); + renderRitualStones(stack, buffers, mrsHoloTile, event.getPartialTicks()); + RenderSystem.disableDepthTest(); + buffers.finish(); + } else + ClientHandler.setRitualHoloToNull(); + } else + { + ClientHandler.setRitualHoloToNull(); + } + } + + if (minecraft.objectMouseOver == null || minecraft.objectMouseOver.getType() != RayTraceResult.Type.BLOCK) + return; + + TileEntity tileEntity = world.getTileEntity(((BlockRayTraceResult) minecraft.objectMouseOver).getPos()); + + if (tileEntity instanceof TileMasterRitualStone && !player.getHeldItemMainhand().isEmpty() + && player.getHeldItemMainhand().getItem() instanceof ItemRitualDiviner) + renderRitualStones(player, event.getPartialTicks()); + } + + private static TextureAtlasSprite forName(AtlasTexture textureMap, String name, String dir) + { + return textureMap.getSprite(new ResourceLocation(BloodMagic.MODID + dir + "/" + name)); + } + + private static void renderRitualStones(ClientPlayerEntity player, float partialTicks) + { + World world = player.getEntityWorld(); + ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem(); + Direction direction = ritualDiviner.getDirection(player.inventory.getCurrentItem()); + Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(ritualDiviner.getCurrentRitual(player.inventory.getCurrentItem())); + + if (ritual == null) + return; + + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); +// GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +// GlStateManager.color4f(1F, 1F, 1F, 0.6125F); + + BlockPos vec3, vX; + vec3 = ((BlockRayTraceResult) minecraft.objectMouseOver).getPos(); + double posX = player.lastTickPosX + (player.getPosX() - player.lastTickPosX) * partialTicks; + double posY = player.lastTickPosY + (player.getPosY() - player.lastTickPosY) * partialTicks; + double posZ = player.lastTickPosZ + (player.getPosZ() - player.lastTickPosZ) * partialTicks; + + List components = Lists.newArrayList(); + ritual.gatherComponents(components::add); + for (RitualComponent ritualComponent : components) + { + vX = vec3.add(ritualComponent.getOffset(direction)); + double minX = vX.getX() - posX; + double minY = vX.getY() - posY; + double minZ = vX.getZ() - posZ; + + if (!world.getBlockState(vX).isOpaqueCube(world, vX)) + { + TextureAtlasSprite texture = null; + +// switch (ritualComponent.getRuneType()) +// { +// case BLANK: +// texture = ritualStoneBlank; +// break; +// case WATER: +// texture = ritualStoneWater; +// break; +// case FIRE: +// texture = ritualStoneFire; +// break; +// case EARTH: +// texture = ritualStoneEarth; +// break; +// case AIR: +// texture = ritualStoneAir; +// break; +// case DAWN: +// texture = ritualStoneDawn; +// break; +// case DUSK: +// texture = ritualStoneDusk; +// break; +// } + + RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ); + } + } + + GlStateManager.popMatrix(); + } + + public static void renderRitualStones(MatrixStack stack, IRenderTypeBuffer renderer, TileMasterRitualStone masterRitualStone, float partialTicks) + { + IVertexBuilder buffer = renderer.getBuffer(Atlases.getTranslucentCullBlockType()); + System.out.println("Attempting to render stones"); + ClientPlayerEntity player = minecraft.player; + World world = player.getEntityWorld(); + Direction direction = mrsHoloDirection; + Ritual ritual = mrsHoloRitual; + + if (ritual == null) + { + return; + } +// GlStateManager.pushMatrix(); +// GlStateManager.enableBlend(); +// GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +// GlStateManager.color4f(1F, 1F, 1F, 0.5F); + + BlockPos vec3, vX; + vec3 = masterRitualStone.getPos(); + double posX = player.lastTickPosX + (player.getPosX() - player.lastTickPosX) * partialTicks; + double posY = player.lastTickPosY + (player.getPosY() - player.lastTickPosY) * partialTicks; + double posZ = player.lastTickPosZ + (player.getPosZ() - player.lastTickPosZ) * partialTicks; + + List components = Lists.newArrayList(); + ritual.gatherComponents(components::add); + for (RitualComponent ritualComponent : components) + { + stack.push(); + vX = vec3.add(ritualComponent.getOffset(direction)); + Vector3d eyePos = player.getEyePosition(partialTicks); + double minX = vX.getX() - eyePos.x; + double minY = vX.getY() - eyePos.y; + double minZ = vX.getZ() - eyePos.z; + + stack.translate(minX, minY, minZ); + + if (!world.getBlockState(vX).isOpaqueCube(world, vX)) + { + + ResourceLocation rl = null; + + switch (ritualComponent.getRuneType()) + { + case BLANK: + rl = ritualStoneBlank; + break; + case WATER: + rl = ritualStoneWater; + break; + case FIRE: + rl = ritualStoneFire; + break; + case EARTH: + rl = ritualStoneEarth; + break; + case AIR: + rl = ritualStoneAir; + break; + case DAWN: + rl = ritualStoneDawn; + break; + case DUSK: + rl = ritualStoneDusk; + break; + } + + Model3D model = getBlockModel(rl); + + RenderResizableCuboid.INSTANCE.renderCube(model, stack, buffer, 0xDDFFFFFF, 0x00F000F0, OverlayTexture.NO_OVERLAY); + +// RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ); + } + + stack.pop(); + } + +// GlStateManager.popMatrix(); + } + + private static Model3D getBlockModel(ResourceLocation rl) + { + Model3D model = new BloodMagicRenderer.Model3D(); + model.setTexture(Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(rl)); + model.minX = 0; + model.minY = 0; + model.minZ = 0; + model.maxX = 1; + model.maxY = 1; + model.maxZ = 1; + + return model; + } + + public static void setRitualHolo(TileMasterRitualStone masterRitualStone, Ritual ritual, Direction direction, boolean displayed) + { + mrsHoloDisplay = displayed; + mrsHoloTile = masterRitualStone; + mrsHoloRitual = ritual; + mrsHoloDirection = direction; + } + + public static void setRitualHoloToNull() + { + mrsHoloDisplay = false; + mrsHoloTile = null; + mrsHoloRitual = null; + mrsHoloDirection = Direction.NORTH; + } +}