From 9a274186b75d761b4a41ab6ef558c04dbf33627d Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sun, 25 Oct 2020 11:28:44 -0400 Subject: [PATCH] Ghost block fix Fixed the ClientHandler method for rendering the Ritual's ghost block. --- src/generated/resources/.cache/cache | 4 ++- .../assets/bloodmagic/lang/en_us.json | 2 ++ .../recipes/bloodmagictab/lava_crystal.json | 32 +++++++++++++++++++ .../data/bloodmagic/recipes/lava_crystal.json | 29 +++++++++++++++++ .../util/handler/event/ClientHandler.java | 21 ++++-------- 5 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/lava_crystal.json create mode 100644 src/generated/resources/data/bloodmagic/recipes/lava_crystal.json diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index d848edd0..1a1bca55 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -17,7 +17,7 @@ e1a98bd53fca155e4bbb03c1e548341af0f84bd7 assets/bloodmagic/blockstates/masterrit b03040d7a168653bf8df3600033b8fde2383db30 assets/bloodmagic/blockstates/selfsacrificerune.json 487ffdc02ab7b65aafcb932e3b5cf6ea0500b21d assets/bloodmagic/blockstates/speedrune.json e6d9cf699667aaa47efff37b2b033895dee29c15 assets/bloodmagic/blockstates/waterritualstone.json -770d87c47f343107732e9191d216803419324608 assets/bloodmagic/lang/en_us.json +af6eebbeef7c75844a0651065016fecb365595dd 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 @@ -147,6 +147,7 @@ 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 +344567e6f5671131addcfebbd92d18e5cbd66ef5 data/bloodmagic/advancements/recipes/bloodmagictab/lava_crystal.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 @@ -204,6 +205,7 @@ 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 +9dedad36e9d2ab6688e069c2e6df3851c395b583 data/bloodmagic/recipes/lava_crystal.json 7757e5fd52f71b0d21595e072593fc592210dd64 data/bloodmagic/recipes/ritual_stone_blank.json 8608f828f997b1a8015287bd9cd436e9d7dff2ff data/bloodmagic/recipes/ritual_stone_master.json aefbf1fd258f1cda8d04db7e0794b9612993e6bf data/bloodmagic/recipes/sacrificial_dagger.json diff --git a/src/generated/resources/assets/bloodmagic/lang/en_us.json b/src/generated/resources/assets/bloodmagic/lang/en_us.json index cd53036e..239385da 100644 --- a/src/generated/resources/assets/bloodmagic/lang/en_us.json +++ b/src/generated/resources/assets/bloodmagic/lang/en_us.json @@ -47,6 +47,7 @@ "item.bloodmagic.growthsigil": "Sigil of the Green Grove", "item.bloodmagic.icesigil": "Sigil of the Frozen Lake", "item.bloodmagic.infusedslate": "Imbued Slate", + "item.bloodmagic.lavacrystal": "Lava Crystal", "item.bloodmagic.lavasigil": "Lava Sigil", "item.bloodmagic.life_essence_bucket": "Bucket of Life", "item.bloodmagic.magicianbloodorb": "Magician Blood Orb", @@ -145,6 +146,7 @@ "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.inscriber.desc": "The writing is on the wall...", "tooltip.bloodmagic.orb.desc": "Stores raw Life Essence", "tooltip.bloodmagic.orb.owner": "Added by: %s", "tooltip.bloodmagic.sacrificialdagger.desc": "Just a prick of the finger will suffice...", diff --git a/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/lava_crystal.json b/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/lava_crystal.json new file mode 100644 index 00000000..84bc8f36 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/advancements/recipes/bloodmagictab/lava_crystal.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "bloodmagic:lava_crystal" + ] + }, + "criteria": { + "has_weak_orb": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "bloodmagic:weakbloodorb" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "bloodmagic:lava_crystal" + } + } + }, + "requirements": [ + [ + "has_weak_orb", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/recipes/lava_crystal.json b/src/generated/resources/data/bloodmagic/recipes/lava_crystal.json new file mode 100644 index 00000000..7a96e775 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/lava_crystal.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "aba", + "bcb", + "ded" + ], + "key": { + "a": { + "tag": "forge:glass" + }, + "b": { + "item": "minecraft:lava_bucket" + }, + "c": { + "type": "bloodmagic:bloodorb", + "orb_tier": 1 + }, + "d": { + "tag": "forge:obsidian" + }, + "e": { + "tag": "forge:gems/diamond" + } + }, + "result": { + "item": "bloodmagic:lavacrystal" + } +} \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java b/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java index 16e61ecb..0ff8c4b0 100644 --- a/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java +++ b/src/main/java/wayoftime/bloodmagic/util/handler/event/ClientHandler.java @@ -9,6 +9,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; +import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.Atlases; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.texture.AtlasTexture; @@ -131,6 +132,8 @@ public class ClientHandler private static void renderRitualStones(MatrixStack stack, IRenderTypeBuffer renderer, ClientPlayerEntity player, float partialTicks) { + ActiveRenderInfo activerenderinfo = Minecraft.getInstance().gameRenderer.getActiveRenderInfo(); + Vector3d eyePos = activerenderinfo.getProjectedView(); IVertexBuilder buffer = renderer.getBuffer(Atlases.getTranslucentCullBlockType()); World world = player.getEntityWorld(); ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem(); @@ -142,9 +145,6 @@ public class ClientHandler 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); @@ -152,13 +152,9 @@ public class ClientHandler { 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; -// double minX = vX.getX() - posX; -// double minY = vX.getY() - posY; -// double minZ = vX.getZ() - posZ; stack.translate(minX, minY, minZ); @@ -201,6 +197,8 @@ public class ClientHandler public static void renderRitualStones(MatrixStack stack, IRenderTypeBuffer renderer, TileMasterRitualStone masterRitualStone, float partialTicks) { + ActiveRenderInfo activerenderinfo = Minecraft.getInstance().gameRenderer.getActiveRenderInfo(); + Vector3d eyePos = activerenderinfo.getProjectedView(); IVertexBuilder buffer = renderer.getBuffer(Atlases.getTranslucentCullBlockType()); ClientPlayerEntity player = minecraft.player; World world = player.getEntityWorld(); @@ -214,9 +212,6 @@ public class ClientHandler 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); @@ -224,15 +219,11 @@ public class ClientHandler { 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; -// double minX = vX.getX() - posX; -// double minY = vX.getY() - posY; -// double minZ = vX.getZ() - posZ; - stack.translate(minX, minY, minZ); if (!world.getBlockState(vX).isOpaqueCube(world, vX))