diff options
| author | Moulberry <james.jenour@student.scotch.wa.edu.au> | 2020-08-19 12:16:12 +1000 |
|---|---|---|
| committer | Moulberry <james.jenour@student.scotch.wa.edu.au> | 2020-08-19 12:16:12 +1000 |
| commit | ea1391e0c6f0db863bbb61511eb6e9acb57a5968 (patch) | |
| tree | 16e0b8a76055838b6cc1963f56c1327cd8850c66 /src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java | |
| parent | 0c23f52d2be811d74a3b6ef598dd9de7ccb763ab (diff) | |
| download | notenoughupdates-ea1391e0c6f0db863bbb61511eb6e9acb57a5968.tar.gz notenoughupdates-ea1391e0c6f0db863bbb61511eb6e9acb57a5968.tar.bz2 notenoughupdates-ea1391e0c6f0db863bbb61511eb6e9acb57a5968.zip | |
1.1.5
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 6e01e409..aa604854 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -9,10 +9,10 @@ import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; import io.github.moulberry.notenoughupdates.commands.SimpleCommand; import io.github.moulberry.notenoughupdates.cosmetics.CapeManager; +import io.github.moulberry.notenoughupdates.cosmetics.GuiCosmetics; import io.github.moulberry.notenoughupdates.gamemodes.GuiGamemodes; import io.github.moulberry.notenoughupdates.gamemodes.SBGamemodes; import io.github.moulberry.notenoughupdates.infopanes.CollectionLogInfoPane; -import io.github.moulberry.notenoughupdates.infopanes.CosmeticsInfoPane; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; import io.github.moulberry.notenoughupdates.questing.GuiQuestLine; @@ -40,8 +40,6 @@ import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import org.apache.commons.lang3.StringUtils; import javax.swing.*; @@ -128,6 +126,37 @@ public class NotEnoughUpdates { } }); + SimpleCommand peekCommand = new SimpleCommand("peek", new SimpleCommand.ProcessCommandRunnable() { + public void processCommand(ICommandSender sender, String[] args) { + profileViewer.getProfileByName(args[0], profile -> { + if (profile != null) { + profile.resetCache(); + + float overallScore = 0; + + JsonObject profileInfo = profile.getProfileInformation(null); + + JsonObject skill = profile.getSkillInfo(null); + } + }); + } + }, new SimpleCommand.TabCompleteRunnable() { + @Override + public List<String> tabComplete(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length != 1) return null; + + String lastArg = args[args.length - 1]; + List<String> playerMatches = new ArrayList<>(); + for (EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) { + String playerName = player.getName(); + if (playerName.toLowerCase().startsWith(lastArg.toLowerCase())) { + playerMatches.add(playerName); + } + } + return playerMatches; + } + }); + public static ProfileViewer profileViewer; SimpleCommand.ProcessCommandRunnable viewProfileRunnable = new SimpleCommand.ProcessCommandRunnable() { @@ -252,10 +281,7 @@ public class NotEnoughUpdates { SimpleCommand cosmeticsCommand = new SimpleCommand("neucosmetics", new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { - if(!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) { - openGui = new GuiInventory(Minecraft.getMinecraft().thePlayer); - } - overlay.displayInformationPane(new CosmeticsInfoPane(overlay, manager)); + openGui = new GuiCosmetics(); } }); @@ -288,6 +314,7 @@ public class NotEnoughUpdates { MinecraftForge.EVENT_BUS.register(new NEUEventListener(this)); MinecraftForge.EVENT_BUS.register(CapeManager.getInstance()); MinecraftForge.EVENT_BUS.register(new SBGamemodes()); + MinecraftForge.EVENT_BUS.register(CustomItemEffects.INSTANCE); File f = new File(event.getModConfigurationDirectory(), "notenoughupdates"); f.mkdirs(); @@ -425,6 +452,7 @@ public class NotEnoughUpdates { long currentTime = System.currentTimeMillis(); if (openGui != null) { + Minecraft.getMinecraft().thePlayer.closeScreen(); Minecraft.getMinecraft().displayGuiScreen(openGui); openGui = null; } |
