aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-11 02:52:45 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-11 02:52:45 +0200
commit69a9e12bd09e2ed936d25ccb7c3e1bd1a01f03ad (patch)
tree3b6423bdb91de4b8daf9b135af05b040697d8698 /src/main/java/at
parentcccd8dbf853b9205e86a01af6505be68f3a91611 (diff)
downloadskyhanni-69a9e12bd09e2ed936d25ccb7c3e1bd1a01f03ad.tar.gz
skyhanni-69a9e12bd09e2ed936d25ccb7c3e1bd1a01f03ad.tar.bz2
skyhanni-69a9e12bd09e2ed936d25ccb7c3e1bd1a01f03ad.zip
updated to version 0.4.2
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/lorenz/mod/ItemDisplayOverlayFeatures.kt2
-rw-r--r--src/main/java/at/lorenz/mod/LorenzMod.java2
-rw-r--r--src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossDamageIndicator.kt12
-rw-r--r--src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossFinder.kt48
4 files changed, 56 insertions, 8 deletions
diff --git a/src/main/java/at/lorenz/mod/ItemDisplayOverlayFeatures.kt b/src/main/java/at/lorenz/mod/ItemDisplayOverlayFeatures.kt
index 00b81f3ee..e051e9438 100644
--- a/src/main/java/at/lorenz/mod/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/lorenz/mod/ItemDisplayOverlayFeatures.kt
@@ -73,7 +73,7 @@ class ItemDisplayOverlayFeatures {
}
if (LorenzMod.feature.item.displayNewYearCakeNumber) {
- if (name.startsWith("New Year Cake")) {
+ if (name.startsWith("New Year Cake (")) {
try {
return "§b" + name.between("(Year ", ")")
} catch (e: IndexOutOfBoundsException) {
diff --git a/src/main/java/at/lorenz/mod/LorenzMod.java b/src/main/java/at/lorenz/mod/LorenzMod.java
index 6365d9906..634841201 100644
--- a/src/main/java/at/lorenz/mod/LorenzMod.java
+++ b/src/main/java/at/lorenz/mod/LorenzMod.java
@@ -29,7 +29,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
public class LorenzMod {
public static final String MODID = "lorenzmod";
- public static final String VERSION = "0.4.1";
+ public static final String VERSION = "0.4.2";
// public static SBHConfig config; //TODO delete
diff --git a/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossDamageIndicator.kt b/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossDamageIndicator.kt
index 47e0d7f52..5d6be2a51 100644
--- a/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossDamageIndicator.kt
+++ b/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossDamageIndicator.kt
@@ -108,12 +108,16 @@ class DungeonBossDamageIndicator {
val currentMaxHealth = event.entity.baseMaxHealth
val debugMaxHealth = getMaxHealthFor(event.entity)
- val biggestHealth = max(currentMaxHealth, debugMaxHealth)
- if (biggestHealth > debugMaxHealth) {
+ val biggestHealth: Double
+ val health = event.entity.health + 0.0
+ if (debugMaxHealth == 0.0) {
+ biggestHealth = max(currentMaxHealth, health)
setMaxHealth(event.entity, biggestHealth)
+ } else {
+ biggestHealth = debugMaxHealth
}
- val percentage = event.entity.health / max(debugMaxHealth, currentMaxHealth)
+ val percentage = health / biggestHealth
val color = when {
percentage > 0.9 -> LorenzColor.DARK_GREEN
percentage > 0.75 -> LorenzColor.GREEN
@@ -124,7 +128,7 @@ class DungeonBossDamageIndicator {
data[entity] = EntityData(
entity,
- NumberUtil.format(event.entity.health),
+ NumberUtil.format(health),
color,
System.currentTimeMillis(),
ignoreBlocks,
diff --git a/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossFinder.kt b/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossFinder.kt
index edc38edeb..0a4090b21 100644
--- a/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossFinder.kt
+++ b/src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossFinder.kt
@@ -4,6 +4,7 @@ import at.lorenz.mod.dungeon.DungeonData
import at.lorenz.mod.utils.LorenzUtils
import at.lorenz.mod.utils.LorenzUtils.baseMaxHealth
import at.lorenz.mod.utils.LorenzUtils.matchRegex
+import at.lorenz.mod.utils.LorenzVec
import at.lorenz.mod.utils.getLorenzVec
import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityOtherPlayerMP
@@ -11,6 +12,7 @@ import net.minecraft.entity.Entity
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.monster.EntityGiantZombie
import net.minecraft.entity.monster.EntityGuardian
+import java.util.*
class DungeonBossFinder {
@@ -44,6 +46,7 @@ class DungeonBossFinder {
//F6
private var floor6Giants = false
private var floor6GiantsSpawnTime = 0L //TODO different giants cooldown delayed from each other
+ private var floor6GiantsSeparateDelay = mutableMapOf<UUID, Long>()
private var floor6Sadan = false
private var floor6SadanSpawnTime = 0L
@@ -168,8 +171,10 @@ class DungeonBossFinder {
if (DungeonData.isOneOf("F6", "M6")) {
if (entity is EntityGiantZombie && !entity.isInvisible) {
if (floor6Giants && entity.posY > 68) {
- ignoreBlocks(floor6GiantsSpawnTime + 1_000 > System.currentTimeMillis())
- delayedStart(floor6GiantsSpawnTime)
+ val extraDelay = checkExtraF6GiantsDelay(entity)
+ ignoreBlocks(floor6GiantsSpawnTime + extraDelay + 1_000 > System.currentTimeMillis())
+
+ delayedStart(floor6GiantsSpawnTime + extraDelay)
return true
}
@@ -184,6 +189,45 @@ class DungeonBossFinder {
return false
}
+ private fun checkExtraF6GiantsDelay(entity: EntityGiantZombie): Long {
+ val uuid = entity.uniqueID
+
+ if (floor6GiantsSeparateDelay.contains(uuid)) {
+ return floor6GiantsSeparateDelay[uuid]!!
+ }
+
+ val middle = LorenzVec(-8, 0, 56)
+
+ val loc = entity.getLorenzVec()
+
+ var pos = 0
+
+ //first
+ if (loc.x > middle.x && loc.z > middle.z) {
+ pos = 2
+ }
+
+ //second
+ if (loc.x > middle.x && loc.z < middle.z) {
+ pos = 3
+ }
+
+ //third
+ if (loc.x < middle.x && loc.z < middle.z) {
+ pos = 0
+ }
+
+ //fourth
+ if (loc.x < middle.x && loc.z > middle.z) {
+ pos = 1
+ }
+
+ val extraDelay = 900L * pos
+ floor6GiantsSeparateDelay[uuid] = extraDelay
+
+ return extraDelay
+ }
+
fun handleChat(message: String) {
when (message) {
//F1