diff options
author | syeyoung <cyong06@naver.com> | 2021-02-26 02:37:18 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-26 02:37:18 +0900 |
commit | 0e2ae080900bcb9c34d2013848bd9d2c5bae1e28 (patch) | |
tree | a98c02f9c0417eff9bdc95afc85bcad7489c614f /src/main/java/kr | |
parent | c137266fe1bf1f85ea661fcea976303dc0474b30 (diff) | |
download | Skyblock-Dungeons-Guide-0e2ae080900bcb9c34d2013848bd9d2c5bae1e28.tar.gz Skyblock-Dungeons-Guide-0e2ae080900bcb9c34d2013848bd9d2c5bae1e28.tar.bz2 Skyblock-Dungeons-Guide-0e2ae080900bcb9c34d2013848bd9d2c5bae1e28.zip |
fairysoul warning
Diffstat (limited to 'src/main/java/kr')
4 files changed, 102 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index 15b02a6c..e3de783e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -10,6 +10,7 @@ import kr.syeyoung.dungeonsguide.features.impl.dungeon.*; import kr.syeyoung.dungeonsguide.features.impl.etc.*; import kr.syeyoung.dungeonsguide.features.impl.secret.FeatureActions; import kr.syeyoung.dungeonsguide.features.impl.secret.FeatureMechanicBrowse; +import kr.syeyoung.dungeonsguide.features.impl.secret.FeatureSoulRoomWarning; import lombok.Getter; import java.util.ArrayList; @@ -97,6 +98,7 @@ public class FeatureRegistry { public static final FeatureMechanicBrowse SECRET_BROWSE = register(new FeatureMechanicBrowse()); public static final FeatureActions SECRET_ACTIONS = register(new FeatureActions()); + public static final FeatureSoulRoomWarning SECRET_FAIRYSOUL = register(new FeatureSoulRoomWarning()); public static final SimpleFeature SECRET_AUTO_BROWSE_NEXT = register(new SimpleFeature("Secret", "Auto browse next secret.", "Auto browse best next secret after current one completes.\nthe first pathfinding of first secret needs to be triggered first in order for this option to work", "secret.autobrowse", false)); public static final SimpleFeature SECRET_AUTO_START = register(new SimpleFeature("Secret", "Auto browse secret upon entering room", "Auto browse best secret upon entering the room.", "secret.autouponenter", false)); public static final SimpleFeature SECRET_NEXT_KEY = register(new SimpleFeature("Secret", "Auto browse next secret upon pressing a key", "Auto browse the best next secret when you press key.\nChange key at your key settings (Settings -> Controls)", "secret.keyfornext", false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java new file mode 100644 index 00000000..bde07aec --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java @@ -0,0 +1,96 @@ +package kr.syeyoung.dungeonsguide.features.impl.secret; + +import com.google.common.collect.Lists; +import kr.syeyoung.dungeonsguide.SkyblockStatus; +import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig; +import kr.syeyoung.dungeonsguide.config.guiconfig.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; +import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.features.listener.GuiClickListener; +import kr.syeyoung.dungeonsguide.features.listener.GuiPreRenderListener; +import kr.syeyoung.dungeonsguide.features.listener.TickListener; +import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; +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.roomedit.gui.GuiDungeonAddSet; +import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonParameterEdit; +import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; +import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonValueEdit; +import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiIngameMenu; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraftforge.client.event.GuiScreenEvent; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.*; +import java.util.List; + +public class FeatureSoulRoomWarning extends TextHUDFeature implements TickListener { + + public FeatureSoulRoomWarning() { + super("Secret","Secret Soul Alert", "Alert if there is an fairy soul in the room", "secret.fairysoulwarn", true, getFontRenderer().getStringWidth("There is a fairy soul in this room!"), getFontRenderer().FONT_HEIGHT); + getStyles().add(new TextStyle("warning", new AColor(0xFF, 0x69,0x17,255), new AColor(0, 0,0,0), false)); + } + + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + @Override + public boolean isHUDViewable() { + return warning > System.currentTimeMillis(); + } + + @Override + public List<String> getUsedTextStyle() { + return Collections.singletonList("warning"); + } + + private UUID lastRoomUID = UUID.randomUUID(); + private long warning = Long.MAX_VALUE; + + private static final List<StyledText> text = new ArrayList<StyledText>(); + static { + text.add(new StyledText("There is a fairy soul in this room!", "warning")); + } + + @Override + public List<StyledText> getText() { + return text; + } + + + @Override + public void onTick() { + if (!skyblockStatus.isOnDungeon()) return; + if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) return; + DungeonContext context = skyblockStatus.getContext(); + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom == null) return; + if (!(dungeonRoom.getRoomProcessor() instanceof GeneralRoomProcessor)) return; + + if (!dungeonRoom.getDungeonRoomInfo().getUuid().equals(lastRoomUID)) { + for (DungeonMechanic value : dungeonRoom.getDungeonRoomInfo().getMechanics().values()) { + if (value instanceof DungeonFairySoul) + warning = System.currentTimeMillis() + 2500; + } + lastRoomUID = dungeonRoom.getDungeonRoomInfo().getUuid(); + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java index f92c92c0..edfe99ff 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java @@ -106,7 +106,7 @@ public abstract class TextHUDFeature extends GuiFeature implements StyledTextPro return new PanelDefaultParameterConfig(config, TextHUDFeature.this, Arrays.asList(new MPanel[] { new PanelTextParameterConfig(config, TextHUDFeature.this) - }), Collections.singleton("textStyles")); + }), Collections.singleton("textStylesNEW")); } }); return "base." + getKey() ; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java index 5733eca5..13eb53e3 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java @@ -629,11 +629,11 @@ public class RenderUtils { AxisAlignedBB axisAlignedBB; if (entity instanceof EntityArmorStand) { - axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -0.5, -0.4, 0.4, 1.5, 0.4); + axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4); } else if (entity instanceof EntityBat) { - axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -0.4, -0.4, 0.4, 0.4, 0.4); + axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.4, -0.4, 0.4, 0.4, 0.4); } else { - axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -0.5, -0.4, 0.4, 1.5, 0.4); + axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4); } Vec3 renderPos = new Vec3( @@ -641,7 +641,6 @@ public class RenderUtils { (float) (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks), (float) (entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks) ); - System.out.println(renderPos); GlStateManager.translate(axisAlignedBB.minX + renderPos.xCoord, axisAlignedBB.minY + renderPos.yCoord, axisAlignedBB.minZ + renderPos.zCoord); double x = axisAlignedBB.maxX - axisAlignedBB.minX; |