diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
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("Fixes", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true)); + public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature("ETC", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true)); public static final FeatureDisableMessage FIX_MESSAGES = register(new FeatureDisableMessage()); public static final FeatureCopyMessages ETC_COPY_MSG = register(new FeatureCopyMessages()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java index 307927aa..553cf3a5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java @@ -30,6 +30,8 @@ import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.BlockPos; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; @@ -67,6 +69,10 @@ public class FeatureRoomCoordDisplay extends GuiFeature { GlStateManager.scale(scale, scale, 0); int color = this.<Color>getParameter("color").getValue().getRGB(); + + 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); fontRenderer.drawString("X: "+offsetPoint.getX()+" Y: "+offsetPoint.getY()+" Z: "+offsetPoint.getZ()+" Facing: "+ FeatureRoomCoordDisplay.facing[real], 0, 0, color); } @@ -77,6 +83,10 @@ public class FeatureRoomCoordDisplay extends GuiFeature { if (facing < 0) facing += 360; double scale = getFeatureRect().getRectangle().getHeight() / fr.FONT_HEIGHT; GlStateManager.scale(scale, scale, 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("X: 0 Y: 3 Z: 5 Facing: "+FeatureRoomCoordDisplay.facing[(facing / 90) % 4], 0,0, this.<Color>getParameter("color").getValue().getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java index df5a0f51..c5dc4264 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java @@ -28,7 +28,10 @@ import kr.syeyoung.dungeonsguide.features.GuiFeature; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; import org.apache.commons.lang3.StringUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; @@ -51,6 +54,10 @@ public class FeatureRoomDebugInfo extends GuiFeature { DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; int color = this.<Color>getParameter("color").getValue().getRGB(); + + 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); if (dungeonRoom == null) { if (context.getBossfightProcessor() == null) { fontRenderer.drawString("Where are you?!", 0, 0, 0xFFFFFF); @@ -73,6 +80,10 @@ public class FeatureRoomDebugInfo extends GuiFeature { @Override public void drawDemo(float partialTicks) { FontRenderer fr = getFontRenderer(); + + 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("Line 1", 0,0, this.<Color>getParameter("color").getValue().getRGB()); fr.drawString("Line 2", 0,10, this.<Color>getParameter("color").getValue().getRGB()); fr.drawString("Line 3", 0,20, this.<Color>getParameter("color").getValue().getRGB()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java index f6c61608..da907df0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java @@ -34,6 +34,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.client.event.GuiScreenEvent; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.util.Comparator; import java.util.Set; @@ -101,6 +103,10 @@ public class FeatureChestPrice extends SimpleFeature implements GuiBackgroundRen GlStateManager.translate(left, top, 0); Gui.drawRect( 0,0,width, 30, 0xFFDDDDDD); + + 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); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; fr.drawString("BIN/AH Price: ", 5,5, 0xFF000000); String str = TextUtils.format(itemPrice); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java index b0c2987f..079512b2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java @@ -28,12 +28,12 @@ import net.minecraft.client.Minecraft; 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.ArrayList; +import java.util.*; import java.util.List; -import java.util.Set; -import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; @@ -79,7 +79,13 @@ public class PrefixSelectorGUI extends MPanel { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); - Set<UUID> activeCosmeticList = cosmeticsManager.getActiveCosmeticByPlayer().computeIfAbsent(Minecraft.getMinecraft().thePlayer.getGameProfile().getId(), (a) -> new ArrayList<>()).stream().map(ActiveCosmetic::getCosmeticData).collect(Collectors.toSet()); + List<ActiveCosmetic> activeCosmeticList2 = cosmeticsManager.getActiveCosmeticByPlayer().get(Minecraft.getMinecraft().thePlayer.getGameProfile().getId()); + Set<UUID> activeCosmeticList = new HashSet<>(); + if (activeCosmeticList2 !=null) { + for (ActiveCosmetic activeCosmetic : activeCosmeticList2) { + activeCosmeticList.add(activeCosmetic.getCosmeticData()); + } + } @@ -87,6 +93,10 @@ public class PrefixSelectorGUI extends MPanel { Gui.drawRect(0,0,getBounds().width, getBounds().height-2, 0xFF444444); Gui.drawRect(5,5,265, getBounds().height-7, 0xFF222222); Gui.drawRect(6,17,264, getBounds().height-8, 0xFF555555); + + 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("Preview", (270 - fr.getStringWidth("Preview")) / 2, 7, 0xFFFFFFFF); { @@ -105,6 +115,7 @@ public class PrefixSelectorGUI extends MPanel { int cnt = 0; for (CosmeticData value : cosmeticsManager.getCosmeticDataMap().values()) { if (value.getCosmeticType().equals(cosmeticType)) { + if (!cosmeticsManager.getPerms().contains(value.getReqPerm()) && value.getReqPerm().startsWith("invis_")) continue; Gui.drawRect(0,0,220, fr.FONT_HEIGHT+3, 0xFF222222); Gui.drawRect(1,1, 219, fr.FONT_HEIGHT+2, 0xFF555555); fr.drawString(optionTransformer.apply(value.getData()), 2, 2, -1); @@ -144,19 +155,24 @@ public class PrefixSelectorGUI extends MPanel { for (CosmeticData value : cosmeticsManager.getCosmeticDataMap().values()) { if (value.getCosmeticType().equals(cosmeticType)) { + if (!cosmeticsManager.getPerms().contains(value.getReqPerm()) && value.getReqPerm().startsWith("invis_")) continue; if (new Rectangle(120,cnt * (fr.FONT_HEIGHT+4) + 2,40,fr.FONT_HEIGHT+1).contains(relX, relY)) { selected = value; return; } - if (new Rectangle(161,cnt * (fr.FONT_HEIGHT+4) + 2,58,fr.FONT_HEIGHT+1).contains(relX, relY) && cosmeticsManager.getPerms().contains(value.getReqPerm())) { - for (ActiveCosmetic activeCosmetic : activeCosmeticList) { - if (activeCosmetic.getCosmeticData().equals(value.getId())) { - cosmeticsManager.removeCosmetic(activeCosmetic); - return; + try { + if (new Rectangle(161, cnt * (fr.FONT_HEIGHT + 4) + 2, 58, fr.FONT_HEIGHT + 1).contains(relX, relY) && cosmeticsManager.getPerms().contains(value.getReqPerm())) { + for (ActiveCosmetic activeCosmetic : activeCosmeticList) { + if (activeCosmetic.getCosmeticData().equals(value.getId())) { + cosmeticsManager.removeCosmetic(activeCosmetic); + return; + } } + cosmeticsManager.setCosmetic(value); + selected = value; } - cosmeticsManager.setCosmetic(value); - selected = value; + } catch (Exception e) { + e.printStackTrace(); } cnt++; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java index 992051bb..1710e74d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java @@ -37,8 +37,8 @@ import java.util.List; public class FeatureBoxStarMobs extends SimpleFeature implements WorldRenderListener { public FeatureBoxStarMobs() { super("Dungeon", "Box Starred mobs", "Box Starred mobs in dungeons", "dungeon.starmobbox", false); - 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<AColor>("color", "Highlight Color", "Highlight Color of Skeleton master", new AColor(0,255,255,50), "acolor")); + parameters.put("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and starred mobs to be boxed", 20, "integer")); + parameters.put("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Starred mobs", new AColor(0,255,255,50), "acolor")); } 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 7a0aafb5..f206c092 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 @@ -52,6 +52,7 @@ import net.minecraft.world.storage.MapData; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.List; @@ -142,6 +143,10 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, Rectangle featureRect =getFeatureRect().getRectangle(); Gui.drawRect(0,0,featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, this.<AColor>getParameter("background_color").getValue())); FontRenderer fr = getFontRenderer(); + + 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("Please join a dungeon to see preview", featureRect.width / 2 - fr.getStringWidth("Please join a dungeon to see preview") / 2, featureRect.height / 2 - fr.FONT_HEIGHT / 2, 0xFFFFFFFF); GL11.glLineWidth(2); RenderUtils.drawUnfilledBox(0,0,featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); @@ -208,6 +213,10 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, str += "❌"; } + + 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(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), dungeonRoom.getCurrentState() == DungeonRoom.RoomState.FINISHED ? 0xFF00FF00 : (dungeonRoom.getColor() == 74 ? 0xff000000 : 0xFFFFFFFF)); GlStateManager.popAttrib(); GlStateManager.popMatrix(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java index f42b724f..610f356c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java @@ -30,6 +30,8 @@ import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.ContainerChest; import net.minecraftforge.client.event.GuiOpenEvent; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; @@ -47,6 +49,10 @@ public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitLis FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getRectangle().getHeight() / fr.FONT_HEIGHT; GlStateManager.scale(scale, scale, 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("Cooldown: "+(20 - (System.currentTimeMillis() - leftDungeonTime) / 1000)+"s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } @@ -55,6 +61,10 @@ public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitLis FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getRectangle().getHeight() / fr.FONT_HEIGHT; GlStateManager.scale(scale, scale, 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("Cooldown: 20s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java index 6092eb88..050d30c5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java @@ -55,7 +55,7 @@ public class FeatureDisableMessage extends SimpleFeature implements ChatListener }; public FeatureDisableMessage() { - super("Fixes", "Disable ability messages", "Do not let ability messages show up in chatbox\nclick on Edit for more precise settings", "fixes.messagedisable", true); + super("ETC", "Disable ability messages", "Do not let ability messages show up in chatbox\nclick on Edit for more precise settings", "fixes.messagedisable", true); for (MessageData messageData : PRE_DEFINED) { this.parameters.put(messageData.key, new FeatureParameter<Boolean>(messageData.key, messageData.name, messageData.description, true, "boolean")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java index bd517b43..5092f7cf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java @@ -31,7 +31,7 @@ import net.minecraft.util.ChatComponentText; public class FeatureUpdateAlarm extends SimpleFeature implements StompConnectedListener, StompMessageHandler, TickListener { public FeatureUpdateAlarm() { - super("ETC", "Update Alarm","Show a warning on chat when new update has bnee released.", "etc.updatealarm", true); + super("ETC", "Update Alarm","Show a warning in chat when a version has been released.", "etc.updatealarm", true); } private StompPayload stompPayload; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java index 9cd1258f..7f292e13 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java @@ -39,6 +39,8 @@ import net.minecraft.inventory.Slot; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.client.event.GuiScreenEvent; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -99,6 +101,10 @@ public class FeatureGoodParties extends SimpleFeature implements GuiPostRenderLi Gui.drawRect(x, y, x + 16, y + 16, 0x77AA0000); } else { + + 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); if (note.toLowerCase().contains("car")) { fr.drawStringWithShadow("C", x + 1, y + 1, 0xFFFF0000); } else if (note.toLowerCase().replace(" ", "").contains("s/s+")) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java index 3cd52d52..662f8389 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java @@ -60,10 +60,14 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.resources.DefaultPlayerSkin; import net.minecraft.client.resources.SkinManager; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.HoverEvent; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -71,6 +75,7 @@ import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.fml.common.Loader; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.*; @@ -184,6 +189,10 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen GlStateManager.translate(popupRect.x, popupRect.y, 0); Gui.drawRect(0,0, popupRect.width, popupRect.height, 0xFF23272a); Gui.drawRect(2,2, popupRect.width-2, popupRect.height-2, 0XFF2c2f33); + + 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); if (apiKeyPlsSet) { Minecraft.getMinecraft().fontRendererObj.drawString("Please set API KEY on /dg -> Party Kicker", 5,5, 0xFFFFFFFF); GlStateManager.popMatrix(); @@ -209,9 +218,13 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen Gui.drawRect(0,168, 90, 195, 0xFF23272a); Gui.drawRect(2,170, 88, 193, new Rectangle(2,170,86,23).contains(relX, relY) ? 0xFFff7777 : 0xFFFF3333); - fr.drawString("Kick", (90 - fr.getStringWidth("Kick")) / 2,(364 - fr.FONT_HEIGHT) / 2, 0xFFFFFFFF); + Gui.drawRect(0,193, 90, 220, 0xFF23272a); Gui.drawRect(2,195, 88, 218, new Rectangle(2,195,86,23).contains(relX, relY) ? 0xFF859DF0 : 0xFF7289da); + 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("Kick", (90 - fr.getStringWidth("Kick")) / 2,(364 - fr.FONT_HEIGHT) / 2, 0xFFFFFFFF); fr.drawString("Invite", (90 - fr.getStringWidth("Invite")) / 2,(414 - fr.FONT_HEIGHT) / 2, 0xFFFFFFFF); GlStateManager.pushMatrix(); @@ -220,6 +233,9 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen int culmutativeY = 5; DataRenderer dataRendererToHover = null; for (String datarenderers : this.<List<String>>getParameter("datarenderers").getValue()) { + 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); DataRenderer dataRenderer = DataRendererRegistry.getDataRenderer(datarenderers); Dimension dim; if (dataRenderer == null) { @@ -244,6 +260,9 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen Gui.drawRect(2,2, 88, 168, 0xFF444444); Gui.drawRect(80,159, 90, 170, 0xFF23272a); Gui.drawRect(82,161, 88, 168, 0xFF444444); + 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("§eI", 83,161,-1); GlStateManager.color(1, 1, 1, 1.0F); if (fakePlayer != null) { @@ -264,6 +283,9 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen toDraw = (color == null ? "§e" : color.getData().replace("&", "§"))+toDraw; if (prefix != null) toDraw = prefix.getData().replace("&", "§") + " "+toDraw; + 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(toDraw, (90 - fr.getStringWidth(toDraw)) / 2, 15, -1); ItemStack toHover = null; @@ -300,6 +322,9 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen GL11.glEnable(GL11.GL_SCISSOR_TEST); } } else { + 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("Loading", 5,35, 0xFFEFFF00); } @@ -537,6 +562,21 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen public ItemStack[] getInventory() { return this.inventory.armorInventory; } + + @Override + public boolean isInvisibleToPlayer(EntityPlayer player) { + return true; + } + + @Override + public Team getTeam() { + return new ScorePlayerTeam(null, null) { + @Override + public EnumVisible getNameTagVisibility() { + return EnumVisible.NEVER; + } + }; + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java index 864f6ce4..663d7893 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java @@ -46,6 +46,7 @@ import net.minecraft.util.MathHelper; import net.minecraftforge.client.event.GuiScreenEvent; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.List; @@ -108,6 +109,9 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis Gui.drawRect(0, 0, feature.width, fr.FONT_HEIGHT + 4, 0xFF444444); Gui.drawRect(1, 1, feature.width - 1, fr.FONT_HEIGHT + 3, 0xFF262626); + 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("Selected: ", 2,2, 0xFFAAAAAA); if (grp.getPath() == null) fr.drawString("Nothing", fr.getStringWidth("Selected: ") + 2,2, 0xFFAA0000); @@ -125,6 +129,9 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis Gui.drawRect(0, 0, feature.width, fr.FONT_HEIGHT + 4, 0xFF444444); Gui.drawRect(1, 1, feature.width - 1, fr.FONT_HEIGHT + 3, 0xFF262626); + 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("Selected: ", 2,2, 0xFFAAAAAA); fr.drawString("Nothing", fr.getStringWidth("Selected: ") + 2,2, 0xFFAA0000); fr.drawString("Open any gui to browse", 2, fr.FONT_HEIGHT + 5, 0xFFAAAAAA); @@ -161,6 +168,9 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis GlStateManager.translate(feature.x, feature.y, 0); Gui.drawRect(0, 0, feature.width, fr.FONT_HEIGHT + 4, 0xFF444444); Gui.drawRect(1, 1, feature.width - 1, fr.FONT_HEIGHT + 3, 0xFF262626); + 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("Selected: ", 2,2, 0xFFAAAAAA); if (grp.getPath() == null) fr.drawString("Nothing", fr.getStringWidth("Selected: ") + 2,2, 0xFFAA0000); @@ -185,6 +195,9 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis } else if (new Rectangle(feature.x, feature.y + fr.FONT_HEIGHT + 6 - dy + i * fr.FONT_HEIGHT, feature.width, fr.FONT_HEIGHT).contains(mouseX, mouseY)) { Gui.drawRect(-1, i * fr.FONT_HEIGHT, feature.width - 3, i * fr.FONT_HEIGHT + fr.FONT_HEIGHT - 1, 0xFF555555); } + 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); if (obj instanceof DungeonMechanic) { String name = sortedMechanicsName.get(i); fr.drawString(name, 3, i * fr.FONT_HEIGHT, 0xFFFFFF00); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java index f71b2e10..0201e262 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java @@ -42,6 +42,7 @@ import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import org.w3c.dom.css.Rect; import java.awt.*; @@ -153,6 +154,9 @@ public class PanelTextParameterConfig extends MPanel { GlStateManager.translate(5, height + 7, 0); GlStateManager.scale(0.5,0.5,0); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + 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("Press Shift to multi-select", 0, 0, 0xFFBFBFBF); GlStateManager.popMatrix(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java index 7723ef4e..01ce7d3b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java @@ -25,6 +25,8 @@ import net.minecraft.client.Minecraft; 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.ArrayList; @@ -110,6 +112,8 @@ public class StyledTextRenderer { Gui.drawRect(x,y, x+fr.getStringWidth(content), y + fr.FONT_HEIGHT, RenderUtils.getColorAt(x,y, style.getBackground())); 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); if (!style.getColor().isChroma()) { fr.drawString(content, x, y, style.getColor().getRGB(), style.isShadow()); return new Dimension(fr.getStringWidth(content), fr.FONT_HEIGHT); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java index e332a7b0..d30b82c9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java @@ -25,6 +25,9 @@ import lombok.Setter; import net.minecraft.client.Minecraft; 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.*; @@ -60,6 +63,9 @@ public class MButton extends MPanel { int x = (getBounds().width - width) / 2; int y = (getBounds().height - renderer.FONT_HEIGHT) / 2 + 1; + 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); renderer.drawString(getText(), x,y, foreground.getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java index 2bb7f2d3..cd0289a0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java @@ -23,6 +23,9 @@ import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; @@ -61,6 +64,9 @@ public class MLabel extends MPanel { } else{ return; } + 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); renderer.drawString(getText(), x,y, 0xffffff); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java index 11772704..d870daf2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java @@ -26,6 +26,9 @@ import lombok.Setter; import net.minecraft.client.Minecraft; 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.*; @@ -83,6 +86,9 @@ public class MNavigatingPane extends MPanel { Gui.drawRect(1, 16, getBounds().width-1, getBounds().height-1, background2 != null ? background2.getRGB() : 0); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + 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(currentPage.replace(".", " > "), 20, 20, 0xFFFFFFFF); } @@ -191,6 +197,9 @@ public class MNavigatingPane extends MPanel { int x = (getBounds().width - width) / 2; int y = (getBounds().height - 3 - renderer.FONT_HEIGHT) / 2 + 3; + 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); renderer.drawString(text, x,y, foreground.getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java index 4e7e2463..f26fd956 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java @@ -25,6 +25,9 @@ import lombok.Setter; import net.minecraft.client.Minecraft; 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.ArrayList; @@ -141,6 +144,9 @@ public class MTabbedPane extends MPanel { int x = (getBounds().width - width) / 2; int y = (getBounds().height - 3 - renderer.FONT_HEIGHT) / 2 + 3; + 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); renderer.drawString(text, x,y, foreground.getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java index 957a59b1..c26a1b21 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java @@ -25,7 +25,10 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.awt.datatransfer.*; @@ -68,6 +71,9 @@ public class MTextField extends MPanel { clip(new ScaledResolution(mc), clip.x + 1, clip.y + 1, clip.width - 2, clip.height - 2); FontRenderer fr = mc.fontRendererObj; int y = (getBounds().height - fr.FONT_HEIGHT) / 2; + 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(text, 3 - xOffset, y, foreground.getRGB()); // draw selection if (isFocused) { @@ -75,6 +81,9 @@ public class MTextField extends MPanel { int startX = fr.getStringWidth(text.substring(0, selectionStart)) - xOffset; int endX = fr.getStringWidth(text.substring(0, selectionEnd)) - xOffset; Gui.drawRect(3 + startX, y, 3 + endX, y + fr.FONT_HEIGHT, 0xFF00FF00); + 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(text.substring(selectionStart, selectionEnd), 3 + startX, y, foreground.getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java index 41e281da..432fd0a8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java @@ -27,6 +27,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.*; @@ -48,6 +49,9 @@ public class MToggleButton extends MPanel { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = 2; + 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); if (enabled) { int x = (int) ((scale * bounds.height - fr.FONT_HEIGHT)/2 + gap); GlStateManager.pushMatrix(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java index 299e4b48..db1ebde0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyInviteViewer.java @@ -34,6 +34,8 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; @@ -226,6 +228,9 @@ public class PartyInviteViewer { } } + 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); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; GlStateManager.pushMatrix(); GlStateManager.translate(height +3,7, 0); @@ -256,6 +261,9 @@ public class PartyInviteViewer { GlStateManager.translate((widthForTheThing - 10 - fr.getStringWidth(text) * 2) / 2, 15 - fr.FONT_HEIGHT, 0); GlStateManager.scale(2.0f, 2.0f, 1.0f); + 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(text, 0, 0, 0xFFFFFFFF); GlStateManager.popMatrix(); GlStateManager.translate(widthForTheThing, 0, 0); @@ -265,6 +273,9 @@ public class PartyInviteViewer { text = "Deny"; GlStateManager.translate((widthForTheThing - 10 - fr.getStringWidth(text) * 2) / 2, 15 - fr.FONT_HEIGHT, 0); GlStateManager.scale(2.0f, 2.0f, 1.0f); + 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(text, 0, 0, 0xFFFFFFFF); GlStateManager.popMatrix(); GlStateManager.translate(widthForTheThing, 0, 0); @@ -274,6 +285,9 @@ public class PartyInviteViewer { text = "Ignore"; GlStateManager.translate((widthForTheThing - 10 - fr.getStringWidth(text) * 2) / 2, 15 - fr.FONT_HEIGHT, 0); GlStateManager.scale(2.0f, 2.0f, 1.0f); + 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(text, 0, 0, 0xFFFFFFFF); GlStateManager.popMatrix(); GlStateManager.popMatrix(); @@ -281,6 +295,9 @@ public class PartyInviteViewer { GlStateManager.pushMatrix(); GlStateManager.translate(height + 3, height - 28, 0); GlStateManager.scale(2.0f,2.0f,1.0f); + 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(partyJoinRequest.getReply().getPast()+" the invite.",0,0,0xFFFFFFFF); GlStateManager.popMatrix(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java index d775aca4..20de9e9d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java @@ -39,6 +39,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.passive.EntityBat; @@ -49,6 +50,8 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.*; @@ -135,6 +138,9 @@ public class GeneralRoomProcessor implements RoomProcessor { ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); if (DungeonActionManager.getSpawnLocation().containsKey(en.getEntityId())) { + 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("Spawned at " + DungeonActionManager.getSpawnLocation().get(en.getEntityId()), sr.getScaledWidth() / 2, sr.getScaledHeight() / 2, 0xFFFFFFFF); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java index 321c64ea..6ea0fd95 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java @@ -25,6 +25,7 @@ import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IChatComponent; @@ -35,6 +36,8 @@ import net.minecraftforge.event.entity.player.EntityInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; @Getter public abstract class GeneralDefuseChamberProcessor implements ChamberProcessor{ @@ -101,6 +104,9 @@ public abstract class GeneralDefuseChamberProcessor implements ChamberProcessor FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); String str = "Press "+ Keyboard.getKeyName(Keybinds.sendBombdefuse.getKeyCode()) + " to save and send solution"; + 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(str, (sr.getScaledWidth() - fr.getStringWidth(str)) / 2, (sr.getScaledHeight() - fr.FONT_HEIGHT) / 2, 0xFFFFFFFF); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java index e20f1ec9..4b998144 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java @@ -27,11 +27,14 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.HashMap; @@ -61,6 +64,9 @@ public class MazeLeftProcessor extends GeneralDefuseChamberProcessor { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); String str = "Press "+ Keyboard.getKeyName(Keybinds.sendBombdefuse.getKeyCode()) + " to request open "+b.getLocalizedName(); + 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(str, (sr.getScaledWidth() - fr.getStringWidth(str)) / 2, (sr.getScaledHeight() - fr.FONT_HEIGHT) / 2, 0xFFFFFFFF); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java index 74e28ec2..71e9bab4 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java @@ -28,12 +28,15 @@ import kr.syeyoung.dungeonsguide.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; import java.util.*; @@ -330,6 +333,9 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { if (!FeatureRegistry.SOLVER_BOX.isEnabled()) return; if (FeatureRegistry.SOLVER_BOX_DISABLE_TEXT.isEnabled()) return; FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + 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("Type \"recalc\" in chat to recalculate the solution", 0, 0, 0xFFFFFFFF); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java index 07812486..204ed360 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java @@ -38,6 +38,7 @@ import net.minecraft.util.*; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import javax.vecmath.Vector3f; import java.awt.*; @@ -121,6 +122,9 @@ public class RenderUtils { drawGradientRect(l1 - 3, i2 - 3, l1 + i + 3, i2 - 3 + 1, i1, i1); drawGradientRect(l1 - 3, i2 + k + 2, l1 + i + 3, i2 + k + 3, j1, j1); + 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); for (int k1 = 0; k1 < textLines.size(); ++k1) { String s1 = textLines.get(k1); @@ -1004,6 +1008,9 @@ public class RenderUtils { GlStateManager.enableTexture2D(); } + 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); fontRenderer.drawString(text, -textWidth / 2, 0, color); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); |