aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java57
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java78
2 files changed, 135 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java
new file mode 100644
index 00000000..66399235
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java
@@ -0,0 +1,57 @@
+package kr.syeyoung.dungeonsguide.features.impl.boss;
+
+import kr.syeyoung.dungeonsguide.SkyblockStatus;
+import kr.syeyoung.dungeonsguide.config.types.AColor;
+import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.features.FeatureParameter;
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+import kr.syeyoung.dungeonsguide.features.listener.EntityLivingRenderListener;
+import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener;
+import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorLivid;
+import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorThorn;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
+import net.minecraft.client.entity.EntityOtherPlayerMP;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.passive.*;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraftforge.client.event.RenderLivingEvent;
+
+
+public class FeatureHideAnimals extends SimpleFeature implements EntityLivingRenderListener {
+ public FeatureHideAnimals() {
+ super("Bossfight", "Hide animals on f4", "Hide Soirit Animals on F4. \nClick on Edit for precise setting", "bossfight.hideanimals", false);
+ parameters.put("sheep", new FeatureParameter<Boolean>("sheep", "Hide Sheeps", "Hide Sheeps", true, "boolean"));
+ parameters.put("cow", new FeatureParameter<Boolean>("cow", "Hide Cows", "Hide Cows", true, "boolean"));
+ parameters.put("chicken", new FeatureParameter<Boolean>("chicken", "Hide Chickens", "Hide Chickens", true, "boolean"));
+ parameters.put("wolf", new FeatureParameter<Boolean>("wolf", "Hide Wolves", "Hide Wolves", true, "boolean"));
+ parameters.put("rabbit", new FeatureParameter<Boolean>("rabbit", "Hide Rabbits", "Hide Rabbits", true, "boolean"));
+ }
+
+
+ private SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+
+ @Override
+ public void onEntityRenderPre(RenderLivingEvent.Pre renderPlayerEvent) {
+ if (!isEnabled()) return;
+ if (!skyblockStatus.isOnDungeon()) return;
+ if (skyblockStatus.getContext().getBossfightProcessor() == null) return;
+ if (!(skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return;
+
+ if (renderPlayerEvent.entity instanceof EntitySheep && this.<Boolean>getParameter("sheep").getValue()) {
+ renderPlayerEvent.setCanceled(true);
+ } else if (renderPlayerEvent.entity instanceof EntityCow && this.<Boolean>getParameter("cow").getValue() ) {
+ renderPlayerEvent.setCanceled(true);
+ } else if (renderPlayerEvent.entity instanceof EntityChicken && this.<Boolean>getParameter("chicken").getValue()) {
+ renderPlayerEvent.setCanceled(true);
+ } else if (renderPlayerEvent.entity instanceof EntityWolf && this.<Boolean>getParameter("wolf").getValue()) {
+ renderPlayerEvent.setCanceled(true);
+ } else if (renderPlayerEvent.entity instanceof EntityRabbit && this.<Boolean>getParameter("rabbit").getValue()) {
+ renderPlayerEvent.setCanceled(true);
+ }
+ }
+
+ @Override
+ public void onEntityRenderPost(RenderLivingEvent.Post renderPlayerEvent) {
+
+ }
+}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java
new file mode 100644
index 00000000..26ccaa1b
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java
@@ -0,0 +1,78 @@
+package kr.syeyoung.dungeonsguide.features.impl.boss;
+
+import kr.syeyoung.dungeonsguide.SkyblockStatus;
+import kr.syeyoung.dungeonsguide.config.types.AColor;
+import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.features.listener.ChatListener;
+import kr.syeyoung.dungeonsguide.features.listener.TitleListener;
+import kr.syeyoung.dungeonsguide.features.text.StyledText;
+import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature;
+import kr.syeyoung.dungeonsguide.features.text.TextStyle;
+import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorThorn;
+import kr.syeyoung.dungeonsguide.utils.TextUtils;
+import net.minecraft.network.play.server.S45PacketTitle;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class FeatureThornSpiritBowTimer extends TextHUDFeature implements ChatListener, TitleListener {
+ public FeatureThornSpiritBowTimer() {
+ super("Bossfight", "Display Spirit bow timer", "Displays how long until spirit bow gets destroyed", "bossfight.spiritbowdisplay", false, getFontRenderer().getStringWidth("Spirit Bow Destruction: 2m 00s"), getFontRenderer().FONT_HEIGHT);
+ getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false));
+ getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false));
+ getStyles().add(new TextStyle("time", new AColor(0x55, 0xFF,0xFF,255), new AColor(0, 0,0,0), false));
+ }
+
+ SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+
+ private static final List<StyledText> dummyText= new ArrayList<StyledText>();
+ static {
+ dummyText.add(new StyledText("Spirit Bow Destruction","title"));
+ dummyText.add(new StyledText(": ","separator"));
+ dummyText.add(new StyledText("1s","time"));
+ }
+ @Override
+ public boolean isHUDViewable() {
+ return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn && time > System.currentTimeMillis();
+ }
+
+ @Override
+ public List<String> getUsedTextStyle() {
+ return Arrays.asList(new String[] {
+ "title", "separator", "time"
+ });
+ }
+
+ @Override
+ public List<StyledText> getDummyText() {
+ return dummyText;
+ }
+
+ @Override
+ public List<StyledText> getText() {
+ List<StyledText> actualBit = new ArrayList<StyledText>();
+ actualBit.add(new StyledText("Spirit Bow Destruction","title"));
+ actualBit.add(new StyledText(": ","separator"));
+ actualBit.add(new StyledText(TextUtils.formatTime(time - System.currentTimeMillis()),"time"));
+ return actualBit;
+ }
+ private long time = 0;
+
+ @Override
+ public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) {
+ if (!(skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return;
+ if (clientChatReceivedEvent.message.getFormattedText().equals("§r§a§lThe §r§5§lSpirit Bow §r§a§lhas dropped!§r")) {
+ time = System.currentTimeMillis() + 16000;
+ }
+ }
+
+ @Override
+ public void onTitle(S45PacketTitle renderPlayerEvent) {
+ if (!(skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return;
+ if (renderPlayerEvent.getMessage().getFormattedText().contains("picked up")) {
+ time = System.currentTimeMillis() + 21000;
+ }
+ }
+}