From 0b4dee52c6175286d3c94008410de1bc029d778f Mon Sep 17 00:00:00 2001 From: sschr15 Date: Thu, 19 Dec 2019 17:26:05 -0600 Subject: [PATCH] Partially fixed GUI bug! #1 us now slightly more under control. --- changelog.json | 5 +++-- changelog.md | 4 ++++ gradle.properties | 2 +- .../client/gui/GuiIncorporealOverlay.java | 20 ++++++++++++++----- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/changelog.json b/changelog.json index 0c46c3b..ec6e786 100644 --- a/changelog.json +++ b/changelog.json @@ -1,7 +1,7 @@ { "homepage": "https://minecraft.curseforge.com/projects/dissolution", "promos": { - "1.12.2-latest": "0.3.11" + "1.12.2-latest": "0.3.12" }, "1.12.2": { "0.1": "- Strong / weak soul, now Remnant / Vanilla soul: when joining a world for the first time, the player will be granted the choice between the mod\u00e2\u20ac\u2122s death system or the vanilla death system.\n- Soul player state: if the player is a Remnant, upon death, his soul leaves his body, allowing a free roaming of the world in order to select a new body to inhabit.\n- Undead possession: completely re-written to be the most enjoyable possible, the undead possession system is here to stay. When in soul mode, you will be able to enter any undead monster\u00e2\u20ac\u2122s body and control them. This will give you access to their inventories, advantages but also inconveniences. In a more detailed way:\n - Fixed latency when moving around while possessing something\n - Fixed offhand items rendering\n - Fixed bow usage when possessing entities\n - Fixed possessed mobs being unable to mount or dismount other things\n - Fixed possession removal in creative\n - Allowed undead players to go through portals when using possession\n - Allowed possession to work with any undead mob from any mod\nNew Items\n- Human flesh:\n - Can be eaten by a human to restore food\n - Can be eaten by an undead player to regain life and eventually his humanity\n - Can be obtained from:\n - Killing humans (such as human players, villagers, witches and illagers)\n - Crafting via one rotten flesh piece and one ghast tear\n - Putting a ghast tear in a water filled cauldron, and purifying rotten flesh by interacting with it\n- Human organs (heart, brain): serving the same use as the human flesh, they are mainly useful for brewing the mod\u00e2\u20ac\u2122s potions.\n- Obnoxious potion: obtained when brewing human flesh in water bottles, it\u00e2\u20ac\u2122s ineffective and acts as a, intermediary potion.\n- Eau de mort: obtained when brewing a human brain in obnoxious potions, it can expel Remnant souls out of their body, without destroying it, and alter vanilla souls to make them Remnant.\n- Sanguine potions: obtained when brewing a human heart in obnoxious potions, it has no effect for souls other than Remnant, altering them to become vanilla.\nVarious changes\n- API changes : new Forge events for possession\n- The air bar is now rendered when possessing something\n- Possessed mobs now render arms in first person and full body in the inventory\n- Players possessing entities stop losing their experience\n- Possessed entities don\u00e2\u20ac\u2122t get artificially targeted by mobs normally targetting players anymore\n- Added baby zombies immunity to sunlight back by default\nCross-mod interactions\n- Added Thaumcraft aspects for every entity and item\n- Added Thaumcraft brain to human brain recipe\n- Added Inspirations recipe for purified flesh\n- Added Inspirations recipes for the mod\u00e2\u20ac\u2122s potions", @@ -29,6 +29,7 @@ "0.3.8": "- Fixed crash when killed by a player possessing a mob", "0.3.9": "- Fixed crash when two mods have a possessable entity with the same class name", "0.3.10": "All credits for this update goes to sschr15\n- Added the Hardcore option to also be possible in survival.\n- Added a config option to enable said behavior.", - "0.3.11": "- Version bump for ModWinder support" + "0.3.11": "- Version bump for ModWinder support", + "0.3.12": "- FIXED A BUG!!! When possessing a creeper, spider, or enderman, GUIs work properly.\n - However, your hotbar will not show up. Already planning on looking into that." } } \ No newline at end of file diff --git a/changelog.md b/changelog.md index 7d7296d..d6fa266 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +##### Version 1.12.2-0.3.12 - BUILT +- FIXED A BUG!!! When possessing a creeper, spider, or enderman, GUIs work properly. + - However, your hotbar will not show up. Already planning on looking into that. + ##### Version 1.12.2-0.3.11 - BUILT - Version bump for ModWinder support diff --git a/gradle.properties b/gradle.properties index 30c3c94..983f62a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx5G # Mod Information mod_group=Ladysnake mc_version=1.12.2 -dissolution_version=0.3.10 +dissolution_version=0.3.12 version_nickname= # Workspace diff --git a/src/main/java/ladysnake/dissolution/client/gui/GuiIncorporealOverlay.java b/src/main/java/ladysnake/dissolution/client/gui/GuiIncorporealOverlay.java index f5bb6c8..a4b2b42 100644 --- a/src/main/java/ladysnake/dissolution/client/gui/GuiIncorporealOverlay.java +++ b/src/main/java/ladysnake/dissolution/client/gui/GuiIncorporealOverlay.java @@ -68,11 +68,21 @@ public void onRenderExperienceBar(RenderGameOverlayEvent.Post event) { } } // We need to set the render view entity back to a player as renderAir and renderHotbar require it - mc.setRenderViewEntity(this.mc.player); - this.mc.player.setAir(possessed.getAir()); - this.renderAir(res.getScaledWidth(), res.getScaledHeight()); - this.renderHotbar(res, event.getPartialTicks()); - mc.setRenderViewEntity(possessed); + // We shouldn't, though, if the entity has its own shader. This does resault in parts of the hotbar disappearing, + // but we'll fix that later... + boolean badMob; + boolean isCreeper = possessed instanceof EntityCreeper; + boolean isEnderman = possessed instanceof EntityEnderman; + boolean isSpider = possessed instanceof EntitySpider; + badMob = isCreeper || isEnderman || isSpider; + + if (!badMob) { + mc.setRenderViewEntity(this.mc.player); + this.mc.player.setAir(possessed.getAir()); + this.renderAir(res.getScaledWidth(), res.getScaledHeight()); + this.renderHotbar(res, event.getPartialTicks()); + mc.setRenderViewEntity(possessed); + } } } }