diff options
author | syeyoung <cyong06@naver.com> | 2021-02-28 00:09:13 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-28 00:09:13 +0900 |
commit | 38a65e1d183cde880fd0e88b22d5f58f3b487167 (patch) | |
tree | 6692f82f19f4f571a902e262e0fc97ceb2239e5a /src/main/java/kr/syeyoung/dungeonsguide/features/impl | |
parent | 01f5b97bd5e0f9369f883982752852c0fbb09bc1 (diff) | |
download | Skyblock-Dungeons-Guide-38a65e1d183cde880fd0e88b22d5f58f3b487167.tar.gz Skyblock-Dungeons-Guide-38a65e1d183cde880fd0e88b22d5f58f3b487167.tar.bz2 Skyblock-Dungeons-Guide-38a65e1d183cde880fd0e88b22d5f58f3b487167.zip |
fix bugs, add new feature
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
4 files changed, 147 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; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java index 28be7b78..7557820c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java @@ -72,6 +72,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener text.add(new StyledText(death.getKey(),"username")); text.add(new StyledText(": ","separator")); text.add(new StyledText(death.getValue()+"\n","deaths")); + deathsCnt += death.getValue(); } text.add(new StyledText("Total Deaths","total")); text.add(new StyledText(": ","separator")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureRepartyCommand.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureRepartyCommand.java new file mode 100644 index 00000000..5212b3ed --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureRepartyCommand.java @@ -0,0 +1,11 @@ +package kr.syeyoung.dungeonsguide.features.impl.etc; + +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +public class FeatureRepartyCommand extends SimpleFeature { + public FeatureRepartyCommand() { + super("ETC", "Enable Reparty Command From DG", "if you disable, /dg reparty will still work, Auto reparty will still work\nRequires Restart to get applied", "qol.reparty"); + parameters.put("command", new FeatureParameter<String>("command", "The Command", "Command that the reparty will be bound to", "reparty", "string")); + } +} |