diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-12 22:56:15 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-12 22:56:15 +0200 |
| commit | aca189fe13935e641c0cac3b91693c6c3fcf91c7 (patch) | |
| tree | 93142bc4d2a654e452be6d598bf41ba27e2d3ac5 /src/main/java | |
| parent | 746351e19048c2e33dd6c71b5cf5b7d82f648690 (diff) | |
| download | skyhanni-aca189fe13935e641c0cac3b91693c6c3fcf91c7.tar.gz skyhanni-aca189fe13935e641c0cac3b91693c6c3fcf91c7.tar.bz2 skyhanni-aca189fe13935e641c0cac3b91693c6c3fcf91c7.zip | |
fixed globalRender description and replaced RenderWorldLastEvent with LorenzRenderWorldEvent
Diffstat (limited to 'src/main/java')
56 files changed, 144 insertions, 132 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 9516746ab..edd5d62b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -29,7 +29,7 @@ import at.hannibal2.skyhanni.data.OwnInventoryData import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.PurseAPI -import at.hannibal2.skyhanni.data.RenderGuiData +import at.hannibal2.skyhanni.data.RenderData import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.data.SkillExperience @@ -338,7 +338,7 @@ class SkyHanniMod { loadModule(SkillExperience()) loadModule(OtherInventoryData) loadModule(TabListData()) - loadModule(RenderGuiData()) + loadModule(RenderData()) loadModule(GardenCropMilestones) loadModule(GardenCropUpgrades()) loadModule(OwnInventoryData()) diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt index 69cbb0dd3..fa633eaa4 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -66,7 +66,7 @@ class GuiEditManager { @JvmStatic fun renderLast() { if (!isInGui()) return - if (!SkyHanniDebugsAndTests.globalRenderToggle) return + if (!SkyHanniDebugsAndTests.globalRender) return GlStateManager.translate(0f, 0f, 200f) diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt index f48829e22..22d299f17 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt @@ -40,7 +40,7 @@ class ItemTipHelper { @SubscribeEvent(priority = EventPriority.HIGHEST) fun onRenderInventoryItemOverlayPost(event: DrawScreenAfterEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniDebugsAndTests.globalRenderToggle) return + if (!SkyHanniDebugsAndTests.globalRender) return val gui = Minecraft.getMinecraft().currentScreen if (gui !is GuiChest) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt index 6479816ef..9688add2c 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import net.minecraft.client.Minecraft @@ -9,14 +10,15 @@ import net.minecraft.client.gui.inventory.GuiInventory import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.client.event.RenderGameOverlayEvent +import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -class RenderGuiData { +class RenderData { @SubscribeEvent fun onRenderOverlay(event: RenderGameOverlayEvent.Pre) { if (event.type != RenderGameOverlayEvent.ElementType.HOTBAR) return - if (!SkyHanniDebugsAndTests.globalRenderToggle) return + if (!SkyHanniDebugsAndTests.globalRender) return if (GuiEditManager.isInGui() || FFGuideGUI.isInGui()) return GuiRenderEvent.GuiOverlayRenderEvent().postAndCatch() @@ -24,7 +26,7 @@ class RenderGuiData { @SubscribeEvent fun onBackgroundDraw(event: GuiScreenEvent.BackgroundDrawnEvent) { - if (!SkyHanniDebugsAndTests.globalRenderToggle) return + if (!SkyHanniDebugsAndTests.globalRender) return if (GuiEditManager.isInGui() || FFGuideGUI.isInGui()) return val currentScreen = Minecraft.getMinecraft().currentScreen ?: return if (currentScreen !is GuiInventory && currentScreen !is GuiChest) return @@ -40,4 +42,10 @@ class RenderGuiData { GlStateManager.popMatrix() } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!SkyHanniDebugsAndTests.globalRender) return + LorenzRenderWorldEvent(event.partialTicks).postAndCatch() + } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzRenderWorldEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzRenderWorldEvent.kt new file mode 100644 index 000000000..5ce44df0d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/events/LorenzRenderWorldEvent.kt @@ -0,0 +1,3 @@ +package at.hannibal2.skyhanni.events + +class LorenzRenderWorldEvent(val partialTicks: Float) : LorenzEvent()
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt index e73a88fb5..5dda13876 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.cosmetics import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.utils.LocationUtils @@ -12,7 +13,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation import at.hannibal2.skyhanni.utils.SimpleTimeMark import net.minecraft.client.Minecraft -import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.awt.Color import kotlin.time.Duration.Companion.milliseconds @@ -32,7 +32,7 @@ class CosmeticFollowingLine { } @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { + fun onRenderWorld(event: LorenzRenderWorldEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.enabled) return @@ -46,7 +46,7 @@ class CosmeticFollowingLine { } private fun renderFar( - event: RenderWorldLastEvent, + event: LorenzRenderWorldEvent, firstPerson: Boolean, color: Color ) { @@ -67,7 +67,7 @@ class CosmeticFollowingLine { } } - private fun updateClose(event: RenderWorldLastEvent) { + private fun updateClose(event: LorenzRenderWorldEvent) { val playerLocation = event.exactLocation(Minecraft.getMinecraft().thePlayer).add(0.0, 0.3, 0.0) latestLocations = latestLocations.editCopy { @@ -77,7 +77,7 @@ class CosmeticFollowingLine { } } - private fun renderClose(event: RenderWorldLastEvent, firstPerson: Boolean, color: Color) { + private fun renderClose(event: LorenzRenderWorldEvent, firstPerson: Boolean, color: Color) { if (firstPerson && latestLocations.any { !it.value.onGround }) return for ((a, b) in latestLocations.keys.zipWithNext()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index 72079fd6f..b8fa406b9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.BossHealthChangeEvent import at.hannibal2.skyhanni.events.DamageIndicatorDetectedEvent import at.hannibal2.skyhanni.events.DamageIndicatorFinalBossEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI @@ -42,7 +43,6 @@ import net.minecraft.entity.monster.EntityMagmaCube import net.minecraft.entity.monster.EntityZombie import net.minecraft.entity.passive.EntityWolf import net.minecraftforge.client.event.RenderLivingEvent -import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.event.entity.EntityJoinWorldEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -102,7 +102,7 @@ class DamageIndicatorManager { } @SubscribeEvent - fun onWorldRender(event: RenderWorldLastEvent) { + fun onWorldRender(event: LorenzRenderWorldEvent) { if (!isEnabled()) return GlStateManager.disableDepth() diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt index e574015bd..e87257e98 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.BlockClickEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.utils.BlockUtils import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt import at.hannibal2.skyhanni.utils.LorenzColor @@ -12,7 +13,6 @@ import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.RenderUtils.drawColor import at.hannibal2.skyhanni.utils.RenderUtils.drawString import net.minecraft.init.Blocks -import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DungeonHighlightClickedBlocks { @@ -79,7 +79,7 @@ class DungeonHighlightClickedBlocks { } @SubscribeEvent - fun onWorldRender(event: RenderWorldLastEvent) { + fun onWorldRender(event: LorenzRenderWorldEvent) { if (!SkyHanniMod.feature.dungeon.highlightClickedBlocks) return if (!LorenzUtils.inDungeons) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt index f7004074b..4a4b22b1a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.BurrowDetectEvent import at.hannibal2.skyhanni.events.BurrowDugEvent import at.hannibal2.skyhanni.events.EntityMoveEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.SoopyGuessBurrowEvent import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt @@ -23,7 +24,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.TimeUtils import net.minecraft.client.Minecraft import net.minecraft.init.Blocks -import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @@ -141,7 +141,7 @@ object GriffinBurrowHelper { } @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { + fun onRenderWorld(event: LorenzRenderWorldEvent) { sendTip(event) val playerLocation = LocationUtils.playerLocation() @@ -203,7 +203,7 @@ object GriffinBurrowHelper { event.move(2, "diana", "event.diana") } - private fun sendTip(event: RenderWorldLastEvent) { + private fun sendTip(event: LorenzRenderWorldEvent) { teleportedLocation?.let { teleportedLocation = null @@ -235,7 +235,7 @@ object GriffinBurrowHelper { } } - private fun moveAnimation(animation: LorenzVec, event: RenderWorldLastEvent): LorenzVec? { + private fun moveAnimation(animation: LorenzVec, event: LorenzRenderWorldEvent): LorenzVec? { val list = mutableListOf<LorenzVec>() if (config.burrowsNearbyDetection) { list.addAll(particleBurrows.keys) diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt index 6b245df73..179b6af20 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.InventoryUtils @@ -13,7 +14,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation import at.hannibal2.skyhanni.utils.StringUtils.removeColor import com.google.common.cache.CacheBuilder import net.minecraft.entity.item.EntityItem -import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.concurrent.TimeUnit @@ -42,7 +42,7 @@ class ShowFishingItemName { private fun isFishingRod() = InventoryUtils.getItemInHand()?.name?.contains("Rod") ?: false @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { + fun onRenderWorld(event: LorenzRenderWorldEvent) { if (!isEnabled()) return if (hasRodInHand) { for (entityItem in EntityUtils.getEntities<EntityItem>()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt index 2e7439cbf..b3b002c24 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.InventoryUtils @@ -12,7 +13,6 @@ import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class OdgerWaypoint { @@ -43,7 +43,7 @@ class OdgerWaypoint { } @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { + fun onRenderWorld(event: LorenzRenderWorldEvent) { if (!isEnabled()) return if (hasLavaRodInHand) return if (!trophyFishInInv) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt index 05083f442..c7d27d873 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt +++ b/src/main/java/at/hannibal2/sk |
