Skip to content

Commit

Permalink
Initial commit v5: DiscordRPC and rewrote MixinGuiScreen.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoworange420 committed Feb 24, 2023
1 parent 8237cbe commit 4e356db
Show file tree
Hide file tree
Showing 27 changed files with 216 additions and 351 deletions.
2 changes: 1 addition & 1 deletion src/main/java/nl/snoworange/cranberry/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Main {
//Refrences
public static final String MOD_ID = "cranberry";
public static final String NAME = "Cranberry";
public static final String VERSION = "v0.6.3";
public static final String VERSION = "v0.6.4";
public static final String ACCEPTED_MINECRAFT_VERSIONS = "[1.12.2]";
public static final Logger LOGGER = LogManager.getLogger("Cranberry");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import nl.snoworange.cranberry.features.module.modules.combat.Surround;
import nl.snoworange.cranberry.features.module.modules.exploit.SecretClose;
import nl.snoworange.cranberry.features.module.modules.hud.Watermark;
import nl.snoworange.cranberry.features.module.modules.misc.ConnectingGuiPlus;
import nl.snoworange.cranberry.features.module.modules.misc.BetterConnectingGUI;
import nl.snoworange.cranberry.features.module.modules.misc.DiscordRPC;
import nl.snoworange.cranberry.features.module.modules.movement.AutoSprint;
import nl.snoworange.cranberry.features.module.modules.movement.ElytraFly;
import nl.snoworange.cranberry.features.module.modules.movement.LiquidSpeed;
Expand Down Expand Up @@ -52,7 +53,8 @@ public ModuleManager() {
modules.add(new FullBright());
modules.add(new SelectionHighlight());

modules.add(new ConnectingGuiPlus());
modules.add(new BetterConnectingGUI());
modules.add(new DiscordRPC());

modules.add(new AutoSprint());
modules.add(new ElytraFly());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
import nl.snoworange.cranberry.features.module.Category;
import nl.snoworange.cranberry.features.module.Module;

public class ConnectingGuiPlus extends Module {
public class BetterConnectingGUI extends Module {

private static ConnectingGuiPlus instance;
private static BetterConnectingGUI instance;

public ConnectingGuiPlus() {
super("ConnectingGui+",
"Better connecting to the server... gui",
public BetterConnectingGUI() {
super("BetterConnectingGUI",
Category.MISC
);

instance = this;
}

public static ConnectingGuiPlus getInstance() {
return instance != null ? instance : new ConnectingGuiPlus();
public static BetterConnectingGUI getInstance() {
return instance != null ? instance : new BetterConnectingGUI();
}

public static ServerData currentServerData;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package nl.snoworange.cranberry.features.module.modules.misc;

import nl.snoworange.cranberry.features.module.Category;
import nl.snoworange.cranberry.features.module.Module;
import nl.snoworange.cranberry.features.setting.Setting;
import nl.snoworange.cranberry.misc.java.discord.Discord;
import nl.snoworange.cranberry.util.FileUtils;
import nl.snoworange.cranberry.util.minecraft.ChatUtils;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;

public class DiscordRPC extends Module {

private static DiscordRPC instance;

public DiscordRPC() {
super("DiscordRPC",
"shows in discord you're playing on Cranberry",
Category.MISC
);

instance = this;
}

public static DiscordRPC getInstance() {
return instance != null ? instance : new DiscordRPC();
}

public static String rptext = "Enjoying $clientname$ $version$";

@Override
public void onEnable() {
super.onEnable();

loadRPCText();
Discord.startRPC();
}

@Override
public void onDisable() {
super.onDisable();
Discord.stopRPC();
}

public void loadRPCText() {
try {
File file = new File(FileUtils.cranberry, "discordrpc.txt");

if (!file.exists()) {
file.createNewFile();

if (!n()) {
ChatUtils.sendMessage("No discordrpc.txt found in Cranberry folder! Creating one...");
return;
}
}

FileReader fileReader = new FileReader(file);
List<String> linezz = Files.readAllLines(file.toPath());

if (linezz.size() <= 0) {
ChatUtils.sendMessage("Empty discordrpc.txt found in Cranberry folder!");
} else {
rptext = linezz.get(0);
}

fileReader.close();

} catch (IOException ioException) {
ioException.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package nl.snoworange.cranberry.features.module.modules.render;

import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiVideoSettings;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import nl.snoworange.cranberry.Main;
import nl.snoworange.cranberry.features.module.Category;
import nl.snoworange.cranberry.features.module.Module;
import nl.snoworange.cranberry.features.setting.Setting;
import nl.snoworange.cranberry.util.minecraft.ChatUtils;

import java.awt.*;
import java.util.Random;
Expand All @@ -27,12 +25,28 @@ public DVDIcon() {
instance = this;
}

public enum ColorMode {
RANDOM,
CLASSIC;
}

public static DVDIcon getInstance() {
return instance != null ? instance : new DVDIcon();
}

public static final ResourceLocation DVD_ICON = new ResourceLocation(Main.MOD_ID, "dvd.png");

public static final Color[] classicColors = new Color[] {
new Color(255, 38, 0),
new Color(255, 131, 0),
new Color(255, 250, 1),
new Color(37, 255, 1),
new Color(0, 254, 255),
new Color(0, 38, 255),
new Color(190, 0, 255),
new Color(255, 0, 139)
};

public final Setting<Enum> colorMode = register(new Setting<>("ColorMode", ColorMode.RANDOM));
public final Setting<Boolean> inChat = register(new Setting<>("InChat", true));
public final Setting<Boolean> inOtherGui = register(new Setting<>("InOtherGui", true));
public final Setting<Integer> speed = register(new Setting<>("Speed", 2, 1, 5));
Expand Down Expand Up @@ -93,9 +107,16 @@ public void drawDVDIcon() {
}

public void updateColor() {
dvdColor = new Color(new Random().nextInt(256),
new Random().nextInt(256),
new Random().nextInt(256)
);
if (colorMode.getValue().equals(ColorMode.RANDOM)) {
dvdColor = new Color(new Random().nextInt(256),
new Random().nextInt(256),
new Random().nextInt(256)
);
}

if (colorMode.getValue().equals(ColorMode.CLASSIC)) {
int random = new Random().nextInt(classicColors.length);
dvdColor = classicColors[random];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onTick() {
}

if (mode.getValue().equals(Mode.POTION)) {
mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 8400));
mc.player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 5200));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public class Particles extends Module {
private static Particles instance;

public Particles() {
super("Particles", Category.RENDER);
super("Particles",
"LAGGGGGGGGGGG",
Category.RENDER
);

instance = this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void onDisable() {
super.onDisable();
}

public static void onRenderTooltip(ItemStack itemStack, int x, int y, CallbackInfo ci) {}

private void setInCache(@Nullable GuiShulkerPreview viewer) {
if (0 > guiCache.size() - 1) {
Expand Down Expand Up @@ -204,10 +203,6 @@ public GuiShulkerPreview(Container inventorySlotsIn, ItemStack shulkerStack, int
this.ySize = 76;
}

public ItemStack getParentShulker() {
return shulkerStack;
}

public int getPosX() {
return posX;
}
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/nl/snoworange/cranberry/misc/java/animal/Animal.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4e356db

Please sign in to comment.