diff options
| author | TymanWasTaken <tyman@tyman.tech> | 2021-05-09 17:12:33 -0600 |
|---|---|---|
| committer | TymanWasTaken <tyman@tyman.tech> | 2021-05-09 17:12:33 -0600 |
| commit | 4cbfc5b1c7ccf59e54a068e95f0aed3c9393bbf0 (patch) | |
| tree | c0544d4966050c2634f24f2c4e4b9f13c3b02f4c /src/main/java | |
| parent | a4ab012573628ed7f45a2368fd28a78039935aa4 (diff) | |
| parent | b64db8d662cbe5ab842c4ff2f061cf73e33dde6e (diff) | |
| download | Skyblock-Dungeons-Guide-4cbfc5b1c7ccf59e54a068e95f0aed3c9393bbf0.tar.gz Skyblock-Dungeons-Guide-4cbfc5b1c7ccf59e54a068e95f0aed3c9393bbf0.tar.bz2 Skyblock-Dungeons-Guide-4cbfc5b1c7ccf59e54a068e95f0aed3c9393bbf0.zip | |
Merge branch 'cyoung06:master' into patch-1
Diffstat (limited to 'src/main/java')
36 files changed, 354 insertions, 66 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/Main.java b/src/main/java/kr/syeyoung/dungeonsguide/Main.java index 85323acf..4983acba 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/Main.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/Main.java @@ -80,7 +80,7 @@ public class Main while (progressBar.getStep() < progressBar.getSteps()) progressBar.step("random-"+progressBar.getStep()); ProgressManager.pop(progressBar); - } catch (Exception e) { + } catch (Throwable e) { e.printStackTrace(); throwError(new String[]{ @@ -95,14 +95,12 @@ public class Main } throwError(new String[]{ - "Can't validate current installation of Dungeons Guide", + "Can't authenticate session", "Steps to fix", "1. check if other people can't join minecraft servers.", - "2. restart minecraft launcher", + "2. physically click on logout button, then login again", "3. make sure you're on the right account", - "4. restart your computer", - "If the problem persists after following these steps, please contact developer", - "If you haven't purchased the mod, please consider doing so" + "If the problem persists after following these steps, please contact developer" }); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java index 411d7dc9..d1175563 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java @@ -77,7 +77,9 @@ public class RichPresenceManager implements Runnable { if (!skyblockStatus.isOnHypixel() || !FeatureRegistry.ADVANCED_RICHPRESENCE.isEnabled() || (!skyblockStatus.isOnSkyblock() && FeatureRegistry.ADVANCED_RICHPRESENCE.<Boolean>getParameter("disablenotskyblock").getValue())) { DiscordRPC.discordClearPresence(); } else { - DiscordRichPresence.Builder richPresenceBuilder = new DiscordRichPresence.Builder(skyblockStatus.getDungeonName()); + String name = skyblockStatus.getDungeonName(); + if (name.trim().equals("Your Island")) name = "Private Island"; + DiscordRichPresence.Builder richPresenceBuilder = new DiscordRichPresence.Builder(name); richPresenceBuilder.setBigImage("mort", "mort") .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), PartyManager.INSTANCE.getMaxParty()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index 48464b1f..5a09eab6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -21,6 +21,7 @@ package kr.syeyoung.dungeonsguide.commands; import com.google.gson.JsonObject; import kr.syeyoung.dungeonsguide.DungeonsGuide; import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig; +import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; @@ -358,6 +359,10 @@ public class CommandDungeonsGuide extends CommandBase { } } else if (args[0].equals("purge")) { ApiFetchur.purgeCache(); + CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); + cosmeticsManager.requestPerms(); + cosmeticsManager.requestCosmeticsList(); + cosmeticsManager.requestActiveCosmetics(); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully purged API Cache!")); } else { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java index e27ba5f1..18828abd 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java @@ -32,6 +32,7 @@ import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.BufferUtils; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.io.IOException; @@ -39,6 +40,7 @@ import java.nio.FloatBuffer; import java.util.List; import java.util.Map; import java.util.Stack; +import java.util.stream.Collectors; public class GuiConfig extends GuiScreen { @@ -74,6 +76,14 @@ public class GuiConfig extends GuiScreen { } }); } + tabbedPane.addBookmark("All", "base.all"); + + ConfigPanelCreator.map.put("base.all", new Supplier<MPanel>() { + @Override + public MPanel get() { + return new FeatureEditPane(FeatureRegistry.getFeatureList().stream().filter( a-> !a.getCategory().equals("hidden")).collect(Collectors.toList()), GuiConfig.this); + } + }); this.tabbedPane = tabbedPane; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java index 7e751a9c..4e29eae4 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java @@ -33,6 +33,7 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.Arrays; @@ -112,6 +113,9 @@ public class MFeature extends MPanel { GlStateManager.pushMatrix(); GlStateManager.translate(5,5,0); GlStateManager.scale(1.0,1.0,0); + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); fr.drawString(feature.getName(), 0,0, 0xFFFFFFFF); GlStateManager.popMatrix(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java index 05e66046..db79f329 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java @@ -28,11 +28,13 @@ import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.play.server.S38PacketPlayerListItem; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -41,22 +43,25 @@ import org.json.JSONArray; import org.json.JSONObject; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CopyOnWriteArraySet; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CosmeticsManager implements StompMessageHandler { @Getter - private Map<UUID, CosmeticData> cosmeticDataMap = new HashMap<>(); + private Map<UUID, CosmeticData> cosmeticDataMap = new ConcurrentHashMap<>(); @Getter - private Map<UUID, ActiveCosmetic> activeCosmeticMap = new HashMap<>(); + private Map<UUID, ActiveCosmetic> activeCosmeticMap = new ConcurrentHashMap<>(); @Getter - private Map<String, List<ActiveCosmetic>> activeCosmeticByType = new HashMap<>(); + private Map<String, List<ActiveCosmetic>> activeCosmeticByType = new ConcurrentHashMap<>(); @Getter - private Map<UUID, List<ActiveCosmetic>> activeCosmeticByPlayer = new HashMap<>(); + private Map<UUID, List<ActiveCosmetic>> activeCosmeticByPlayer = new ConcurrentHashMap<>(); @Getter - private Map<String, List<ActiveCosmetic>> activeCosmeticByPlayerNameLowerCase = new HashMap<>(); + private Map<String, List<ActiveCosmetic>> activeCosmeticByPlayerNameLowerCase = new ConcurrentHashMap<>(); @Getter - private Set<String> perms = new HashSet<>(); + private Set<String> perms = new CopyOnWriteArraySet<>(); public void requestActiveCosmetics() { DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload() @@ -103,15 +108,15 @@ public class CosmeticsManager implements StompMessageHandler { if (jsonObject.isNull("cosmeticUID")) { ActiveCosmetic activeCosmetic1 = activeCosmeticMap.remove(activeCosmetic.getActivityUID()); - List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(activeCosmetic.getPlayerUID(), a-> new ArrayList<>()); + List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(activeCosmetic.getPlayerUID(), a-> new CopyOnWriteArrayList<>()); activeCosmetics.remove(activeCosmetic1); - activeCosmetics = activeCosmeticByPlayerNameLowerCase.computeIfAbsent(activeCosmetic.getUsername().toLowerCase(), a-> new ArrayList<>()); + activeCosmetics = activeCosmeticByPlayerNameLowerCase.computeIfAbsent(activeCosmetic1.getUsername().toLowerCase(), a-> new CopyOnWriteArrayList<>()); activeCosmetics.remove(activeCosmetic1); CosmeticData cosmeticData = cosmeticDataMap.get(activeCosmetic.getCosmeticData()); if (cosmeticData != null) { - List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new ArrayList<>()); + List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new CopyOnWriteArrayList<>()); cosmeticsByTypeList.remove(activeCosmetic1); } } else { @@ -123,19 +128,25 @@ public class CosmeticsManager implements StompMessageHandler { CosmeticData cosmeticData = cosmeticDataMap.get(activeCosmetic.getCosmeticData()); if (cosmeticData != null) { - List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new ArrayList<>()); + List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new CopyOnWriteArrayList<>()); cosmeticsByTypeList.add(activeCosmetic); cosmeticsByTypeList.remove(previousThing); } - List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(activeCosmetic.getPlayerUID(), a-> new ArrayList<>()); + List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(activeCosmetic.getPlayerUID(), a-> new CopyOnWriteArrayList<>()); activeCosmetics.add(activeCosmetic); activeCosmetics.remove(previousThing); - activeCosmetics = activeCosmeticByPlayerNameLowerCase.computeIfAbsent(activeCosmetic.getUsername().toLowerCase(), a-> new ArrayList<>()); + activeCosmetics = activeCosmeticByPlayerNameLowerCase.computeIfAbsent(activeCosmetic.getUsername().toLowerCase(), a-> new CopyOnWriteArrayList<>()); activeCosmetics.add(activeCosmetic); activeCosmetics.remove(previousThing); } + try { + if (Minecraft.getMinecraft().theWorld != null) { + EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(activeCosmetic.getPlayerUID()); + if (entityPlayer != null) entityPlayer.refreshDisplayName(); + } + } catch (Exception e) {e.printStackTrace();} } else if (destination.equals("/user/queue/reply/user.perms")) { JSONArray object = new JSONArray(stompPayload.payload()); @@ -156,6 +167,12 @@ public class CosmeticsManager implements StompMessageHandler { cosmeticData.setUsername(jsonObject.getString("username")); activeCosmeticMap.put(cosmeticData.getActivityUID(), cosmeticData); + try { + if (Minecraft.getMinecraft().theWorld != null) { + EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(cosmeticData.getPlayerUID()); + if (entityPlayer != null) entityPlayer.refreshDisplayName(); + } + } catch (Exception e) {e.printStackTrace();} } this.activeCosmeticMap = activeCosmeticMap; rebuildCaches(); @@ -185,12 +202,12 @@ public class CosmeticsManager implements StompMessageHandler { for (ActiveCosmetic value : activeCosmeticMap.values()) { CosmeticData cosmeticData = cosmeticDataMap.get(value.getCosmeticData()); if (cosmeticData != null) { - List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new ArrayList<>()); + List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new CopyOnWriteArrayList<>()); cosmeticsByTypeList.add(value); } - List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(value.getPlayerUID(), a-> new ArrayList<>()); + List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(value.getPlayerUID(), a-> new CopyOnWriteArrayList<>()); activeCosmetics.add(value); - activeCosmetics = activeCosmeticByPlayerName.computeIfAbsent(value.getUsername().toLowerCase(), a-> new ArrayList<>()); + activeCosmetics = activeCosmeticByPlayerName.computeIfAbsent(value.getUsername().toLowerCase(), a-> new CopyOnWriteArrayList<>()); activeCosmetics.add(value); } @@ -224,22 +241,23 @@ public class CosmeticsManager implements StompMessageHandler { // §r§bCo-op > §a[VIP§6+§a] syeyoung§f: §rwhat§r public static String substitute(String str) { - str = str.replace("{HYPIXEL_RANKED_NAME}", "§.(?:\\[[a-zA-Z\\+§0-9]+\\] )?{MC_NAME}"); - str = str.replace("{HYPIXEL_RANKED_NAME_PAT}", "(§.(?:\\[[a-zA-Z\\+§0-9]+\\] )?)({MC_NAME})"); + str = str.replace("{HYPIXEL_RANKED_NAME}", "{ANY_COLOR}(?:\\[[a-zA-Z\\+§0-9]+\\] )?{MC_NAME}"); + str = str.replace("{HYPIXEL_RANKED_NAME_PAT}", "({ANY_COLOR}(?:\\[[a-zA-Z\\+§0-9]+\\] )?)({MC_NAME})"); + str = str.replace("{ISLAND_VISITOR}", "(?:§r§a\\[✌\\] )"); + str = str.replace("{RANK}", "(?:{ANY_COLOR}\\[.+\\] )"); str = str.replace("{MC_NAME}", "[a-zA-Z0-9_]+"); - str = str.replace("{ANY_COLOR}", "(?:§[a-zA-Z0-9])+"); + str = str.replace("{ANY_COLOR}", "(?:§[a-zA-Z0-9])*"); return str; } - private static final Pattern PARTY_MSG = Pattern.compile(substitute("§r§9Party §8> {HYPIXEL_RANKED_NAME_PAT}({ANY_COLOR}): (.+)")); - private static final Pattern GUILD_MSG = Pattern.compile(substitute("§r§2Guild > {HYPIXEL_RANKED_NAME_PAT} ({ANY_COLOR}\\[.+\\]{ANY_COLOR}): (.+)")); - private static final Pattern CHAT_MSG = Pattern.compile(substitute("(?:§r)?{HYPIXEL_RANKED_NAME_PAT}({ANY_COLOR}): (.+)")); + private static final Pattern GUILD_MSG = Pattern.compile(substitute("§r§2Guild > {HYPIXEL_RANKED_NAME_PAT}((?: {ANY_COLOR}\\[.+\\])?{ANY_COLOR}): (.+)")); + private static final Pattern CHAT_MSG = Pattern.compile(substitute("({ISLAND_VISITOR}?{RANK}?){HYPIXEL_RANKED_NAME_PAT}({ANY_COLOR}): (.+)")); private static final Pattern COOP_MSG = Pattern.compile(substitute("§r§bCo-op > {HYPIXEL_RANKED_NAME_PAT}({ANY_COLOR}): (.+)")); private static final Pattern DM_TO = Pattern.compile(substitute("§dTo §r{HYPIXEL_RANKED_NAME_PAT}§r§7: (.+)")); private static final Pattern DM_FROM = Pattern.compile(substitute("§dFrom §r{HYPIXEL_RANKED_NAME_PAT}§r§7: (.+)")); - @SubscribeEvent(receiveCanceled = false, priority = EventPriority.HIGHEST) + @SubscribeEvent(priority = EventPriority.LOWEST) public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { Matcher m; String msg = clientChatReceivedEvent.message.getFormattedText(); @@ -259,13 +277,13 @@ public class CosmeticsManager implements StompMessageHandler { nickname = m.group(2); preRank = "§r§2Guild > "; rank = m.group(1); - last = m.group(2)+" "+m.group(3)+": "+m.group(4); + last = m.group(2)+m.group(3)+": "+m.group(4); } else if ((m = CHAT_MSG.matcher(msg)).matches()) { match = true; - nickname = m.group(2); - preRank = ""; - rank = m.group(1); - last = m.group(2)+m.group(3)+": "+m.group(4); + nickname = m.group(3); + preRank = m.group(1); + rank = m.group(2); + last = m.group(3)+m.group(4)+": "+m.group(5); } else if ((m = COOP_MSG.matcher(msg)).matches()) { match = true; nickname = m.group(2); @@ -323,4 +341,27 @@ public class CosmeticsManager implements StompMessageHandler { } } } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void nameFormat(PlayerEvent.NameFormat nameFormat) { + List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.get(nameFormat.entityPlayer.getGameProfile().getId()); + if (activeCosmetics == null) return; + CosmeticData color=null, prefix=null; + for (ActiveCosmetic activeCosmetic : activeCosmetics) { + CosmeticData cosmeticData = cosmeticDataMap.get(activeCosmetic.getCosmeticData()); + if (cosmeticData !=null && cosmeticData.getCosmeticType().equals("color")) { + color = cosmeticData; + } else if (cosmeticData != null && cosmeticData.getCosmeticType().equals("prefix")) { + prefix = cosmeticData; + } + } + + + if (color != null) + nameFormat.displayname = color.getData().replace("&","§")+nameFormat.username; + + if (prefix != null) + nameFormat.displayname = prefix.getData().replace("&","§")+" "+nameFormat.displayname; + + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java index ea2cb205..4bfa775a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java @@ -45,9 +45,10 @@ public class CustomNetworkPlayerInfo extends NetworkPlayerInfo { String actualName = ""; for (String s : semi_name.split(" ")) { if (TextUtils.stripColor(s).startsWith("[")) continue; - actualName = s; + actualName = TextUtils.stripColor(s); + break; } - List<ActiveCosmetic> activeCosmetics = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getActiveCosmeticByPlayerNameLowerCase().get(TextUtils.stripColor(actualName).toLowerCase()); + List<ActiveCosmetic> activeCosmetics = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getActiveCosmeticByPlayerNameLowerCase().get(actualName.toLowerCase()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java index 2bdc4206..479762cb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java @@ -19,6 +19,7 @@ package kr.syeyoung.dungeonsguide.dungeon.roomfinder; import com.google.common.io.Files; +import kr.syeyoung.dungeonsguide.Main; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import net.minecraft.client.Minecraft; import org.apache.commons.io.IOUtils; @@ -106,19 +107,22 @@ public class DungeonRoomInfoRegistry { registered.clear(); shapeMap.clear(); uuidMap.clear(); - URL url = new URL("z:///roomdata/datas.txt"); - List<String> lines = IOUtils.readLines(url.openConnection().getInputStream()); - for (String name : lines) { - if (!name.endsWith(".roomdata")) continue; - try { - InputStream fis = new URL("z:///"+name).openStream(); - ObjectInputStream ois = new ObjectInputStream(fis); - DungeonRoomInfo dri = (DungeonRoomInfo) ois.readObject(); - ois.close(); - fis.close(); - register(dri); - } catch (Exception e) {e.printStackTrace();} - } + try { + List<String> lines = IOUtils.readLines(Main.class.getResourceAsStream("/roomdata/datas.txt")); + for (String name : lines) { + if (!name.endsWith(".roomdata")) continue; + try { + InputStream fis = Main.class.getResourceAsStream("/"+name); + ObjectInputStream ois = new ObjectInputStream(fis); + DungeonRoomInfo dri = (DungeonRoomInfo) ois.readObject(); + ois.close(); + fis.close(); + register(dri); + } catch (Exception e) { + e.printStackTrace(); + } + } + } catch (Exception e) {e.printStackTrace();} for (File f : dir.listFiles()) { if (!f.getName().endsWith(".roomdata")) continue; try { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java index 90d3f537..347483d2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java @@ -64,6 +64,8 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.io.IOException; @@ -230,6 +232,10 @@ public class DungeonListener { JsonObject obj = DungeonsGuide.getDungeonsGuide().getAuthenticator().getJwtPayload(DungeonsGuide.getDungeonsGuide().getAuthenticator().getToken()); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; if (obj.get("plan").getAsString().equalsIgnoreCase("TRIAL")) { + + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); fr.drawString("Using trial Version of Dungeons Guide", 0,0, 0xFFFFFFFF); fr.drawString("Trial version bound to: "+obj.get("nickname").getAsString(), 0,10, 0xFFFFFFFF); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index 50fe1218..341f235a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -102,7 +102,7 @@ public class FeatureRegistry { public static final FeatureAutoAcceptReparty ETC_AUTO_ACCEPT_REPARTY = register(new FeatureAutoAcceptReparty()); public static final FeatureUpdateAlarm ETC_TEST = register(new FeatureUpdateAlarm()); - public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature(" |
