forked from RepoMirrors/kami-blue
merge master into combat
This commit is contained in:
parent
fba73613d4
commit
0bac8b68f3
|
@ -15,38 +15,37 @@ public class CreditsCommand extends Command {
|
|||
@Override
|
||||
public void call(String[] args) {
|
||||
Command.sendChatMessage("\n" +
|
||||
"&l&9Author: \n" +
|
||||
"&b086\n" +
|
||||
"&l&9Contributors: \n" +
|
||||
"&bBella (S-B99)\n" +
|
||||
"&bhub (blockparole)\n" +
|
||||
"&bSasha (EmotionalLove)\n" +
|
||||
"&bQther (d1gress / Vonr)\n" +
|
||||
"&bHHSGPA\n" +
|
||||
"&b20kdc\n" +
|
||||
"&bIronException\n" +
|
||||
"&bcats (Cuhnt)\n" +
|
||||
"&bKatatje\n" +
|
||||
"&bDeauthorized\n" +
|
||||
"&bsnowmii\n" +
|
||||
"&bkdb424\n" +
|
||||
"&Jack (jacksonellsworth03)\n" +
|
||||
"&bcookiedragon234\n" +
|
||||
"&b0x2E (PretendingToCode)\n" +
|
||||
"&bbabbaj\n" +
|
||||
"&bZeroMemes\n" +
|
||||
"&bTheBritishMidget (TBM)\n" +
|
||||
"&bHamburger (Hamburger2k)\n" +
|
||||
"&bDarki\n" +
|
||||
"&bFINZ0\n" +
|
||||
"&bCrystallinqq\n" +
|
||||
"&bElementars\n" +
|
||||
"&bfsck\n" +
|
||||
"&bJamie (jamie27)\n" +
|
||||
"&bWaizy\n" +
|
||||
"&bIt is the end\n" +
|
||||
"&bfluffcq\n" +
|
||||
"&bleijurv\n" +
|
||||
"&bpolymer");
|
||||
"&l&9Author:\n" +
|
||||
"086\n" +
|
||||
"&l&9Contributors:\n" +
|
||||
"Bella (S-B99)\n" +
|
||||
"hub (blockparole)\n" +
|
||||
"Sasha (EmotionalLove)\n" +
|
||||
"Qther (d1gress / Vonr)\n" +
|
||||
"HHSGPA\n" +
|
||||
"20kdc\n" +
|
||||
"IronException\n" +
|
||||
"cats (Cuhnt)\n" +
|
||||
"Katatje\n" +
|
||||
"Deauthorized\n" +
|
||||
"snowmii\n" +
|
||||
"kdb424\n" +
|
||||
"Jack (jacksonellsworth03)\n" +
|
||||
"cookiedragon234\n" +
|
||||
"0x2E (PretendingToCode)\n" +
|
||||
"babbaj\n" +
|
||||
"ZeroMemes\n" +
|
||||
"TheBritishMidget (TBM)\n" +
|
||||
"Hamburger (Hamburger2k)\n" +
|
||||
"Darki\n" +
|
||||
"Crystallinqq\n" +
|
||||
"Elementars\n" +
|
||||
"fsck\n" +
|
||||
"Jamie (jamie27)\n" +
|
||||
"Waizy\n" +
|
||||
"It is the end\n" +
|
||||
"fluffcq\n" +
|
||||
"leijurv\n" +
|
||||
"polymer");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class GenerateWebsiteCommand extends Command {
|
|||
@Override
|
||||
public void call(String[] args) {
|
||||
List<Module> mods = new ArrayList<>(ModuleManager.getModules());
|
||||
String[] modCategories = new String[]{"Chat", "Combat", "Gui", "Misc", "Movement", "Player", "Render"};
|
||||
String[] modCategories = new String[]{"Chat", "Combat", "Gui", "Misc", "Movement", "Player", "Render", "Utils"};
|
||||
List<String> modCategoriesList = new ArrayList<>(java.util.Arrays.asList(modCategories));
|
||||
|
||||
List<String> modsChat = new ArrayList<>();
|
||||
|
@ -35,6 +35,7 @@ public class GenerateWebsiteCommand extends Command {
|
|||
List<String> modsMovement = new ArrayList<>();
|
||||
List<String> modsPlayer = new ArrayList<>();
|
||||
List<String> modsRender = new ArrayList<>();
|
||||
List<String> modsUtils = new ArrayList<>();
|
||||
|
||||
mods.forEach(module -> {
|
||||
switch (module.getCategory()) {
|
||||
|
@ -52,6 +53,8 @@ public class GenerateWebsiteCommand extends Command {
|
|||
modsPlayer.add(nameAndDescription(module));
|
||||
case RENDER:
|
||||
modsRender.add(nameAndDescription(module));
|
||||
case UTILS:
|
||||
modsUtils.add(nameAndDescription(module));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -64,7 +67,7 @@ public class GenerateWebsiteCommand extends Command {
|
|||
KamiMod.log.info(" <li>" + module.getName() + "<p><i>" + module.getDescription() + "</i></p></li>");
|
||||
}
|
||||
});
|
||||
KamiMod.log.info(" </ul></p>"); // cat#$*UWUnuzzl3s70U
|
||||
KamiMod.log.info(" </ul></p>");
|
||||
KamiMod.log.info("</details>");
|
||||
|
||||
});
|
||||
|
|
|
@ -69,14 +69,14 @@ public class KamiActiveModulesUI extends AbstractComponentUI<me.zeroeightsix.kam
|
|||
rgb = Color.HSBtoRGB(hue[0], toF(activeMods.saturationR.getValue()), toF(activeMods.brightnessR.getValue()));
|
||||
} else if (activeMods.mode.getValue().equals(ActiveModules.Mode.CATEGORY)) {
|
||||
rgb = ActiveModules.getCategoryColour(module);
|
||||
} else if (activeMods.mode.getValue().equals(ActiveModules.Mode.CUSTOM)){
|
||||
} else if (activeMods.mode.getValue().equals(ActiveModules.Mode.CUSTOM)) {
|
||||
rgb = Color.HSBtoRGB(toF(activeMods.hueC.getValue()), toF(activeMods.saturationC.getValue()), toF(activeMods.brightnessC.getValue()));
|
||||
} else {
|
||||
rgb = activeMods.getInfoColour(i);
|
||||
}
|
||||
|
||||
String s = module.getHudInfo();
|
||||
String text = module.getName() + (s == null ? "" : " " + KamiMod.colour + "7" + s);
|
||||
String hudInfo = module.getHudInfo();
|
||||
String text = activeMods.fHax() + module.getName() + (hudInfo == null ? "" : " " + KamiMod.colour + "7" + hudInfo);
|
||||
int textWidth = renderer.getStringWidth(text);
|
||||
int textHeight = renderer.getFontHeight() + 1;
|
||||
int red = (rgb >> 16) & 0xFF;
|
||||
|
|
|
@ -84,6 +84,10 @@ public class Module {
|
|||
return originalName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see me.zeroeightsix.kami.command.commands.GenerateWebsiteCommand
|
||||
* @see me.zeroeightsix.kami.module.modules.gui.ActiveModules
|
||||
*/
|
||||
public enum Category {
|
||||
CHAT("Chat", false),
|
||||
COMBAT("Combat", false),
|
||||
|
@ -93,7 +97,8 @@ public class Module {
|
|||
MISC("Misc", false),
|
||||
MOVEMENT("Movement", false),
|
||||
PLAYER("Player", false),
|
||||
RENDER("Render", false);
|
||||
RENDER("Render", false),
|
||||
UTILS("Utils", false);
|
||||
|
||||
boolean hidden;
|
||||
String name;
|
||||
|
|
|
@ -14,10 +14,7 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by 086 on 23/08/2017.
|
||||
|
@ -78,7 +75,7 @@ public class ModuleManager {
|
|||
GlStateManager.disableDepth();
|
||||
|
||||
GlStateManager.glLineWidth(1f);
|
||||
Vec3d renderPos = EntityUtil.getInterpolatedPos(Wrapper.getPlayer(), event.getPartialTicks());
|
||||
Vec3d renderPos = EntityUtil.getInterpolatedPos(Objects.requireNonNull(Wrapper.getMinecraft().getRenderViewEntity()), event.getPartialTicks());
|
||||
|
||||
RenderEvent e = new RenderEvent(KamiTessellator.INSTANCE, renderPos);
|
||||
e.resetTranslation();
|
||||
|
|
|
@ -5,6 +5,7 @@ import me.zero.alpine.listener.Listener;
|
|||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.modules.gui.InfoOverlay;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.util.ColourUtils;
|
||||
|
@ -18,8 +19,8 @@ import net.minecraft.util.text.TextFormatting;
|
|||
*/
|
||||
@Module.Info(name = "ChatTimestamp", category = Module.Category.CHAT, description = "Shows the time a message was sent beside the message", showOnArray = Module.ShowOnArray.OFF)
|
||||
public class ChatTimestamp extends Module {
|
||||
private Setting<ColourUtils.ColourCode> firstColour = register(Settings.e("First Colour", ColourUtils.ColourCode.GRAY));
|
||||
private Setting<ColourUtils.ColourCode> secondColour = register(Settings.e("Second Colour", ColourUtils.ColourCode.WHITE));
|
||||
private Setting<TextFormatting> firstColour = register(Settings.e("First Colour", TextFormatting.valueOf("GRAY")));
|
||||
private Setting<TextFormatting> secondColour = register(Settings.e("Second Colour", TextFormatting.valueOf("WHITE")));
|
||||
private Setting<TimeUtil.TimeType> timeTypeSetting = register(Settings.e("Time Format", TimeUtil.TimeType.HHMM));
|
||||
private Setting<TimeUtil.TimeUnit> timeUnitSetting = register(Settings.e("Time Unit", TimeUtil.TimeUnit.H12));
|
||||
private Setting<Boolean> doLocale = register(Settings.b("Show AMPM", true));
|
||||
|
|
|
@ -15,7 +15,7 @@ import static me.zeroeightsix.kami.KamiMod.*;
|
|||
* Created by 086 on 8/04/2018.
|
||||
* Updated by S-B99 on 12/03/20
|
||||
*/
|
||||
@Module.Info(name = "CustomChat", category = Module.Category.CHAT, description = "Adds a watermark to the end of your message to let others know you're using KAMI Blue", showOnArray = Module.ShowOnArray.OFF)
|
||||
@Module.Info(name = "CustomChat", category = Module.Category.CHAT, description = "Add a custom suffix to the end of your message!", showOnArray = Module.ShowOnArray.OFF)
|
||||
public class CustomChat extends Module {
|
||||
public Setting<Boolean> startupGlobal = register(Settings.b("Enable Automatically", true));
|
||||
public Setting<TextMode> textMode = register(Settings.e("Message", TextMode.ON_TOP));
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import net.minecraft.tileentity.TileEntityBed;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
@Module.Info(name = "BedAura", category = Module.Category.COMBAT, description = "Automatically right clicks beds in range")
|
||||
public class BedAura extends Module {
|
||||
private Setting<Integer> waitTick = register(Settings.i("Tick Delay", 10));
|
||||
private Setting<Double> range = register(Settings.d("Hit Range", 4.0D));
|
||||
|
||||
private int waitCounter;
|
||||
|
||||
public void onUpdate() {
|
||||
if (mc.player == null) return;
|
||||
|
||||
if (mc.player.dimension != 0) {
|
||||
if (waitTick.getValue() > 0) {
|
||||
if (waitCounter < waitTick.getValue()) {
|
||||
++waitCounter;
|
||||
return;
|
||||
}
|
||||
waitCounter = 0;
|
||||
}
|
||||
mc.world.loadedTileEntityList.stream()
|
||||
.filter((e) -> e instanceof TileEntityBed)
|
||||
.filter((e) -> mc.player.getPosition().getDistance(e.getPos().x, e.getPos().y, e.getPos().z) <= range.getValue())
|
||||
.map((entity) -> (TileEntityBed) entity)
|
||||
.min(Comparator.comparing((e) -> mc.player.getPosition().getDistance(e.getPos().x, e.getPos().y, e.getPos().z)))
|
||||
.ifPresent(bed -> mc.playerController.processRightClickBlock(mc.player, mc.world, bed.getPos(), EnumFacing.UP, new Vec3d(bed.getPos().getX(), bed.getPos().getY(), bed.getPos().getZ()), EnumHand.MAIN_HAND));
|
||||
} else {
|
||||
Command.sendErrorMessage(getChatName() + "Exploding beds only works in the nether and in the end, disabling!");
|
||||
disable();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,20 +4,26 @@ import me.zeroeightsix.kami.module.Module;
|
|||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import static me.zeroeightsix.kami.command.Command.sendDisableMessage;
|
||||
import static me.zeroeightsix.kami.util.ColourConverter.rgbToInt;
|
||||
import static me.zeroeightsix.kami.util.ColourTextFormatting.colourEnumMap;
|
||||
import static me.zeroeightsix.kami.util.InfoCalculator.isNumberEven;
|
||||
import static me.zeroeightsix.kami.util.InfoCalculator.reverseNumber;
|
||||
|
||||
/**
|
||||
* @author S-B99
|
||||
* Created by S-B99 on 20/03/20
|
||||
* Updated by S-B99 on 24/03/20
|
||||
*/
|
||||
@Module.Info(name = "ActiveModules", category = Module.Category.GUI, description = "Configures ActiveModules Colour", showOnArray = Module.ShowOnArray.OFF)
|
||||
public class ActiveModules extends Module {
|
||||
private Setting<Boolean> forgeHax = register(Settings.b("ForgeHax", false));
|
||||
public Setting<Mode> mode = register(Settings.e("Mode", Mode.RAINBOW));
|
||||
private Setting<Integer> rainbowSpeed = register(Settings.integerBuilder().withName("Speed F").withValue(30).withMinimum(0).withMaximum(100).withVisibility(v -> mode.getValue().equals(Mode.RAINBOW)).build());
|
||||
private Setting<Integer> rainbowSpeed = register(Settings.integerBuilder().withName("Speed R").withValue(30).withMinimum(0).withMaximum(100).withVisibility(v -> mode.getValue().equals(Mode.RAINBOW)).build());
|
||||
public Setting<Integer> saturationR = register(Settings.integerBuilder().withName("Saturation R").withValue(117).withMinimum(0).withMaximum(255).withVisibility(v -> mode.getValue().equals(Mode.RAINBOW)).build());
|
||||
public Setting<Integer> brightnessR = register(Settings.integerBuilder().withName("Brightness R").withValue(255).withMinimum(0).withMaximum(255).withVisibility(v -> mode.getValue().equals(Mode.RAINBOW)).build());
|
||||
public Setting<Integer> hueC = register(Settings.integerBuilder().withName("Hue C").withValue(178).withMinimum(0).withMaximum(255).withVisibility(v -> mode.getValue().equals(Mode.CUSTOM)).build());
|
||||
|
@ -27,83 +33,64 @@ public class ActiveModules extends Module {
|
|||
|
||||
public static int getCategoryColour(Module module) {
|
||||
switch (module.getCategory()) {
|
||||
case CHAT: return rgbToInt(245, 66, 66);
|
||||
case COMBAT: return rgbToInt(245, 135, 66);
|
||||
case EXPERIMENTAL: return rgbToInt(245, 66, 129);
|
||||
case GUI: return rgbToInt(245, 203, 66);
|
||||
case RENDER: return rgbToInt(194, 245, 66);
|
||||
case PLAYER: return rgbToInt(66, 245, 126);
|
||||
case MOVEMENT: return rgbToInt(66, 182, 245);
|
||||
case MISC: return rgbToInt(170, 66, 245);
|
||||
case CHAT: return rgbToInt(129, 171, 174);
|
||||
case COMBAT: return rgbToInt(162, 25, 14);
|
||||
case EXPERIMENTAL: return rgbToInt(175, 175, 31);
|
||||
case GUI: return rgbToInt(158, 159, 197);
|
||||
case RENDER: return rgbToInt(51, 197, 130);
|
||||
case PLAYER: return rgbToInt(99, 202, 191);
|
||||
case MOVEMENT: return rgbToInt(7, 77, 227);
|
||||
case MISC: return rgbToInt(247, 215, 59);
|
||||
case UTILS: return rgbToInt(46, 212, 77);
|
||||
default: return rgbToInt(139, 100, 255);
|
||||
}
|
||||
}
|
||||
|
||||
public int getInfoColour(int position) {
|
||||
if (!alternate.getValue()) return getSecondInfoColourFromSettings();
|
||||
if (!alternate.getValue()) return settingsToColour(false);
|
||||
else {
|
||||
if (isNumberEven(position)) {
|
||||
return getFirstInfoColourFromSettings();
|
||||
return settingsToColour(true);
|
||||
} else {
|
||||
return getSecondInfoColourFromSettings();
|
||||
return settingsToColour(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: fix this dogshit code with the ColourTextFormatting class
|
||||
private int getFirstInfoColourFromSettings() {
|
||||
InfoOverlay infoOverlay = (InfoOverlay) ModuleManager.getModuleByName("InfoOverlay");
|
||||
switch (infoOverlay.firstColour.getValue()) {
|
||||
case BLACK: return rgbToInt(0,0, 0);
|
||||
case DARK_BLUE: return rgbToInt(0, 0, 170);
|
||||
case DARK_GREEN: return rgbToInt(0, 170, 0);
|
||||
case DARK_AQUA: return rgbToInt(0, 170, 170);
|
||||
case DARK_RED: return rgbToInt(170, 0, 0);
|
||||
case DARK_PURPLE: return rgbToInt(170, 0, 170);
|
||||
case GOLD: return rgbToInt(255, 170, 0);
|
||||
case GRAY: return rgbToInt(170, 170, 0);
|
||||
case DARK_GRAY: return rgbToInt(85, 85, 85);
|
||||
case BLUE: return rgbToInt(85, 85, 255);
|
||||
case GREEN: return rgbToInt(85, 255, 85);
|
||||
case AQUA: return rgbToInt(85, 225, 225);
|
||||
case RED: return rgbToInt(255, 85, 85);
|
||||
case LIGHT_PURPLE: return rgbToInt(255, 85, 255);
|
||||
case YELLOW: return rgbToInt(255, 255, 85);
|
||||
case WHITE: return rgbToInt(255, 255, 255);
|
||||
private int settingsToColour(boolean isOne) {
|
||||
Color localColor;
|
||||
switch (infoGetSetting(isOne)) {
|
||||
case UNDERLINE:
|
||||
case ITALIC:
|
||||
case RESET:
|
||||
case STRIKETHROUGH:
|
||||
case OBFUSCATED:
|
||||
case BOLD:
|
||||
localColor = colourEnumMap.get(TextFormatting.WHITE).colorLocal; break;
|
||||
default:
|
||||
localColor = colourEnumMap.get(infoGetSetting(isOne)).colorLocal;
|
||||
}
|
||||
return rgbToInt(155, 144, 255);
|
||||
return rgbToInt(localColor.getRed(), localColor.getGreen(), localColor.getBlue());
|
||||
}
|
||||
|
||||
private int getSecondInfoColourFromSettings() {
|
||||
private TextFormatting infoGetSetting(boolean isOne) {
|
||||
InfoOverlay infoOverlay = (InfoOverlay) ModuleManager.getModuleByName("InfoOverlay");
|
||||
switch (infoOverlay.secondColour.getValue()) {
|
||||
case BLACK: return rgbToInt(0,0, 0);
|
||||
case DARK_BLUE: return rgbToInt(0, 0, 170);
|
||||
case DARK_GREEN: return rgbToInt(0, 170, 0);
|
||||
case DARK_AQUA: return rgbToInt(0, 170, 170);
|
||||
case DARK_RED: return rgbToInt(170, 0, 0);
|
||||
case DARK_PURPLE: return rgbToInt(170, 0, 170);
|
||||
case GOLD: return rgbToInt(255, 170, 0);
|
||||
case GRAY: return rgbToInt(170, 170, 0);
|
||||
case DARK_GRAY: return rgbToInt(85, 85, 85);
|
||||
case BLUE: return rgbToInt(85, 85, 255);
|
||||
case GREEN: return rgbToInt(85, 255, 85);
|
||||
case AQUA: return rgbToInt(85, 225, 225);
|
||||
case RED: return rgbToInt(255, 85, 85);
|
||||
case LIGHT_PURPLE: return rgbToInt(255, 85, 255);
|
||||
case YELLOW: return rgbToInt(255, 255, 85);
|
||||
case WHITE: return rgbToInt(255, 255, 255);
|
||||
}
|
||||
return rgbToInt(155, 144, 255);
|
||||
if (isOne) return infoOverlay.firstColour.getValue();
|
||||
else return infoOverlay.secondColour.getValue();
|
||||
|
||||
}
|
||||
|
||||
public int getRainbowSpeed() {
|
||||
if (rainbowSpeed.getValue() == 0) return 10000000; // if 0 basically just never change the color
|
||||
int rSpeed = reverseNumber(rainbowSpeed.getValue(), 1, 100);
|
||||
if (rSpeed == 0) return 1; // can't divide by 0
|
||||
else return rSpeed;
|
||||
}
|
||||
|
||||
public enum Mode { RAINBOW, CATEGORY, CUSTOM, INFO_OVERLAY }
|
||||
public String fHax() {
|
||||
if (forgeHax.getValue()) return ">";
|
||||
else return "";
|
||||
}
|
||||
|
||||
public enum Mode { RAINBOW, CUSTOM, CATEGORY, INFO_OVERLAY }
|
||||
public void onDisable() { sendDisableMessage(getName()); }
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import me.zeroeightsix.kami.module.Module;
|
|||
import me.zeroeightsix.kami.module.modules.movement.TimerSpeed;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.util.ColourUtils;
|
||||
import me.zeroeightsix.kami.util.InfoCalculator;
|
||||
import me.zeroeightsix.kami.util.TimeUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -17,7 +16,6 @@ import net.minecraft.util.text.TextFormatting;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import static me.zeroeightsix.kami.command.Command.sendDisableMessage;
|
||||
import static me.zeroeightsix.kami.util.ColourUtils.getStringColour;
|
||||
|
||||
/**
|
||||
* @author S-B99
|
||||
|
@ -50,8 +48,8 @@ public class InfoOverlay extends Module {
|
|||
private Setting<TimeUtil.TimeType> timeTypeSetting = register(Settings.enumBuilder(TimeUtil.TimeType.class).withName("Time Format").withValue(TimeUtil.TimeType.HHMMSS).withVisibility(v -> page.getValue().equals(Page.THREE) && time.getValue()).build());
|
||||
private Setting<TimeUtil.TimeUnit> timeUnitSetting = register(Settings.enumBuilder(TimeUtil.TimeUnit.class).withName("Time Unit").withValue(TimeUtil.TimeUnit.H12).withVisibility(v -> page.getValue().equals(Page.THREE) && time.getValue()).build());
|
||||
private Setting<Boolean> doLocale = register(Settings.booleanBuilder("Time Show AMPM").withValue(true).withVisibility(v -> page.getValue().equals(Page.THREE) && time.getValue()).build());
|
||||
public Setting<ColourUtils.ColourCode> firstColour = register(Settings.enumBuilder(ColourUtils.ColourCode.class).withName("First Colour").withValue(ColourUtils.ColourCode.WHITE).withVisibility(v -> page.getValue().equals(Page.THREE)).build());
|
||||
public Setting<ColourUtils.ColourCode> secondColour = register(Settings.enumBuilder(ColourUtils.ColourCode.class).withName("Second Colour").withValue(ColourUtils.ColourCode.BLUE).withVisibility(v -> page.getValue().equals(Page.THREE)).build());
|
||||
public Setting<TextFormatting> firstColour = register(Settings.enumBuilder(TextFormatting.class).withName("First Colour").withValue(TextFormatting.valueOf("WHITE")).withVisibility(v -> page.getValue().equals(Page.THREE)).build());
|
||||
public Setting<TextFormatting> secondColour = register(Settings.enumBuilder(TextFormatting.class).withName("Second Colour").withValue(TextFormatting.valueOf("BLUE")).withVisibility(v -> page.getValue().equals(Page.THREE)).build());
|
||||
|
||||
private enum SpeedUnit { MPS, KMH }
|
||||
|
||||
|
@ -69,13 +67,8 @@ public class InfoOverlay extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
private String formatTimerSpeed() {
|
||||
String formatted = textColour(secondColour.getValue()) + "." + textColour(firstColour.getValue());
|
||||
return TimerSpeed.returnGui().replace(".", formatted);
|
||||
}
|
||||
|
||||
private String textColour(ColourUtils.ColourCode c) {
|
||||
return getStringColour(c);
|
||||
public static String getStringColour(TextFormatting c) {
|
||||
return c.toString();
|
||||
}
|
||||
|
||||
public static int getItems(Item i) {
|
||||
|
@ -85,33 +78,33 @@ public class InfoOverlay extends Module {
|
|||
public ArrayList<String> infoContents() {
|
||||
ArrayList<String> infoContents = new ArrayList<>();
|
||||
if (version.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + KamiMod.KAMI_KANJI + textColour(secondColour.getValue()) + " " + KamiMod.MODVERSMALL);
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + KamiMod.KAMI_KANJI + getStringColour(secondColour.getValue()) + " " + KamiMod.MODVERSMALL);
|
||||
} if (username.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + "Welcome" + textColour(secondColour.getValue()) + " " + mc.getSession().getUsername() + "!");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + "Welcome" + getStringColour(secondColour.getValue()) + " " + mc.getSession().getUsername() + "!");
|
||||
} if (time.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + TimeUtil.getFinalTime(secondColour.getValue(), firstColour.getValue(), timeUnitSetting.getValue(), timeTypeSetting.getValue(), doLocale.getValue()) + TextFormatting.RESET);
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + TimeUtil.getFinalTime(secondColour.getValue(), firstColour.getValue(), timeUnitSetting.getValue(), timeTypeSetting.getValue(), doLocale.getValue()));
|
||||
} if (tps.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + InfoCalculator.tps() + textColour(secondColour.getValue()) + " tps");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + InfoCalculator.tps() + getStringColour(secondColour.getValue()) + " tps");
|
||||
} if (fps.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + Minecraft.debugFPS + textColour(secondColour.getValue()) + " fps");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + Minecraft.debugFPS + getStringColour(secondColour.getValue()) + " fps");
|
||||
} if (speed.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + InfoCalculator.speed(useUnitKmH()) + textColour(secondColour.getValue()) + " " + unitType(speedUnit.getValue()));
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + InfoCalculator.speed(useUnitKmH()) + getStringColour(secondColour.getValue()) + " " + unitType(speedUnit.getValue()));
|
||||
} if (timerSpeed.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + formatTimerSpeed() + textColour(secondColour.getValue()) + "t");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + TimerSpeed.returnGui() + getStringColour(secondColour.getValue()) + "t");
|
||||
} if (ping.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + InfoCalculator.ping() + textColour(secondColour.getValue()) + " ms");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + InfoCalculator.ping() + getStringColour(secondColour.getValue()) + " ms");
|
||||
} if (durability.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + InfoCalculator.dura() + textColour(secondColour.getValue()) + " dura");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + InfoCalculator.dura() + getStringColour(secondColour.getValue()) + " dura");
|
||||
} if (memory.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + InfoCalculator.memory() + textColour(secondColour.getValue()) + "mB free");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + InfoCalculator.memory() + getStringColour(secondColour.getValue()) + "mB free");
|
||||
} if (totems.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + getItems(Items.TOTEM_OF_UNDYING) + textColour(secondColour.getValue()) + " Totems");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + getItems(Items.TOTEM_OF_UNDYING) + getStringColour(secondColour.getValue()) + " Totems");
|
||||
} if (endCrystals.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + getItems(Items.END_CRYSTAL) + textColour(secondColour.getValue()) + " Crystals");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + getItems(Items.END_CRYSTAL) + getStringColour(secondColour.getValue()) + " Crystals");
|
||||
} if (expBottles.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + getItems(Items.EXPERIENCE_BOTTLE) + textColour(secondColour.getValue()) + " EXP Bottles");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + getItems(Items.EXPERIENCE_BOTTLE) + getStringColour(secondColour.getValue()) + " EXP Bottles");
|
||||
} if (godApples.getValue()) {
|
||||
infoContents.add(textColour(firstColour.getValue()) + getItems(Items.GOLDEN_APPLE) + textColour(secondColour.getValue()) + " God Apples");
|
||||
infoContents.add(getStringColour(firstColour.getValue()) + getItems(Items.GOLDEN_APPLE) + getStringColour(secondColour.getValue()) + " God Apples");
|
||||
}
|
||||
return infoContents;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
package me.zeroeightsix.kami.module.modules.hidden;
|
||||
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.ModuleManager;
|
||||
import me.zeroeightsix.kami.module.modules.combat.CrystalAura;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.util.Friends;
|
|
@ -1,4 +1,4 @@
|
|||
package me.zeroeightsix.kami.module.modules.combat;
|
||||
package me.zeroeightsix.kami.module.modules.hidden;
|
||||
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
|
@ -9,8 +9,8 @@ import net.minecraft.item.ItemAir;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.client.CPacketHeldItemChange;
|
||||
|
||||
@Module.Info(name = "Pull32k", category = Module.Category.COMBAT, description = "Pulls 32ks out of hoppers automatically")
|
||||
public class Pull32k extends Module{
|
||||
@Module.Info(name = "Hidden:Pull32k", category = Module.Category.HIDDEN, description = "Pulls 32ks out of hoppers automatically")
|
||||
public class Pull32k extends Module {
|
||||
boolean foundsword = false;
|
||||
@Override
|
||||
public void onUpdate() {
|
|
@ -13,7 +13,7 @@ import net.minecraftforge.client.event.InputUpdateEvent;
|
|||
* Created by 086 on 15/12/2017.
|
||||
* Updated by S-B99 on 21/03/20
|
||||
* @see me.zeroeightsix.kami.mixin.client.MixinBlockSoulSand
|
||||
* @see net.minecraft.client.entity.EntityPlayerSP .onLivingUpdate()
|
||||
* @see net.minecraft.client.entity.EntityPlayerSP#onLivingUpdate()
|
||||
*/
|
||||
@Module.Info(name = "NoSlowDown", category = Module.Category.MOVEMENT, description = "Prevents being slowed down when using an item or going through cobwebs")
|
||||
public class NoSlowDown extends Module {
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.util.FoodStats;
|
|||
* Created by 086 on 8/04/2018.
|
||||
* Updated by polymer on 09/03/20
|
||||
* Updated by S-B99 on 20/03/20
|
||||
* Updated by An-En on 24/03/20
|
||||
*/
|
||||
@Module.Info(name = "AutoEat", description = "Automatically eat when hungry", category = Module.Category.PLAYER)
|
||||
public class AutoEat extends Module {
|
||||
|
@ -30,6 +31,7 @@ public class AutoEat extends Module {
|
|||
private boolean passItemCheck(Item item) {
|
||||
if (item == Items.ROTTEN_FLESH) return false;
|
||||
if (item == Items.SPIDER_EYE) return false;
|
||||
if (item == Items.POISONOUS_POTATO) return false;
|
||||
if (item == Items.FISH && new ItemStack(Items.FISH).getItemDamage() == 3) return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
package me.zeroeightsix.kami.module.modules.utils;
|
||||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.util.Wrapper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author 0x2E | PretendingToCode
|
||||
*
|
||||
* TODO: Fix delay timer because that shit broken
|
||||
*/
|
||||
@Module.Info(name = "BlockData", category = Module.Category.UTILS, description = "Right click blocks to display their data")
|
||||
public class BlockData extends Module {
|
||||
private int delay = 0;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (delay > 0) {
|
||||
delay--;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public Listener<InputEvent.MouseInputEvent> mouseListener = new Listener<>(event -> {
|
||||
if (Mouse.getEventButton() == 1 && delay == 0) {
|
||||
if (mc.objectMouseOver.typeOfHit.equals(RayTraceResult.Type.BLOCK)) {
|
||||
BlockPos blockpos = mc.objectMouseOver.getBlockPos();
|
||||
IBlockState iblockstate = mc.world.getBlockState(blockpos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if (block.hasTileEntity()) {
|
||||
TileEntity t = mc.world.getTileEntity(blockpos);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
Objects.requireNonNull(t).writeToNBT(tag);
|
||||
|
||||
Command.sendChatMessage(getChatName() + "&6Block Tags:\n" + tag + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package me.zeroeightsix.kami.module.modules.utils;
|
||||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.util.Wrapper;
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
/**
|
||||
* @author 0x2E | PretendingToCode
|
||||
*
|
||||
* Inspired by ForgeHax, recreated with expressed permission from creator
|
||||
*
|
||||
* TODO: Fix delay timer because that shit broken
|
||||
*/
|
||||
@Module.Info(name = "EntityTools", category = Module.Category.UTILS, description = "Right click entities to perform actions on them")
|
||||
public class EntityTools extends Module {
|
||||
private Setting<Mode> mode = register(Settings.e("Mode", Mode.DELETE));
|
||||
private int delay = 0;
|
||||
private enum Mode {
|
||||
DELETE, INFO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (delay > 0) {
|
||||
delay--;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public Listener<InputEvent.MouseInputEvent> mouseListener = new Listener<>(event -> {
|
||||
if (Mouse.getEventButton() == 1 && delay == 0) {
|
||||
if (mc.objectMouseOver.typeOfHit.equals(RayTraceResult.Type.ENTITY)) {
|
||||
if (mode.getValue().equals(Mode.DELETE)) {
|
||||
mc.world.removeEntity(mc.objectMouseOver.entityHit);
|
||||
}
|
||||
|
||||
if (mode.getValue().equals(Mode.INFO)) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
mc.objectMouseOver.entityHit.writeToNBT(tag);
|
||||
Command.sendChatMessage(getChatName() + "&6Entity Tags:\n" + tag + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
|
@ -21,16 +21,30 @@ public class EnumConverter extends Converter<Enum, JsonElement> {
|
|||
|
||||
@Override
|
||||
protected JsonElement doForward(Enum anEnum) {
|
||||
return new JsonPrimitive(anEnum.toString());
|
||||
return new JsonPrimitive(anEnum.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Enum doBackward(JsonElement jsonElement) {
|
||||
protected Enum doBackward(JsonElement jsonElement) { /* The try catch is really hacky workaround to get TextFormatting enums to work, see #595 */
|
||||
if (Arrays.toString(clazz.getEnumConstants()).contains(jsonElement.getAsString())) {
|
||||
return Enum.valueOf(clazz, jsonElement.getAsString());
|
||||
try {
|
||||
return Enum.valueOf(clazz, jsonElement.getAsString());
|
||||
} catch (IllegalArgumentException e) {
|
||||
for (Enum enumConstant : clazz.getEnumConstants()) {
|
||||
if (enumConstant.name().equalsIgnoreCase(jsonElement.getAsString())) return enumConstant;
|
||||
}
|
||||
return Enum.valueOf(clazz, "null");
|
||||
}
|
||||
}
|
||||
else {
|
||||
return Enum.valueOf(clazz, value.toString());
|
||||
try {
|
||||
return Enum.valueOf(clazz, value.toString());
|
||||
} catch (IllegalArgumentException e) {
|
||||
for (Enum enumConstant : clazz.getEnumConstants()) {
|
||||
if (enumConstant.name().equalsIgnoreCase(jsonElement.getAsString())) return enumConstant;
|
||||
}
|
||||
return Enum.valueOf(clazz, "null");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,52 +3,54 @@ package me.zeroeightsix.kami.util;
|
|||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author S-B99
|
||||
* Updated by S-B99 on 24/03/20
|
||||
*/
|
||||
public class ColourTextFormatting {
|
||||
public enum ColourEnum {
|
||||
BLACK(TextFormatting.BLACK),
|
||||
DARK_BLUE(TextFormatting.DARK_BLUE),
|
||||
DARK_GREEN(TextFormatting.DARK_GREEN),
|
||||
DARK_AQUA(TextFormatting.DARK_AQUA),
|
||||
DARK_RED(TextFormatting.DARK_RED),
|
||||
DARK_PURPLE(TextFormatting.DARK_PURPLE),
|
||||
GOLD(TextFormatting.GOLD),
|
||||
GRAY(TextFormatting.GRAY),
|
||||
DARK_GRAY(TextFormatting.DARK_GRAY),
|
||||
BLUE(TextFormatting.BLUE),
|
||||
GREEN(TextFormatting.GREEN),
|
||||
AQUA(TextFormatting.AQUA),
|
||||
RED(TextFormatting.RED),
|
||||
LIGHT_PURPLE(TextFormatting.LIGHT_PURPLE),
|
||||
YELLOW(TextFormatting.YELLOW),
|
||||
WHITE(TextFormatting.WHITE),
|
||||
BLACK_C(new Color(0,0, 0)),
|
||||
DARK_BLUE_C(new Color(0, 0, 170)),
|
||||
DARK_GREEN_C(new Color(0, 170, 0)),
|
||||
DARK_AQUA_C(new Color(0, 170, 170)),
|
||||
DARK_RED_C(new Color(170, 0, 0)),
|
||||
DARK_PURPLE_C(new Color(170, 0, 170)),
|
||||
GOLD_C(new Color(255, 170, 0)),
|
||||
GRAY_C(new Color(170, 170, 0)),
|
||||
DARK_GRAY_C(new Color(85, 85, 85)),
|
||||
BLUE_C(new Color(85, 85, 255)),
|
||||
GREEN_C(new Color(85, 255, 85)),
|
||||
AQUA_C(new Color(85, 225, 225)),
|
||||
RED_C(new Color(255, 85, 85)),
|
||||
LIGHT_PURPLE_C(new Color(255, 85, 255)),
|
||||
YELLOW_C(new Color(255, 255, 85)),
|
||||
WHITE_C(new Color(255, 255, 255));
|
||||
BLACK(new Color(0,0, 0)),
|
||||
DARK_BLUE(new Color(0, 0, 170)),
|
||||
DARK_GREEN(new Color(0, 170, 0)),
|
||||
DARK_AQUA(new Color(0, 170, 170)),
|
||||
DARK_RED(new Color(170, 0, 0)),
|
||||
DARK_PURPLE(new Color(170, 0, 170)),
|
||||
GOLD(new Color(255, 170, 0)),
|
||||
GRAY(new Color(170, 170, 170)),
|
||||
DARK_GRAY(new Color(85, 85, 85)),
|
||||
BLUE(new Color(85, 85, 255)),
|
||||
GREEN(new Color(85, 255, 85)),
|
||||
AQUA(new Color(85, 225, 225)),
|
||||
RED(new Color(255, 85, 85)),
|
||||
LIGHT_PURPLE(new Color(255, 85, 255)),
|
||||
YELLOW(new Color(255, 255, 85)),
|
||||
WHITE(new Color(255, 255, 255));
|
||||
|
||||
public TextFormatting val;
|
||||
public Color colorLocal;
|
||||
|
||||
private ColourEnum(TextFormatting val) {
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
private ColourEnum(Color colorLocal) {
|
||||
this.colorLocal = colorLocal;
|
||||
}
|
||||
ColourEnum(Color colorLocal) { this.colorLocal = colorLocal; }
|
||||
}
|
||||
|
||||
public static Map<TextFormatting, ColourEnum> colourEnumMap = new HashMap<TextFormatting, ColourEnum>(){{
|
||||
put(TextFormatting.BLACK, ColourEnum.BLACK);
|
||||
put(TextFormatting.DARK_BLUE, ColourEnum.DARK_BLUE);
|
||||
put(TextFormatting.DARK_GREEN, ColourEnum.DARK_GREEN);
|
||||
put(TextFormatting.DARK_AQUA, ColourEnum.DARK_AQUA);
|
||||
put(TextFormatting.DARK_RED, ColourEnum.DARK_RED);
|
||||
put(TextFormatting.DARK_PURPLE, ColourEnum.DARK_PURPLE);
|
||||
put(TextFormatting.GOLD, ColourEnum.GOLD);
|
||||
put(TextFormatting.GRAY, ColourEnum.GRAY);
|
||||
put(TextFormatting.DARK_GRAY, ColourEnum.DARK_GRAY);
|
||||
put(TextFormatting.BLUE, ColourEnum.BLUE);
|
||||
put(TextFormatting.GREEN, ColourEnum.GREEN);
|
||||
put(TextFormatting.AQUA, ColourEnum.AQUA);
|
||||
put(TextFormatting.RED, ColourEnum.RED);
|
||||
put(TextFormatting.LIGHT_PURPLE, ColourEnum.LIGHT_PURPLE);
|
||||
put(TextFormatting.YELLOW, ColourEnum.YELLOW);
|
||||
put(TextFormatting.WHITE, ColourEnum.WHITE);
|
||||
}};
|
||||
|
||||
}
|
||||
|
|
|
@ -298,59 +298,6 @@ public class ColourUtils {
|
|||
public final static int RAINBOW = Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author S-B99 28/01/20
|
||||
* https://minecraft.gamepedia.com/Formatting_codes#Color_codes
|
||||
* For strings please see TextFormatting.COLOUR.toString();
|
||||
*/
|
||||
public static class ColourCodesMinecraft {
|
||||
public final static int BLACK = toRGBA(0, 0, 0, 255);
|
||||
public final static int DARK_BLUE = toRGBA(0, 0, 170, 255);
|
||||
public final static int DARK_GREEN = toRGBA(0, 170, 0, 255);
|
||||
public final static int DARK_AQUA = toRGBA(0, 170, 170, 255);
|
||||
public final static int DARK_RED = toRGBA(170, 0, 0, 255);
|
||||
public final static int DARK_PURPLE = toRGBA(170, 0, 170, 255);
|
||||
public final static int GOLD = toRGBA(255, 170, 0, 255);
|
||||
public final static int GREY = toRGBA(170, 170, 170, 255);
|
||||
public final static int DARK_GREY = toRGBA(85, 85, 85, 255);
|
||||
public final static int BLUE = toRGBA(85, 85, 255, 255);
|
||||
public final static int GREEN = toRGBA(85, 255, 85, 255);
|
||||
public final static int AQUA = toRGBA(85, 255, 255, 255);
|
||||
public final static int RED = toRGBA(255, 85, 85, 255);
|
||||
public final static int LIGHT_PURPLE = toRGBA(255, 85, 255, 255);
|
||||
public final static int YELLOW = toRGBA(255, 255, 85, 255);
|
||||
public final static int WHITE = toRGBA(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author S-B99 06/02/20
|
||||
* Tool for getting Minecraft Textformatting Colors
|
||||
*/
|
||||
public enum ColourCode {
|
||||
BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, LIGHT_PURPLE, YELLOW, WHITE
|
||||
}
|
||||
public static String getStringColour(ColourCode c) {
|
||||
switch (c) {
|
||||
case BLACK: return TextFormatting.BLACK.toString();
|
||||
case DARK_BLUE: return TextFormatting.DARK_BLUE.toString();
|
||||
case DARK_GREEN: return TextFormatting.DARK_GREEN.toString();
|
||||
case DARK_AQUA: return TextFormatting.DARK_AQUA.toString();
|
||||
case DARK_RED: return TextFormatting.DARK_RED.toString();
|
||||
case DARK_PURPLE: return TextFormatting.DARK_PURPLE.toString();
|
||||
case GOLD: return TextFormatting.GOLD.toString();
|
||||
case GRAY: return TextFormatting.GRAY.toString();
|
||||
case DARK_GRAY: return TextFormatting.DARK_GRAY.toString();
|
||||
case BLUE: return TextFormatting.BLUE.toString();
|
||||
case GREEN: return TextFormatting.GREEN.toString();
|
||||
case AQUA: return TextFormatting.AQUA.toString();
|
||||
case RED: return TextFormatting.RED.toString();
|
||||
case LIGHT_PURPLE: return TextFormatting.LIGHT_PURPLE.toString();
|
||||
case YELLOW: return TextFormatting.YELLOW.toString();
|
||||
case WHITE: return TextFormatting.WHITE.toString();
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static final int changeAlpha(int origColor, int userInputedAlpha) {
|
||||
origColor = origColor & 0x00ffffff; // drop the previous alpha value
|
||||
return (userInputedAlpha << 24) | origColor; // add the one the user inputted
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package me.zeroeightsix.kami.util;
|
||||
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getStringColour;
|
||||
|
||||
/**
|
||||
* @author S-B99
|
||||
* Updated by S-B99 on 06/02/20
|
||||
|
@ -46,8 +50,7 @@ public class TimeUtil {
|
|||
return formatter;
|
||||
}
|
||||
|
||||
public static String getFinalTime(ColourUtils.ColourCode colourCode2, ColourUtils.ColourCode colourCode1, TimeUnit timeUnit, TimeType timeType, Boolean doLocale) {
|
||||
String formatted = ColourUtils.getStringColour(colourCode2) + ":" + ColourUtils.getStringColour(colourCode1);
|
||||
public static String getFinalTime(TextFormatting colourCode2, TextFormatting colourCode1, TimeUnit timeUnit, TimeType timeType, Boolean doLocale) {
|
||||
String locale = "";
|
||||
String time = time(TimeUtil.dateFormatter(TimeUnit.H24, TimeType.HH));
|
||||
if (timeUnit == TimeUnit.H12 && doLocale) {
|
||||
|
@ -57,6 +60,6 @@ public class TimeUtil {
|
|||
locale = "am";
|
||||
}
|
||||
}
|
||||
return ColourUtils.getStringColour(colourCode1) + time(dateFormatter(timeUnit, timeType)).replace(":", formatted) + ColourUtils.getStringColour(colourCode2) + locale;
|
||||
return getStringColour(colourCode1) + time(dateFormatter(timeUnit, timeType)) + getStringColour(colourCode2) + locale;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
package me.zeroeightsix.kami.util;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBufferByte;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Updated by S-B99 on 07/02/20
|
||||
*/
|
||||
public class WindowIcon {
|
||||
// public static ByteBuffer[] ExtractByteBufferFromImagePath(String s) {
|
||||
// try {
|
||||
// BufferedImage bi = ImageIO.read(new java.io.File(s));
|
||||
// byte[] iconData = ((DataBufferByte) bi.getRaster().getDataBuffer()).getData();
|
||||
// ByteBuffer ib = createByteBuffer(iconData.length);
|
||||
// ib.order(ByteOrder.nativeOrder());
|
||||
// ib.put(iconData, 0, iconData.length);
|
||||
// ib.flip();
|
||||
// return new ByteBuffer[]{ib};
|
||||
// }
|
||||
// catch (Exception e){
|
||||
// System.out.println("Couldn't open icon image..." + e.toString());
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
/*
|
||||
public static ByteBuffer[] extractBytes() throws IOException {
|
||||
BufferedImage bufferedImage = ImageIO.read(new File("kami.jpg"));
|
||||
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
// ImageIO.write(bufferedImage, "jpg", bos );
|
||||
// byte [] data = bos.toByteArray();
|
||||
|
||||
WritableRaster raster = bufferedImage.getRaster();
|
||||
DataBufferByte data = (DataBufferByte) raster.getDataBuffer();
|
||||
|
||||
return new ByteBuffer[]{ByteBuffer.wrap(data.getData())};
|
||||
}
|
||||
*/
|
||||
}
|
Loading…
Reference in New Issue