aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-01-04 12:48:13 +0900
committersyeyoung <cyong06@naver.com>2021-01-04 12:48:13 +0900
commitc9f71d77a5912a70546d6a0950d7f8c2bb4c89db (patch)
tree178b888f877b489d20bef311662e9b15a023c6d5 /src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java
parentec76162b0017cbfb546038e4d55a1f062d99412a (diff)
downloadSkyblock-Dungeons-Guide-c9f71d77a5912a70546d6a0950d7f8c2bb4c89db.tar.gz
Skyblock-Dungeons-Guide-c9f71d77a5912a70546d6a0950d7f8c2bb4c89db.tar.bz2
Skyblock-Dungeons-Guide-c9f71d77a5912a70546d6a0950d7f8c2bb4c89db.zip
spirit boots, some fixes
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java
new file mode 100644
index 00000000..962e9350
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureBoxSkelemaster.java
@@ -0,0 +1,51 @@
+package kr.syeyoung.dungeonsguide.features.impl;
+
+import com.google.common.base.Predicate;
+import kr.syeyoung.dungeonsguide.SkyblockStatus;
+import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.features.FeatureParameter;
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.item.EntityArmorStand;
+import net.minecraft.entity.monster.EntitySkeleton;
+import net.minecraft.util.BlockPos;
+import org.jetbrains.annotations.Nullable;
+
+import java.awt.*;
+import java.util.List;
+
+
+public class FeatureBoxSkelemaster extends SimpleFeature implements WorldRenderListener {
+ public FeatureBoxSkelemaster() {
+ super("Dungeon", "Box Skeleton Masters", "Box skeleton masters in dungeons", "dungeon.skeletonmasterbox", true);
+ parameters.put("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and skeletonmaster to be boxed", 20, "integer"));
+ parameters.put("color", new FeatureParameter<Color>("color", "Highlight Color", "Highlight Color of Skeleton master", Color.red, "color"));
+ }
+
+
+ private SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+ @Override
+ public void drawWorld(float partialTicks) {
+ if (!isEnabled()) return;
+ if (!skyblockStatus.isOnDungeon()) return;
+
+ final BlockPos player = Minecraft.getMinecraft().thePlayer.getPosition();
+ int val = this.<Integer>getParameter("radius").getValue();
+ final int sq = val * val;
+
+ List<EntityArmorStand> skeletonList = Minecraft.getMinecraft().theWorld.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() {
+ @Override
+ public boolean apply(@Nullable EntityArmorStand input) {
+ if (player.distanceSq(input.getPosition()) > sq) return false;
+ return input.getName().contains("Skeleton Master");
+ }
+ });
+ Color c = this.<Color>getParameter("color").getValue();
+ Color real = new Color(c.getRGB() & 0xFFFFFF | 0x44000000, true);
+ for (EntityArmorStand entitySkeleton : skeletonList) {
+ RenderUtils.highlightBox(entitySkeleton, real, partialTicks, false);
+ }
+ }
+}