diff options
author | syeyoung <cyong06@naver.com> | 2021-01-27 19:01:40 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-27 19:01:40 +0900 |
commit | 4dc9da6c2b23d145583ef528260cc7023a60bdfa (patch) | |
tree | 2916b02e3866b03a98092fd38406e3954b552b7c /src/main/java | |
parent | b5cbefcccf5ae5b7d156b181c5cefdcee3861ab8 (diff) | |
download | Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.gz Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.bz2 Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.zip |
BONZO
Diffstat (limited to 'src/main/java')
11 files changed, 216 insertions, 110 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/a.java b/src/main/java/kr/syeyoung/dungeonsguide/a.java index 4fda02f9..38014622 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/a.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/a.java @@ -11,6 +11,7 @@ import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraftforge.fml.client.CustomModLoadingErrorDisplayException; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.ProgressManager; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java index ed66ab00..025ae7fa 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java @@ -214,6 +214,8 @@ public class MapProcessor { } } if (dungeonRoom.getTotalSecrets() == -1) { + if (dungeonRoom.getColor() == 82) dungeonRoom.setTotalSecrets(0); + else if (dungeonRoom.getColor() == 74) dungeonRoom.setTotalSecrets(0); MapUtils.record(mapData, mapPoint.x, mapPoint.y +1, new Color(0,255,0,80)); } continue; @@ -226,11 +228,11 @@ public class MapProcessor { e.sendDebugChat(new ChatComponentText("New Map discovered! mapMin: "+rooms.getMin())); StringBuilder builder = new StringBuilder(); for (int dy =0;dy<4;dy++) { + builder.append("\n"); for (int dx = 0; dx < 4; dx ++) { boolean isSet = ((rooms.getShape() >> (dy * 4 + dx)) & 0x1) != 0; builder.append(isSet ? "O" : "X"); } - builder.append("\n"); } e.sendDebugChat(new ChatComponentText("Shape visual: "+builder.toString())); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java index ce2f6039..daff59d0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java @@ -4,6 +4,7 @@ import com.google.common.base.Predicate; import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessor; +import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorBonzo; import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorLivid; import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.GeneralBossfightProcessor; import net.minecraft.entity.item.EntityArmorStand; @@ -77,104 +78,80 @@ public class CatacombDataProvider implements DungeonSpecificDataProvider { public BossfightProcessor createBossfightProcessor(World w, String dungeonName) { String floor = dungeonName.substring(14).trim(); e.sendDebugChat(new ChatComponentText("Floor: "+floor+ " Building bossfight processor")); - if (floor.equals("F2")) { - GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("start") - .signatureMsg("§r§c[BOSS] Scarf§r§f: This is where the journey ends for you, Adventurers.§r") - .nextPhase("fight-1").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-1") - .signatureMsg("§r§c[BOSS] Scarf§r§f: ARISE, MY CREATIONS!§r") - .nextPhase("first-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("first-defeat") - .signatureMsg("§r§c[BOSS] Scarf§r§f: Those toys are not strong enough I see.§r") - .nextPhase("fight-2").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-2") - .signatureMsg("§r§c[BOSS] Scarf§r§f: Did you forget? I was taught by the best! Let's dance.§r") - .nextPhase("final-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("final-defeat") - .signatureMsg("§r§c[BOSS] Scarf§r§f: Whatever...§r").build() - ); - return bossfightProcessor; +// if (floor.equals("F2")) { +// GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("start") +// .signatureMsg("§r§c[BOSS] Scarf§r§f: This is where the journey ends for you, Adventurers.§r") +// .nextPhase("fight-1").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("fight-1") +// .signatureMsg("§r§c[BOSS] Scarf§r§f: ARISE, MY CREATIONS!§r") +// .nextPhase("first-defeat").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("first-defeat") +// .signatureMsg("§r§c[BOSS] Scarf§r§f: Those toys are not strong enough I see.§r") +// .nextPhase("fight-2").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("fight-2") +// .signatureMsg("§r§c[BOSS] Scarf§r§f: Did you forget? I was taught by the best! Let's dance.§r") +// .nextPhase("final-defeat").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("final-defeat") +// .signatureMsg("§r§c[BOSS] Scarf§r§f: Whatever...§r").build() +// ); +// return bossfightProcessor; + if (false) { } else if (floor.equals("F1")) { - GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("start") - .signatureMsg("§r§c[BOSS] Bonzo§r§f: Gratz for making it this far, but I’m basically unbeatable.§r") - .nextPhase("fight-1").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-1") - .signatureMsg("§r§c[BOSS] Bonzo§r§f: I can summon lots of undead! Check this out.§r") - .nextPhase("first-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("first-defeat") - .signatureMsg("§r§c[BOSS] Bonzo§r§f: Oh I'm dead!§r").signatureMsg("§r§c[BOSS] Bonzo§r§f: Hoho, looks like you killed me!§r") - .nextPhase("fight-2").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-2") - .signatureMsg("§r§c[BOSS] Bonzo§r§f: Sike§r").signatureMsg("§r§c[BOSS] Bonzo§r§f: I can revive myself and become much stronger!§r") - .nextPhase("final-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("final-defeat") - .signatureMsg("§r§c[BOSS] Bonzo§r§f: Alright, maybe I'm just weak after all..§r").build() - ); - bossfightProcessor.setBossMaxHealth(250000); - return bossfightProcessor; - } else if (floor.equals("F3")) { - GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("start") - .signatureMsg("§r§c[BOSS] The Professor§r§f: I was burdened with terrible news recently...§r") - .nextPhase("fight-1").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-1") - .signatureMsg("§r§c[BOSS] The Professor§r§f: I'll show you real power!§r") - .nextPhase("first-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("first-defeat") - .signatureMsg("§r§c[BOSS] The Professor§r§f: Oh? You found my Guardians one weakness?§r") - .nextPhase("fight-2").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-2") - .signatureMsg("§r§c[BOSS] The Professor§r§f: This time I'll be your opponent!§r") - .nextPhase("second-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("second-defeat") - .signatureMsg("§r§c[BOSS] The Professor§r§f: I see. You have forced me to use my ultimate technique.§r") - .nextPhase("fight-3").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight-3") - .signatureMsg("§r§c[BOSS] The Professor§r§f: The process is irreversible, but I'll be stronger than a Wither now!§r") - .nextPhase("final-defeat").build() - ); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("final-defeat") - .signatureMsg("§r§c[BOSS] The Professor§r§f: What?! My Guardian power is unbeatable!§r").build() - ); - return bossfightProcessor; - } else if (floor.equals("F4")) { - GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); - bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() - .phase("fight").build() - ); + GeneralBossfightProcessor bossfightProcessor = new BossfightProcessorBonzo(); return bossfightProcessor; +// } else if (floor.equals("F3")) { +// GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("start") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: I was burdened with terrible news recently...§r") +// .nextPhase("fight-1").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("fight-1") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: I'll show you real power!§r") +// .nextPhase("first-defeat").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("first-defeat") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: Oh? You found my Guardians one weakness?§r") +// .nextPhase("fight-2").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("fight-2") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: This time I'll be your opponent!§r") +// .nextPhase("second-defeat").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("second-defeat") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: I see. You have forced me to use my ultimate technique.§r") +// .nextPhase("fight-3").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("fight-3") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: The process is irreversible, but I'll be stronger than a Wither now!§r") +// .nextPhase("final-defeat").build() +// ); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("final-defeat") +// .signatureMsg("§r§c[BOSS] The Professor§r§f: What?! My Guardian power is unbeatable!§r").build() +// ); +// return bossfightProcessor; +// } else if (floor.equals("F4")) { +// GeneralBossfightProcessor bossfightProcessor = new GeneralBossfightProcessor(); +// bossfightProcessor.addPhase(GeneralBossfightProcessor.PhaseData.builder() +// .phase("fight").build() +// ); +// return bossfightProcessor; } else if (floor.equals("F5")) { return new BossfightProcessorLivid(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java index 4a4def5d..e014d721 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java @@ -2,6 +2,7 @@ package kr.syeyoung.dungeonsguide.dungeon.roomfinder; import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; +import net.minecraft.client.Minecraft; import org.apache.commons.io.IOUtils; import javax.crypto.BadPaddingException; @@ -51,9 +52,11 @@ public class DungeonRoomInfoRegistry { public static void saveAll(File dir) { dir.mkdirs(); + boolean isDev = Minecraft.getMinecraft().getSession().getPlayerID().replace("-","").equals("e686fe0aab804a71ac7011dc8c2b534c"); + System.out.println(isDev); for (DungeonRoomInfo dungeonRoomInfo : registered) { try { - if (!dungeonRoomInfo.isUserMade()) continue; + if (!dungeonRoomInfo.isUserMade() && !isDev) continue; FileOutputStream fos = new FileOutputStream(new File(dir, dungeonRoomInfo.getUuid().toString() + ".roomdata")); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(dungeonRoomInfo); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index 2400e84f..56939cb2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -1,6 +1,7 @@ package kr.syeyoung.dungeonsguide.features; import kr.syeyoung.dungeonsguide.features.impl.boss.FeatureAutoReparty; +import kr.syeyoung.dungeonsguide.features.impl.boss.FeatureBossHealth; import kr.syeyoung.dungeonsguide.features.impl.boss.FeatureBoxRealLivid; import kr.syeyoung.dungeonsguide.features.impl.boss.FeatureChestPrice; import kr.syeyoung.dungeonsguide.features.impl.dungeon.*; @@ -63,6 +64,7 @@ public class FeatureRegistry { public static final SimpleFeature BOSSFIGHT_CHESTPRICE = register(new FeatureChestPrice()); public static final FeatureAutoReparty BOSSFIGHT_AUTOREPARTY = register(new FeatureAutoReparty()); public static final FeatureBoxRealLivid BOSSFIGHT_BOX_REALLIVID = register(new FeatureBoxRealLivid()); + public static final FeatureBossHealth BOSSFIGHT_HEALTH = register(new FeatureBossHealth()); public static final FeatureInstaCloseChest DUNGEON_INSTACLOSE = register(new FeatureInstaCloseChest()); public static final FeatureBoxSkelemaster DUNGEON_BOXSKELEMASTER = register(new FeatureBoxSkelemaster()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java new file mode 100644 index 00000000..7bb0c43f --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java @@ -0,0 +1,58 @@ +package kr.syeyoung.dungeonsguide.features.impl.boss; + +import kr.syeyoung.dungeonsguide.SkyblockStatus; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.HealthData; +import kr.syeyoung.dungeonsguide.utils.TextUtils; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.util.ChatComponentText; +import net.minecraftforge.client.event.ClientChatReceivedEvent; + +import java.awt.*; +import java.awt.font.TextHitInfo; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.List; +import java.util.regex.Pattern; + +public class FeatureBossHealth extends GuiFeature { + public FeatureBossHealth() { + super("Bossfight", "Display Boss Health(s)", "Show the health of boss and minibosses in bossfight (Guardians, Priests..)", "bossfight.health", false, getFontRenderer().getStringWidth("The Professor: 4242m"), getFontRenderer().FONT_HEIGHT * 5); + this.setEnabled(true); + parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.orange, "color")); + parameters.put("totalHealth", new FeatureParameter<Boolean>("totalHealth", "show total health", "Show total health along with current health", false, "boolean")); + parameters.put("formatHealth", new FeatureParameter<Boolean>("formatHealth", "format health", "1234568 -> 1m", true, "boolean")); + } + + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + @Override + public void drawHUD(float partialTicks) { + if (!skyblockStatus.isOnDungeon()) return; + DungeonContext context = skyblockStatus.getContext(); + if (context == null) return; + if (context.getBossfightProcessor() == null) return; + List<HealthData> healths = context.getBossfightProcessor().getHealths(); + int i = 0; + FontRenderer fr = getFontRenderer(); + boolean format = this.<Boolean>getParameter("formatHealth").getValue(); + boolean total = this.<Boolean>getParameter("totalHealth").getValue(); + for (HealthData heal : healths) { + fr.drawString(heal.getName() + ": " + (format ? TextUtils.format(heal.getHealth()) : heal.getHealth()) + (total ? "/"+(format ? TextUtils.format(heal.getMaxHealth()) : heal.getMaxHealth()) : ""), 0, i, this.<Color>getParameter("color").getValue().getRGB()); + i += 8; + } + } + + @Override + public void drawDemo(float partialTicks) { + FontRenderer fr = getFontRenderer(); + fr.drawString("The Professor: 3.3m", 0,0, this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Chaos Guardian: 500k", 0,8, this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Healing Guardian: 1m", 0,16, this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Laser Guardian: 5m", 0,24, this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Giant: 10m", 0,32, this.<Color>getParameter("color").getValue().getRGB()); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java new file mode 100644 index 00000000..56957135 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java @@ -0,0 +1,62 @@ +package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; + +import kr.syeyoung.dungeonsguide.utils.TextUtils; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraftforge.event.entity.living.LivingEvent; + +import java.util.ArrayList; +import java.util.List; + +public class BossfightProcessorBonzo extends GeneralBossfightProcessor { + public BossfightProcessorBonzo() { + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("start") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Gratz for making it this far, but I’m basically unbeatable.§r") + .nextPhase("fight-1").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("fight-1") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: I can summon lots of undead! Check this out.§r") + .nextPhase("first-defeat").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("first-defeat") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Oh I'm dead!§r").signatureMsg("§r§c[BOSS] Bonzo§r§f: Hoho, looks like you killed me!§r") + .nextPhase("fight-2").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("fight-2") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Sike§r").signatureMsg("§r§c[BOSS] Bonzo§r§f: I can revive myself and become much stronger!§r") + .nextPhase("final-defeat").build() + ); + addPhase(GeneralBossfightProcessor.PhaseData.builder() + .phase("final-defeat") + .signatureMsg("§r§c[BOSS] Bonzo§r§f: Alright, maybe I'm just weak after all..§r").build() + ); + } + + + @Override + public List<HealthData> getHealths() { + List<HealthData> healths = new ArrayList<HealthData>(); + long health = 0; + if (bonzoStand != null) { + String name = TextUtils.stripColor(bonzoStand.getName()); + String healthPart = name.split(" ")[2]; + health = TextUtils.reverseFormat(healthPart.substring(0, healthPart.length() - 1)); + System.out.println(healthPart.substring(0, healthPart.length() - 1) + " / "+ health); + } + healths.add(new HealthData("Bonzo", (int) health,250000 , this.getCurrentPhase().startsWith("fight-"))); + return healths; + } + + private EntityArmorStand bonzoStand; + @Override + public void onEntitySpawn(LivingEvent.LivingUpdateEvent updateEvent) { + if (updateEvent.entityLiving.getName().startsWith("§c§lBonzo§r ") && updateEvent.entityLiving instanceof EntityArmorStand) { + System.out.println(updateEvent.entityLiving.getName()); + bonzoStand = (EntityArmorStand) updateEvent.entityLiving; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java index 78dfd060..fa18262d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java @@ -33,6 +33,6 @@ public class BossfightProcessorLivid extends GeneralBossfightProcessor { @Override public List<HealthData> getHealths() { ArrayList<HealthData> healthData = new ArrayList<HealthData>(); - return super.getHealths(); + return healthData; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java index 2b1ce71c..f7fa009b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java @@ -10,15 +10,12 @@ import net.minecraftforge.event.entity.living.LivingEvent; import java.util.*; -public class GeneralBossfightProcessor implements BossfightProcessor { +public abstract class GeneralBossfightProcessor implements BossfightProcessor { private Map<String, PhaseData> phases = new HashMap<String, PhaseData>(); private PhaseData currentPhase = null; @Getter @Setter - private int bossMaxHealth = 100; - @Getter - @Setter private String name; private World world; @@ -44,13 +41,6 @@ public class GeneralBossfightProcessor implements BossfightProcessor { return phases; } - @Override - public List<HealthData> getHealths() { - ArrayList<HealthData> arr = new ArrayList<HealthData>(); - arr.add(new HealthData(name, (int) (bossMaxHealth * BossStatus.healthScale), bossMaxHealth)); - return arr; - } - @Override public String getCurrentPhase() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java index 66a727dd..9a9ed82b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java @@ -11,4 +11,5 @@ public class HealthData { private String name; private int health; private int maxHealth; + private boolean attackable; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java index a27a1695..01f6ebe3 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java @@ -61,6 +61,16 @@ public class TextUtils { boolean hasDecimal = (truncated < 100L && (truncated / 10.0D) != (truncated / 10L)); return hasDecimal ? ((truncated / 10.0D) + suffix) : ((truncated / 10L) + suffix); } + public static long reverseFormat(String str2) { + String str = str2.toLowerCase(); + String integerPart = str.substring(0, str.length() - 1); + long multiplier = 1; + if (str.endsWith("k")) multiplier = 1000; + else if (str.endsWith("m")) multiplier = 1000000; + else if (str.endsWith("b")) multiplier = 1000000000; + else integerPart = str; + return (long) (Double.parseDouble(integerPart) * multiplier); + } public static String formatTime(long ms) { long seconds = ms / 1000; |