forked from RepoMirrors/kami-blue
add donators to rpc
This commit is contained in:
parent
63fff6fcb4
commit
4c5594d243
|
@ -0,0 +1,41 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"uuid": "47f78584-c76c-4191-92fd-8c943af13054"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "8eea2cfc-9ebb-41dd-a77f-007404d98d4b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "071c6502-2cac-49a7-b316-b57866c69f83"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "f6d096cb-b784-4c05-9f4f-a0af9e397d98"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "c1ca957e-fb26-4ea0-b339-20802fcf2d33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "6ebdb21b-cf9c-40be-8357-18f872af4010"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "13ffb8cf-a576-45ee-898d-47ce897f5968"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "bf6c551f-fd57-4eed-b2c7-0444d71ada0c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "a24f24b9-c0e2-4444-b64c-cb75dfe0cfc8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "550edc4e-8e55-47f5-96a5-c54e9c9fa964"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "7a0d7fb8-2955-4b8e-a09f-d6859536c531"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "c9625a76-ac02-4a4c-b5df-cf6a5209cdc7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "65781e1c-1318-4fa4-8133-28f309fe5f59"
|
||||||
|
}
|
||||||
|
]
|
|
@ -19,6 +19,7 @@ import me.zeroeightsix.kami.module.Module;
|
||||||
import me.zeroeightsix.kami.module.ModuleManager;
|
import me.zeroeightsix.kami.module.ModuleManager;
|
||||||
import me.zeroeightsix.kami.module.modules.bewwawho.capes.Capes;
|
import me.zeroeightsix.kami.module.modules.bewwawho.capes.Capes;
|
||||||
import me.zeroeightsix.kami.module.modules.bewwawho.misc.BlueDiscordRPC;
|
import me.zeroeightsix.kami.module.modules.bewwawho.misc.BlueDiscordRPC;
|
||||||
|
import me.zeroeightsix.kami.module.modules.bewwawho.util.Donator;
|
||||||
import me.zeroeightsix.kami.setting.Setting;
|
import me.zeroeightsix.kami.setting.Setting;
|
||||||
import me.zeroeightsix.kami.setting.Settings;
|
import me.zeroeightsix.kami.setting.Settings;
|
||||||
import me.zeroeightsix.kami.setting.SettingsRegister;
|
import me.zeroeightsix.kami.setting.SettingsRegister;
|
||||||
|
@ -49,7 +50,7 @@ import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by 086 on 7/11/2017.
|
* Created by 086 on 7/11/2017.
|
||||||
* Updated by S-B99 on 15/12/19
|
* Updated by S-B99 on 16/12/19
|
||||||
*/
|
*/
|
||||||
@Mod(
|
@Mod(
|
||||||
modid = KamiMod.MODID,
|
modid = KamiMod.MODID,
|
||||||
|
@ -99,7 +100,7 @@ public class KamiMod {
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void postInit(FMLPostInitializationEvent event) {
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
for (Capes.CapeUser user : Capes.INSTANCE.capeUser) {
|
for (Donator.DonatorUser user : Donator.INSTANCE.donatorUsers) {
|
||||||
if (user.uuid.equalsIgnoreCase(Minecraft.getMinecraft().session.getProfile().getId().toString())) {
|
if (user.uuid.equalsIgnoreCase(Minecraft.getMinecraft().session.getProfile().getId().toString())) {
|
||||||
DiscordPresence.presence.smallImageKey = "donator2";
|
DiscordPresence.presence.smallImageKey = "donator2";
|
||||||
DiscordPresence.presence.smallImageText = "donator uwu";
|
DiscordPresence.presence.smallImageText = "donator uwu";
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package me.zeroeightsix.kami.module.modules.bewwawho.util;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import me.zeroeightsix.kami.KamiMod;
|
||||||
|
|
||||||
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* @author S-B99
|
||||||
|
*/
|
||||||
|
public class Donator {
|
||||||
|
|
||||||
|
public static Donator INSTANCE;
|
||||||
|
public DonatorUser[] donatorUsers;
|
||||||
|
|
||||||
|
public class DonatorUser {
|
||||||
|
public String uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Donator() {
|
||||||
|
INSTANCE = this;
|
||||||
|
try {
|
||||||
|
HttpsURLConnection connection = (HttpsURLConnection) new URL("https://raw.githubusercontent.com/S-B99/KAMI/features-master/assets/capes.json").openConnection();
|
||||||
|
connection.connect();
|
||||||
|
this.donatorUsers = new Gson().fromJson(new InputStreamReader(connection.getInputStream()), DonatorUser[].class);
|
||||||
|
connection.disconnect();
|
||||||
|
} catch (Exception e) {
|
||||||
|
KamiMod.log.error("Failed to load capes");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue