diff options
author | syeyoung <cyong06@naver.com> | 2021-02-27 01:20:27 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-27 01:20:27 +0900 |
commit | 519e968743e29e32afa760a15e3b3fac8c635b06 (patch) | |
tree | d143c223b9d2c26484b41b6ed9c12c04876e55fb /src | |
parent | 03073d2166e610558a95d002dcdcaf36dfda4e30 (diff) | |
download | Skyblock-Dungeons-Guide-519e968743e29e32afa760a15e3b3fac8c635b06.tar.gz Skyblock-Dungeons-Guide-519e968743e29e32afa760a15e3b3fac8c635b06.tar.bz2 Skyblock-Dungeons-Guide-519e968743e29e32afa760a15e3b3fac8c635b06.zip |
fix streams i guess
Diffstat (limited to 'src')
12 files changed, 109 insertions, 54 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java index 1587393c..0bf58873 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -17,6 +17,7 @@ import java.util.List; @Data public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { + private static final long serialVersionUID = 1161593374765852217L; private OffsetPointSet secretPoint = new OffsetPointSet(); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java index 9c16a481..c57771ca 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java @@ -17,6 +17,7 @@ import java.util.*; @Data public class DungeonDoor implements DungeonMechanic, RouteBlocker { + private static final long serialVersionUID = -1011605722415475761L; private OffsetPointSet secretPoint = new OffsetPointSet(); private List<String> openPreRequisite = new ArrayList<String>(); private List<String> closePreRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java index 139e32a2..2c470f1b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java @@ -16,6 +16,7 @@ import java.util.Set; @Data public class DungeonDummy implements DungeonMechanic { + private static final long serialVersionUID = -8449664812034435765L; private OffsetPoint secretPoint = new OffsetPoint(0,0,0); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java index 3b8e6a5c..97bd2b67 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java @@ -15,6 +15,7 @@ import java.util.*; @Data public class DungeonFairySoul implements DungeonMechanic { + private static final long serialVersionUID = 156412742320519783L; private OffsetPoint secretPoint = new OffsetPoint(0,0,0); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java index 5d5a5776..cd3deb45 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java @@ -18,6 +18,7 @@ import java.util.Set; @Data public class DungeonJournal implements DungeonMechanic { + private static final long serialVersionUID = 4117372070037496743L; private OffsetPoint secretPoint = new OffsetPoint(0,0,0); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java index ea1f7aa5..1d3c71b8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java @@ -20,6 +20,7 @@ import java.util.Set; @Data public class DungeonNPC implements DungeonMechanic { + private static final long serialVersionUID = -89487601113028763L; private OffsetPoint secretPoint = new OffsetPoint(0,0,0); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java index 80a9beed..e5de0235 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java @@ -18,6 +18,7 @@ import java.util.*; @Data public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker { + private static final long serialVersionUID = -1810891721127873330L; private OffsetPointSet secretPoint = new OffsetPointSet(); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java index bac4d7e3..f55fff20 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java @@ -14,6 +14,7 @@ import java.util.List; @Data public class DungeonOnewayLever implements DungeonMechanic { + private static final long serialVersionUID = -3203171200265540652L; private OffsetPoint leverPoint = new OffsetPoint(0,0,0); private List<String> preRequisite = new ArrayList<String>(); private String triggering = ""; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java index 75231eff..4a85c059 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java @@ -14,6 +14,7 @@ import java.util.List; @Data public class DungeonPressurePlate implements DungeonMechanic { + private static final long serialVersionUID = 7450034718355390645L; private OffsetPoint platePoint = new OffsetPoint(0,0,0); private List<String> preRequisite = new ArrayList<String>(); private String triggering = ""; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java index f2c93624..a88d0333 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java @@ -24,6 +24,8 @@ import java.util.List; @Data public class DungeonSecret implements DungeonMechanic { + private static final long serialVersionUID = 8784808599222706537L; + private OffsetPoint secretPoint = new OffsetPoint(0,0,0); private SecretType secretType = SecretType.CHEST; private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java index 2a17bbc8..a03f8605 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java @@ -17,6 +17,7 @@ import java.util.List; @Data public class DungeonTomb implements DungeonMechanic, RouteBlocker { + private static final long serialVersionUID = -7347076019472222115L; private OffsetPointSet secretPoint = new OffsetPointSet(); private List<String> preRequisite = new ArrayList<String>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java index 357c5636..e378fadd 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java @@ -11,10 +11,7 @@ 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.BossroomEnterListener; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonStartListener; +import kr.syeyoung.dungeonsguide.features.listener.*; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import kr.syeyoung.dungeonsguide.utils.TextUtils; import net.minecraft.block.material.MapColor; @@ -59,6 +56,7 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, parameters.put("playerCenter", new FeatureParameter<Boolean>("playerCenter", "Center map at player", "Render you in the center", false, "boolean")); parameters.put("rotate", new FeatureParameter<Boolean>("rotate", "Rotate map centered at player", "Only works with Center map at player enabled", false, "boolean")); parameters.put("postScale", new FeatureParameter<Float>("postScale", "Scale factor of map", "Only works with Center map at player enabled", 1.0f, "float")); + parameters.put("useplayerheads", new FeatureParameter<Boolean>("useplayerheads", "Use player heads instead of arrows", "Option to use player heads instead of arrows", true, "boolean")); parameters.put("showotherplayers", new FeatureParameter<Boolean>("showotherplayers", "Show other players", "Option to show other players in map", true, "boolean")); parameters.put("showtotalsecrets", new FeatureParameter<Boolean>("showtotalsecrets", "Show Total secrets in the room", "Option to overlay total secrets in the specific room", true, "boolean")); parameters.put("playerheadscale", new FeatureParameter<Float>("playerheadscale", "Player head scale", "Scale factor of player heads, defaults to 1", 1.0f, "float")); @@ -163,58 +161,13 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1); + if (this.<Boolean>getParameter("useplayerheads").getValue()) { + renderHeads(mapProcessor, mapData, scale, postScale, partialTicks); + } else { + renderArrows(mapProcessor, mapData, scale, postScale, partialTicks); + } - List<NetworkPlayerInfo> list = field_175252_a.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); - if (list.size() < 40) return; - for (int i = 1; i < 20; i++) { - NetworkPlayerInfo networkPlayerInfo = list.get(i); - String name = networkPlayerInfo.getDisplayName() != null ? networkPlayerInfo.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName()); - if (name.trim().equals("§r") || name.startsWith("§r ")) continue; - String actual = TextUtils.stripColor(name).trim().split(" ")[0]; - EntityPlayer entityplayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(actual); - if (TextUtils.stripColor(name).endsWith("(DEAD)") && entityplayer != Minecraft.getMinecraft().thePlayer) { - continue; - } - Point pt2; - double yaw2; - - if (entityplayer != null && (!entityplayer.isInvisible() || entityplayer == Minecraft.getMinecraft().thePlayer)) { - pt2 = mapProcessor.worldPointToMapPoint(entityplayer.getPositionEyes(partialTicks)); - yaw2 = entityplayer.prevRotationYawHead + (entityplayer.rotationYawHead - entityplayer.prevRotationYawHead) * partialTicks; - } else { - String iconName = mapProcessor.getMapIconToPlayerMap().get(actual); - if (iconName == null) continue; - Vec4b vec = mapData.mapDecorations.get(iconName); - if (vec == null) { - continue; - } else { - pt2 = new Point(vec.func_176112_b() / 2 + 64, vec.func_176113_c() / 2 + 64); - yaw2 = vec.func_176111_d() * 360 / 16.0f ; - } - } - GlStateManager.pushMatrix(); - if (entityplayer == Minecraft.getMinecraft().thePlayer || this.<Boolean>getParameter("showotherplayers").getValue()) - { - boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE); - GlStateManager.enableTexture2D(); - Minecraft.getMinecraft().getTextureManager().bindTexture(networkPlayerInfo.getLocationSkin()); - int l2 = 8 + (flag1 ? 8 : 0); - int i3 = 8 * (flag1 ? -1 : 1); - - GlStateManager.translate(pt2.x, pt2.y, 0); - GlStateManager.rotate((float) (yaw2 - 180), 0, 0, 1); - - GlStateManager.scale(1 / scale, 1 / scale, 0); - GlStateManager.scale(1 / postScale, 1 / postScale, 0); - float s = this.<Float>getParameter("playerheadscale").getValue(); - GlStateManager.scale(s,s,0); - Gui.drawScaledCustomSizeModalRect(-4, -4, 8.0F, (float) l2, 8, i3, 8, 8, 64.0F, 64.0F); - GL11.glLineWidth(1); - RenderUtils.drawUnfilledBox(-4,-4,4, 4, this.<AColor>getParameter("player_color").getValue()); - } - GlStateManager.popMatrix(); - } FontRenderer fr = getFontRenderer(); if (this.<Boolean>getParameter("showtotalsecrets").getValue()) { for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { @@ -293,6 +246,96 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, this.mapTexture.updateDynamicTexture(); } + private void renderHeads(MapProcessor mapProcessor, MapData mapData, float scale, float postScale, float partialTicks) { + List<NetworkPlayerInfo> list = field_175252_a.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); + if (list.size() < 40) return; + for (int i = 1; i < 20; i++) { + NetworkPlayerInfo networkPlayerInfo = list.get(i); + String name = networkPlayerInfo.getDisplayName() != null ? networkPlayerInfo.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName()); + if (name.trim().equals("§r") || name.startsWith("§r ")) continue; + String actual = TextUtils.stripColor(name).trim().split(" ")[0]; + EntityPlayer entityplayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(actual); + if (TextUtils.stripColor(name).endsWith("(DEAD)") && entityplayer != Minecraft.getMinecraft().thePlayer) { + continue; + } + Point pt2; + double yaw2; + + if (entityplayer != null && (!entityplayer.isInvisible() || entityplayer == Minecraft.getMinecraft().thePlayer)) { + pt2 = mapProcessor.worldPointToMapPoint(entityplayer.getPositionEyes(partialTicks)); + yaw2 = entityplayer.prevRotationYawHead + (entityplayer.rotationYawHead - entityplayer.prevRotationYawHead) * partialTicks; + } else { + String iconName = mapProcessor.getMapIconToPlayerMap().get(actual); + if (iconName == null) continue; + Vec4b vec = mapData.mapDecorations.get(iconName); + if (vec == null) { + continue; + } else { + pt2 = new Point(vec.func_176112_b() / 2 + 64, vec.func_176113_c() / 2 + 64); + yaw2 = vec.func_176111_d() * 360 / 16.0f ; + } + } + GlStateManager.pushMatrix(); + if (entityplayer == Minecraft.getMinecraft().thePlayer || this.<Boolean>getParameter("showotherplayers").getValue()) + { + boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE); + GlStateManager.enableTexture2D(); + Minecraft.getMinecraft().getTextureManager().bindTexture(networkPlayerInfo.getLocationSkin()); + int l2 = 8 + (flag1 ? 8 : 0); + int i3 = 8 * (flag1 ? -1 : 1); + + GlStateManager.translate(pt2.x, pt2.y, 0); + GlStateManager.rotate((float) (yaw2 - 180), 0, 0, 1); + + GlStateManager.scale(1 / scale, 1 / scale, 0); + GlStateManager.scale(1 / postScale, 1 / postScale, 0); + float s = this.<Float>getParameter("playerheadscale").getValue(); + GlStateManager.scale(s,s,0); + Gui.drawScaledCustomSizeModalRect(-4, -4, 8.0F, (float) l2, 8, i3, 8, 8, 64.0F, 64.0F); + GL11.glLineWidth(1); + RenderUtils.drawUnfilledBox(-4,-4,4, 4, this.<AColor>getParameter("player_color").getValue()); + } + GlStateManager.popMatrix(); + } + } + private static final ResourceLocation mapIcons = new ResourceLocation("textures/map/map_icons.png"); + + private void renderArrows(MapProcessor mapProcessor, MapData mapData, float scale, float postScale, float partialTicks) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int k = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(mapIcons); + for (Vec4b vec4b : mapData.mapDecorations.values()) { + if (vec4b.func_176110_a() == 1 || this.<Boolean>getParameter("showotherplayers").getValue()) { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)vec4b.func_176112_b() / 2.0F + 64.0F, (float)vec4b.func_176113_c() / 2.0F + 64.0F, -0.02F); + GlStateManager.rotate((float)(vec4b.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F); + + GlStateManager.scale(1 / scale, 1 / scale, 0); + GlStateManager.scale(1 / postScale, 1 / postScale, 0); + float s = this.<Float>getParameter("playerheadscale").getValue(); + GlStateManager.scale(s,s,0); + + GlStateManager.translate(-0.125F, 0.125F, 0.0F); + byte b0 = vec4b.func_176110_a(); + float f1 = (float)(b0 % 4) / 4.0F; + float f2 = (float)(b0 / 4) / 4.0F; + float f3 = (float)(b0 % 4 + 1) / 4.0F; + float f4 = (float)(b0 / 4 + 1) / 4.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + float f5 = -0.001F; + worldrenderer.pos(-1.0D, 1.0D, (double)((float)k * -0.001F)).tex((double)f1, (double)f2).endVertex(); + worldrenderer.pos(1.0D, 1.0D, (double)((float)k * -0.001F)).tex((double)f3, (double)f2).endVertex(); + worldrenderer.pos(1.0D, -1.0D, (double)((float)k * -0.001F)).tex((double)f3, (double)f4).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, (double)((float)k * -0.001F)).tex((double)f1, (double)f4).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + ++k; + } + GlStateManager.popMatrix(); + } + } + private void render(MapData mapData, boolean noOverlayRendering) { int i = 0; int j = 0; |