Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
965a3ea62d | ||
|
|
a36058459f | ||
|
|
962c2f5f2b | ||
| cda526d41d | |||
|
|
1321bb3cca | ||
| 47e475cecb |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -116,3 +116,8 @@ run/
|
|||||||
|
|
||||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||||
!gradle-wrapper.jar
|
!gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Gradle files
|
||||||
|
gradlew
|
||||||
|
gradlew.bat
|
||||||
|
gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|||||||
@@ -15,10 +15,8 @@ import net.minecraft.world.entity.vehicle.Boat;
|
|||||||
import net.minecraft.world.entity.vehicle.Minecart;
|
import net.minecraft.world.entity.vehicle.Minecart;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -67,14 +65,8 @@ public class Client {
|
|||||||
|
|
||||||
ClientGuiEvent.RENDER_HUD.register(Client::render);
|
ClientGuiEvent.RENDER_HUD.register(Client::render);
|
||||||
|
|
||||||
try {
|
LOGGER.info("Loading speedometer ");
|
||||||
img = ImageIO.read(Objects.requireNonNull(Speedometer.class.getResourceAsStream("/assets/speedometer/meter/meter-19.png")));
|
if(!MeterImages.LARGE.initiate()){
|
||||||
}catch (NullPointerException | IOException e){
|
|
||||||
LOGGER.warn("Can't load speedometer icon. speedometer visual display is disabled");
|
|
||||||
speedometerVisualDisplayFailed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(img == null){
|
|
||||||
speedometerVisualDisplayFailed = true;
|
speedometerVisualDisplayFailed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,30 +131,39 @@ public class Client {
|
|||||||
}/100;
|
}/100;
|
||||||
double i = (v *(316-45))+45;
|
double i = (v *(316-45))+45;
|
||||||
|
|
||||||
|
int yPos = getPos(graphics, Config.getYPosition(), 1);
|
||||||
|
int xPos = getPos(graphics, Config.getXPosition(), 0);
|
||||||
|
|
||||||
|
int lineHeight = Minecraft.getInstance().font.lineHeight;
|
||||||
|
|
||||||
if(Config.getVisualSpeedometer() && !speedometerVisualDisplayFailed){
|
if(Config.getVisualSpeedometer() && !speedometerVisualDisplayFailed){
|
||||||
|
|
||||||
//double v = speedTypeSpeed / speedType.gatMaxVisual();
|
//double v = speedTypeSpeed / speedType.gatMaxVisual();
|
||||||
|
|
||||||
MeterImages meterImage = null;
|
img = ImageHandler.clone(MeterImages.LARGE.getImage());
|
||||||
int minDiff = 10000;
|
|
||||||
|
|
||||||
for(MeterImages meterImage1 : MeterImages.values()){
|
Graphics2D g2d = img.createGraphics();
|
||||||
int diff = Math.abs(meterImage1.getSize()-Config.getImageSize());
|
|
||||||
if(minDiff > diff && meterImage1.getImage() != null){
|
g2d.setColor(new Color(138, 0, 0));
|
||||||
minDiff = diff;
|
g2d.setFont(new Font(g2d.getFont().getName(), Font.PLAIN, 15));
|
||||||
meterImage = meterImage1;
|
|
||||||
|
if(Config.getShowVisualSpeedType()) {
|
||||||
|
g2d.drawString(SpeedTypes.getName(speedType).getString(), img.getWidth() / 2 - 27, img.getHeight() / 2 + 25);
|
||||||
}
|
}
|
||||||
|
if(Config.getShowSpeedType()){
|
||||||
|
String speedString = SpeedTypes.getName(speedType).getString();
|
||||||
|
int width = Minecraft.getInstance().font.width(speedString);
|
||||||
|
drawString(graphics, xPos - width, yPos - Config.getImageSize() - lineHeight - 1, speedString, Config.getColor().getColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
img = meterImage.getImage();
|
|
||||||
|
|
||||||
int radius = Config.getImageSize()/2-4;
|
|
||||||
|
|
||||||
int x3 = (int) Math.round(radius*Math.cos(Math.toRadians(i+90)))+(Config.getImageSize()/2);
|
|
||||||
int y3 = (int) Math.round(radius*Math.sin(Math.toRadians(i+90)))+(Config.getImageSize()/2);
|
|
||||||
|
|
||||||
BufferedImage img = ImageHandler.scale(Client.img, Config.getImageSize(), Config.getImageSize());
|
BufferedImage img = ImageHandler.scale(Client.img, Config.getImageSize(), Config.getImageSize());
|
||||||
Graphics2D g2d = img.createGraphics();
|
|
||||||
|
int radius = img.getWidth()/2-4;
|
||||||
|
|
||||||
|
int x3 = (int) Math.round(radius*Math.cos(Math.toRadians(i+90)))+(img.getWidth()/2);
|
||||||
|
int y3 = (int) Math.round(radius*Math.sin(Math.toRadians(i+90)))+(img.getHeight()/2);
|
||||||
|
|
||||||
|
g2d = img.createGraphics();
|
||||||
|
|
||||||
g2d.setColor(new Color(138, 0, 0));
|
g2d.setColor(new Color(138, 0, 0));
|
||||||
|
|
||||||
@@ -170,9 +171,6 @@ public class Client {
|
|||||||
|
|
||||||
g2d.drawLine(x3,y3,img.getWidth()/2,img.getHeight()/2);
|
g2d.drawLine(x3,y3,img.getWidth()/2,img.getHeight()/2);
|
||||||
|
|
||||||
int xPos = getPos(graphics, Config.getXPosition(), 0, false);
|
|
||||||
int yPos = getPos(graphics, Config.getYPosition(), 1, true);
|
|
||||||
|
|
||||||
for(int x1 = 0; x1 < img.getWidth(); x1++){
|
for(int x1 = 0; x1 < img.getWidth(); x1++){
|
||||||
for(int y1 = 0; y1 < img.getHeight(); y1++){
|
for(int y1 = 0; y1 < img.getHeight(); y1++){
|
||||||
int x2 = x1 + xPos - img.getWidth();
|
int x2 = x1 + xPos - img.getWidth();
|
||||||
@@ -203,12 +201,11 @@ public class Client {
|
|||||||
// k -> color RGB int
|
// k -> color RGB int
|
||||||
String speedString = format + " " + SpeedTypes.getName(speedType).getString();
|
String speedString = format + " " + SpeedTypes.getName(speedType).getString();
|
||||||
int width = Minecraft.getInstance().font.width(speedString);
|
int width = Minecraft.getInstance().font.width(speedString);
|
||||||
int lineHeight = Minecraft.getInstance().font.lineHeight;
|
|
||||||
graphics.drawString(
|
graphics.drawString(
|
||||||
Minecraft.getInstance().font,
|
Minecraft.getInstance().font,
|
||||||
speedString,
|
speedString,
|
||||||
getPos(graphics, Config.getXPosition(), 0, false) - width,
|
xPos - width,
|
||||||
getPos(graphics, Config.getYPosition(), 1, true) - lineHeight,
|
yPos - lineHeight,
|
||||||
Config.getColor().getColor()
|
Config.getColor().getColor()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -231,7 +228,8 @@ public class Client {
|
|||||||
"Velocity total average: " + speed + "\n" +
|
"Velocity total average: " + speed + "\n" +
|
||||||
"Velocity total in " + speedType.name() + ": " + speedTypeSpeed + "\n" +
|
"Velocity total in " + speedType.name() + ": " + speedTypeSpeed + "\n" +
|
||||||
"Percentage point of visual speedometer: " + v + "\n" +
|
"Percentage point of visual speedometer: " + v + "\n" +
|
||||||
"Degree end point: " + (i+45);
|
"Degree end point: " + (i+45) +"\n" +
|
||||||
|
(Config.getVisualSpeedometer()?"Visual Size: ":"Textual display") + Config.getImageSize();
|
||||||
|
|
||||||
Color color = new Color(255, 255, 255);
|
Color color = new Color(255, 255, 255);
|
||||||
|
|
||||||
@@ -253,9 +251,7 @@ public class Client {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean flag = true;
|
private static int getPos(GuiGraphics event, String input, int type) {
|
||||||
|
|
||||||
private static int getPos(GuiGraphics event, String input, int type, boolean changeFlag) {
|
|
||||||
ArrayList<String> passerPose = new ArrayList<>();
|
ArrayList<String> passerPose = new ArrayList<>();
|
||||||
final char[] s = input.toCharArray();
|
final char[] s = input.toCharArray();
|
||||||
try{
|
try{
|
||||||
@@ -274,7 +270,7 @@ public class Client {
|
|||||||
passerPose.add("/");
|
passerPose.add("/");
|
||||||
}else if(s[i] == '/'){
|
}else if(s[i] == '/'){
|
||||||
passerPose.add("/");
|
passerPose.add("/");
|
||||||
}else if(testIfInt(s[i])){
|
}else if(Character.isDigit(s[i])){
|
||||||
try{
|
try{
|
||||||
Integer.parseInt(passerPose.get(i-1));
|
Integer.parseInt(passerPose.get(i-1));
|
||||||
passerPose.add(i-1,passerPose.get(i-1)+s[i]);
|
passerPose.add(i-1,passerPose.get(i-1)+s[i]);
|
||||||
@@ -290,7 +286,7 @@ public class Client {
|
|||||||
defaultValues(event, type, passerPose);
|
defaultValues(event, type, passerPose);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
int xPos;
|
int xPos;
|
||||||
try{
|
try{
|
||||||
@@ -320,11 +316,12 @@ public class Client {
|
|||||||
xPos /= Integer.parseInt(s2);
|
xPos /= Integer.parseInt(s2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((Platform.isDevelopmentEnvironment() || Config.isDebug()) && flag) {
|
if((Config.isDebug()) && Config.getCounter() < 2) {
|
||||||
LOGGER.info("Selected speed type: "+SpeedTypes.getName(Config.getSpeedType()).getString()+"\n"+
|
LOGGER.info("Selected speed type: "+SpeedTypes.getName(Config.getSpeedType()).getString()+"\n"+
|
||||||
Arrays.toString(passerPose.toArray())+"\n\n"+
|
Arrays.toString(passerPose.toArray())+"\n\n"+
|
||||||
xPos);
|
xPos+"\n\n"+
|
||||||
flag = !changeFlag;
|
(type==0?Config.getXPosition():Config.getYPosition()));
|
||||||
|
Config.addCounter();
|
||||||
}
|
}
|
||||||
return xPos;
|
return xPos;
|
||||||
}
|
}
|
||||||
@@ -333,19 +330,11 @@ public class Client {
|
|||||||
if(type == 0){
|
if(type == 0){
|
||||||
passerPose.add(String.valueOf(event.guiWidth()));
|
passerPose.add(String.valueOf(event.guiWidth()));
|
||||||
passerPose.add("-");
|
passerPose.add("-");
|
||||||
passerPose.add("70");
|
passerPose.add("3");
|
||||||
}else if(type == 1){
|
}else if(type == 1){
|
||||||
passerPose.add(String.valueOf(event.guiHeight()));
|
passerPose.add(String.valueOf(event.guiHeight()));
|
||||||
passerPose.add("-");
|
passerPose.add("-");
|
||||||
passerPose.add("15");
|
passerPose.add("3");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean testIfInt(char c) {
|
|
||||||
int i = Integer.parseInt(Character.toString(c));
|
|
||||||
return (i == 0 || i == 1 || i == 2 ||
|
|
||||||
i == 3 || i == 4 || i == 5 ||
|
|
||||||
i == 6 || i == 7 || i == 8 ||
|
|
||||||
i == 9);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,46 +10,47 @@ import me.shedaniel.math.Color;
|
|||||||
import static me.zacharias.speedometer.Speedometer.MOD_ID;
|
import static me.zacharias.speedometer.Speedometer.MOD_ID;
|
||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
private static JSONObject Config;
|
private static JSONObject config;
|
||||||
public static final float configVersion = 3f;
|
public static final float configVersion = 3f;
|
||||||
|
private static int counter = 0;
|
||||||
|
|
||||||
public static void initialize(){
|
public static void initialize(){
|
||||||
if(Config != null) throw new RuntimeException("Already Initialized");
|
if(config != null) throw new RuntimeException("Already Initialized");
|
||||||
File config = new File(Platform.getConfigFolder().toString()+"/"+MOD_ID+"/config.json");
|
File configFile = new File(Platform.getConfigFolder().toString()+"/"+MOD_ID+"/config.json");
|
||||||
if(!config.exists()){
|
if(!configFile.exists()){
|
||||||
try {
|
try {
|
||||||
config.getParentFile().mkdir();
|
configFile.getParentFile().mkdir();
|
||||||
config.createNewFile();
|
configFile.createNewFile();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
Config = new JSONObject();
|
config = new JSONObject();
|
||||||
|
|
||||||
defualt();
|
defualt();
|
||||||
}else {
|
}else {
|
||||||
try {
|
try {
|
||||||
BufferedReader in = new BufferedReader(new FileReader(config));
|
BufferedReader in = new BufferedReader(new FileReader(configFile));
|
||||||
String tmp;
|
String tmp;
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
while((tmp = in.readLine()) != null){
|
while((tmp = in.readLine()) != null){
|
||||||
builder.append(tmp);
|
builder.append(tmp);
|
||||||
}
|
}
|
||||||
Config = new JSONObject(builder.toString());
|
config = new JSONObject(builder.toString());
|
||||||
if(Config.has("version")){
|
if(config.has("version")){
|
||||||
if(Config.getFloat("version")!=configVersion){
|
if(config.getFloat("version")!=configVersion){
|
||||||
if(Config.getFloat("version") > configVersion){
|
if(config.getFloat("version") > configVersion){
|
||||||
defualt();
|
defualt();
|
||||||
|
|
||||||
save();
|
save();
|
||||||
}else if(Config.getFloat("version") < configVersion){
|
}else if(config.getFloat("version") < configVersion){
|
||||||
Config = new JSONObject();
|
config = new JSONObject();
|
||||||
|
|
||||||
defualt();
|
defualt();
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
Config = new JSONObject();
|
config = new JSONObject();
|
||||||
defualt();
|
defualt();
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
@@ -60,53 +61,48 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void defualt() {
|
private static void defualt() {
|
||||||
if(!Config.has("speed")) {
|
if(!config.has("speed")) {
|
||||||
Config.put("speed", SpeedTypes.BlockPS);
|
config.put("speed", SpeedTypes.BlockPS);
|
||||||
}
|
}
|
||||||
if(!Config.has("useKnot")) {
|
if(!config.has("useKnot")) {
|
||||||
Config.put("useKnot", false);
|
config.put("useKnot", false);
|
||||||
}
|
}
|
||||||
if(!Config.has("color")) {
|
if(!config.has("color")) {
|
||||||
Config.put("color", new JSONObject()
|
config.put("color", new JSONObject()
|
||||||
.put("r", 16)
|
.put("r", 16)
|
||||||
.put("g", 146)
|
.put("g", 146)
|
||||||
.put("b", 158)
|
.put("b", 158)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(!Config.has("visualSpeedometer")) {
|
if(!config.has("visualSpeedometer")) {
|
||||||
Config.put("visualSpeedometer", false);
|
config.put("visualSpeedometer", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(!Config.has("xPositionVisual")) {
|
if(!config.has("xPosition")) {
|
||||||
Config.put("xPositionVisual", "W-3");
|
config.put("xPosition", "W-3");
|
||||||
}
|
}
|
||||||
if(!Config.has("yPositionVisual")) {
|
if(!config.has("yPosition")) {
|
||||||
Config.put("yPositionVisual", "H-3");
|
config.put("yPosition", "H-3");
|
||||||
}
|
|
||||||
if(!Config.has("xPositionText")) {
|
|
||||||
Config.put("xPositionText", "W-3");
|
|
||||||
}
|
|
||||||
if(!Config.has("yPositionText")) {
|
|
||||||
Config.put("yPositionText", "H-3");
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(!Config.has("xPosition")) {
|
|
||||||
Config.put("xPosition", "W-3");
|
|
||||||
}
|
|
||||||
if(!Config.has("yPosition")) {
|
|
||||||
Config.put("yPosition", "H-3");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Config.has("debug")) {
|
if(!config.has("debug")) {
|
||||||
Config.put("debug", false);
|
config.put("debug", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Config.has("imagSize")) {
|
if(!config.has("imagSize")) {
|
||||||
Config.put("imageSize", 19);
|
config.put("imageSize", 19);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Config.has("version")) {
|
if(!config.has("version")) {
|
||||||
Config.put("version", configVersion);
|
config.put("version", configVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!config.has("showVisualSpeedType")){
|
||||||
|
config.put("showVisualSpeedType", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!config.has("showSpeedType")){
|
||||||
|
config.put("showSpeedType", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,33 +118,34 @@ public class Config {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
BufferedWriter out = new BufferedWriter(new FileWriter(config));
|
BufferedWriter out = new BufferedWriter(new FileWriter(config));
|
||||||
out.write(Config.toString(4));
|
out.write(Config.config.toString(4));
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
counter=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SpeedTypes getSpeedType(){
|
public static SpeedTypes getSpeedType(){
|
||||||
if(Config.has("speed")){
|
if(config.has("speed")){
|
||||||
return Config.getEnum(SpeedTypes.class, "speed");
|
return config.getEnum(SpeedTypes.class, "speed");
|
||||||
}else{
|
}else{
|
||||||
return SpeedTypes.BlockPS;
|
return SpeedTypes.BlockPS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getUseKnot() {
|
public static boolean getUseKnot() {
|
||||||
if(Config.has("useKnot")){
|
if(config.has("useKnot")){
|
||||||
return Config.getBoolean("useKnot");
|
return config.getBoolean("useKnot");
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Color getColor(){
|
public static Color getColor(){
|
||||||
if(Config.has("color")){
|
if(config.has("color")){
|
||||||
JSONObject color = Config.getJSONObject("color");
|
JSONObject color = config.getJSONObject("color");
|
||||||
return Color.ofRGB(
|
return Color.ofRGB(
|
||||||
color.getInt("r"),
|
color.getInt("r"),
|
||||||
color.getInt("g"),
|
color.getInt("g"),
|
||||||
@@ -160,78 +157,70 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDebug() {
|
public static boolean isDebug() {
|
||||||
if(Config.has("debug")){
|
if(config.has("debug")){
|
||||||
return Config.getBoolean("debug");
|
return config.getBoolean("debug");
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getVisualSpeedometer(){
|
public static boolean getVisualSpeedometer(){
|
||||||
if(Config.has("visualSpeedometer")){
|
if(config.has("visualSpeedometer")){
|
||||||
return Config.getBoolean("visualSpeedometer");
|
return config.getBoolean("visualSpeedometer");
|
||||||
}else {
|
}else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static String getXPositionVisual(){
|
public static int getCounter(){
|
||||||
if(Config.has("xPositionVisual")) {
|
return counter;
|
||||||
return Config.getString("xPositionVisual");
|
|
||||||
}else{
|
|
||||||
return "W-23";
|
|
||||||
}
|
}
|
||||||
|
public static void addCounter(){
|
||||||
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getYPositionVisual() {
|
|
||||||
if (Config.has("yPositionVisual")) {
|
|
||||||
return Config.getString("yPositionVisual");
|
|
||||||
} else {
|
|
||||||
return "H-23";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static String getXPositionText(){
|
|
||||||
if(Config.has("xPositionText")) {
|
|
||||||
return Config.getString("xPositionText");
|
|
||||||
}else{
|
|
||||||
return "W-70";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getYPositionText(){
|
|
||||||
if(Config.has("yPositionText")) {
|
|
||||||
return Config.getString("yPositionText");
|
|
||||||
}else{
|
|
||||||
return "H-15";
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static String getYPosition(){
|
public static String getYPosition(){
|
||||||
if(Config.has("yPosition")) {
|
if(config.has("yPosition")) {
|
||||||
return Config.getString("yPosition");
|
return config.getString("yPosition");
|
||||||
}else{
|
}else{
|
||||||
return "H-15";
|
return "H-3";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getXPosition(){
|
public static String getXPosition(){
|
||||||
if(Config.has("xPosition")) {
|
if(config.has("xPosition")) {
|
||||||
return Config.getString("xPosition");
|
return config.getString("xPosition");
|
||||||
}else{
|
}else{
|
||||||
return "W-70";
|
return "W-3";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getImageSize(){
|
public static int getImageSize(){
|
||||||
if(Config.has("imageSize")){
|
if(config.has("imageSize")){
|
||||||
return Config.getInt("imageSize");
|
return config.getInt("imageSize");
|
||||||
}else {
|
}else {
|
||||||
return 19;
|
return 19;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean getShowVisualSpeedType() {
|
||||||
|
if(config.has("showVisualSpeedType")){
|
||||||
|
return config.getBoolean("showVisualSpeedType");
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getShowSpeedType(){
|
||||||
|
if(config.has("getShowSpeedType")){
|
||||||
|
return config.getBoolean("showSpeedType");
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void setColor(Color color){
|
public static void setColor(Color color){
|
||||||
Config.put("color", new JSONObject()
|
config.put("color", new JSONObject()
|
||||||
.put("r", color.getRed())
|
.put("r", color.getRed())
|
||||||
.put("g", color.getGreen())
|
.put("g", color.getGreen())
|
||||||
.put("b", color.getBlue())
|
.put("b", color.getBlue())
|
||||||
@@ -239,47 +228,38 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setUseKnot(boolean useKnot){
|
public static void setUseKnot(boolean useKnot){
|
||||||
Config.put("useKnot", useKnot);
|
config.put("useKnot", useKnot);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setSpeedType(SpeedTypes speedType) {
|
public static void setSpeedType(SpeedTypes speedType) {
|
||||||
Config.put("speed", speedType);
|
config.put("speed", speedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setVisualSpeedometer(boolean visualSpeedometer){
|
public static void setVisualSpeedometer(boolean visualSpeedometer){
|
||||||
Config.put("visualSpeedometer", visualSpeedometer);
|
config.put("visualSpeedometer", visualSpeedometer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public static void setXPositionVisual(String xPositionVisual){
|
|
||||||
Config.put("xPositionVisual", xPositionVisual);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setYPositionVisual(String yPositionVisual){
|
|
||||||
Config.put("yPositionVisual", yPositionVisual);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setXPositionText(String xPositionText){
|
|
||||||
Config.put("xPositionText", xPositionText);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setYPositionText(String yPositionText){
|
|
||||||
Config.put("yPositionText", yPositionText);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static void setXPosition(String xPosition){
|
public static void setXPosition(String xPosition){
|
||||||
Config.put("xPosition", xPosition);
|
config.put("xPosition", xPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setYPosition(String yPosition){
|
public static void setYPosition(String yPosition){
|
||||||
Config.put("yPosition", yPosition);
|
config.put("yPosition", yPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setDebug(boolean debug){
|
public static void setDebug(boolean debug){
|
||||||
Config.put("debug", debug);
|
config.put("debug", debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setImageSize(int imageSize){
|
public static void setImageSize(int imageSize){
|
||||||
Config.put("imageSize", imageSize);
|
config.put("imageSize", imageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setShowVisualSpeedType(boolean showVisualSpeedType){
|
||||||
|
config.put("showVisualSpeedType", showVisualSpeedType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setShowSpeedType(boolean showSpeedType){
|
||||||
|
config.put("showSpeedType", showSpeedType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package me.zacharias.speedometer;
|
|||||||
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||||
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
@@ -46,79 +47,6 @@ public class ConfigMenu {
|
|||||||
String xRegex = "W*w*S*s*\\+*-*\\**/*[0-9]*";
|
String xRegex = "W*w*S*s*\\+*-*\\**/*[0-9]*";
|
||||||
String yRegex = "H*h*S*s*\\+*-*\\**/*[0-9]*";
|
String yRegex = "H*h*S*s*\\+*-*\\**/*[0-9]*";
|
||||||
|
|
||||||
// Text Placement
|
|
||||||
/*
|
|
||||||
category.addEntry(entryBuilder.startStringDropdownMenu(Component.translatable("speedometer.config.xPosition.text"), Config.getXPositionText())
|
|
||||||
.setSaveConsumer(Config::setXPositionText)
|
|
||||||
.setErrorSupplier(xPosition -> {
|
|
||||||
if(xPosition.matches(xRegex)){
|
|
||||||
return Optional.empty();
|
|
||||||
}else{
|
|
||||||
return Optional.of(Component.translatable("speedometer.invalid"));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setTooltip(
|
|
||||||
Component.translatable("speedometer.config.tooltip.xPosition.line1"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.xPosition.line2"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.xPosition.line3")
|
|
||||||
)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
|
|
||||||
category.addEntry(entryBuilder.startStringDropdownMenu(Component.translatable("speedometer.config.yPosition.text"), Config.getYPositionText())
|
|
||||||
.setSaveConsumer(Config::setYPositionText)
|
|
||||||
.setErrorSupplier(yPosition -> {
|
|
||||||
if(yPosition.matches(yRegex)){
|
|
||||||
return Optional.empty();
|
|
||||||
}else{
|
|
||||||
return Optional.of(Component.translatable("speedometer.invalid"));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setTooltip(
|
|
||||||
Component.translatable("speedometer.config.tooltip.yPosition.line1"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.yPosition.line2"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.yPosition.line3")
|
|
||||||
)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
|
|
||||||
// Visual location
|
|
||||||
|
|
||||||
category.addEntry(entryBuilder.startStringDropdownMenu(Component.translatable("speedometer.config.xPosition.visual"), Config.getXPositionVisual())
|
|
||||||
.setSaveConsumer(Config::setXPositionVisual)
|
|
||||||
.setErrorSupplier(xPosition -> {
|
|
||||||
if(xPosition.matches(xRegex)){
|
|
||||||
return Optional.empty();
|
|
||||||
}else{
|
|
||||||
return Optional.of(Component.translatable("speedometer.invalid"));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setTooltip(
|
|
||||||
Component.translatable("speedometer.config.tooltip.xPosition.line1"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.xPosition.line2"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.xPosition.line3")
|
|
||||||
)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
category.addEntry(entryBuilder.startStringDropdownMenu(Component.translatable("speedometer.config.yPosition.visual"), Config.getYPositionVisual())
|
|
||||||
.setSaveConsumer(Config::setYPositionVisual)
|
|
||||||
.setErrorSupplier(yPosition -> {
|
|
||||||
if(yPosition.matches(yRegex)){
|
|
||||||
return Optional.empty();
|
|
||||||
}else{
|
|
||||||
return Optional.of(Component.translatable("speedometer.invalid"));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setTooltip(
|
|
||||||
Component.translatable("speedometer.config.tooltip.yPosition.line1"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.yPosition.line2"),
|
|
||||||
Component.translatable("speedometer.config.tooltip.yPosition.line3")
|
|
||||||
)
|
|
||||||
.build()
|
|
||||||
);*/
|
|
||||||
|
|
||||||
category.addEntry(entryBuilder.startStringDropdownMenu(Component.translatable("speedometer.config.xPosition"), Config.getXPosition())
|
category.addEntry(entryBuilder.startStringDropdownMenu(Component.translatable("speedometer.config.xPosition"), Config.getXPosition())
|
||||||
.setSaveConsumer(Config::setXPosition)
|
.setSaveConsumer(Config::setXPosition)
|
||||||
.setErrorSupplier(xPosition -> {
|
.setErrorSupplier(xPosition -> {
|
||||||
@@ -160,6 +88,25 @@ public class ConfigMenu {
|
|||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Show visual speed type
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder.startBooleanToggle(Component.translatable("speedometer.config.showSpeedType"), Config.getShowSpeedType())
|
||||||
|
.setSaveConsumer(Config::setShowSpeedType)
|
||||||
|
.setYesNoTextSupplier(showSpeedType -> Component.translatable("speedometer."+(showSpeedType?"show":"hide")))
|
||||||
|
.setTooltip(Component.translatable("speedometer.config.tooltip.showSpeedType.line1"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder.startBooleanToggle(Component.translatable("speedometer.config.showVisualSpeedType"), Config.getShowVisualSpeedType())
|
||||||
|
.setSaveConsumer(Config::setShowVisualSpeedType)
|
||||||
|
.setYesNoTextSupplier(showVisualSpeedType -> Component.translatable("speedometer."+(showVisualSpeedType?"show":"hide")).withStyle(ChatFormatting.DARK_RED))
|
||||||
|
.setTooltip(Component.translatable("speedometer.config.tooltip.showVisualSpeedType.line1"),
|
||||||
|
Component.translatable("speedometer.config.tooltip.showVisualSpeedType.line2"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
category.addEntry(entryBuilder.startBooleanToggle(Component.translatable("speedometer.config.debug"),Config.isDebug())
|
category.addEntry(entryBuilder.startBooleanToggle(Component.translatable("speedometer.config.debug"),Config.isDebug())
|
||||||
.setSaveConsumer(Config::setDebug)
|
.setSaveConsumer(Config::setDebug)
|
||||||
.setYesNoTextSupplier(isDebug -> Component.translatable("speedometer.debug."+isDebug))
|
.setYesNoTextSupplier(isDebug -> Component.translatable("speedometer.debug."+isDebug))
|
||||||
|
|||||||
@@ -11,4 +11,16 @@ public class ImageHandler {
|
|||||||
g2d.drawImage(img1,0,0,null);
|
g2d.drawImage(img1,0,0,null);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BufferedImage clone(BufferedImage image) {
|
||||||
|
BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
|
||||||
|
Graphics2D g2d = out.createGraphics();
|
||||||
|
for(int x = 0; x < image.getWidth(); x++){
|
||||||
|
for(int y = 0; y < image.getWidth(); y++){
|
||||||
|
g2d.setColor(new Color(image.getRGB(x,y)));
|
||||||
|
g2d.fillRect(x,y,1,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,44 +4,49 @@ import net.minecraft.network.chat.Component;
|
|||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static me.zacharias.speedometer.Speedometer.LOGGER;
|
||||||
|
|
||||||
public enum MeterImages {
|
public enum MeterImages {
|
||||||
LARGE(Component.translatable("speedometer.meter.large"), () -> {
|
LARGE(Component.translatable("speedometer.meter.large"), "/assets/speedometer/meter/meter-115.png", 115),
|
||||||
try {
|
SMALL(Component.translatable("speedometer.meter.small"), "/assets/speedometer/meter/meter-19.png", 19),
|
||||||
return ImageIO.read(Objects.requireNonNull(Speedometer.class.getResourceAsStream("/assets/speedometer/meter/meter-115.png")));
|
MEDIUM(Component.translatable("speedometer.meter.small"), "/assets/speedometer/meter/meter-67.png", 67)
|
||||||
} catch (Exception e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, 115),
|
|
||||||
SMALL(Component.translatable("speedometer.meter.small"), () -> {
|
|
||||||
try {
|
|
||||||
return ImageIO.read(Objects.requireNonNull(Speedometer.class.getResourceAsStream("/assets/speedometer/meter/meter-19.png")));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, 19),
|
|
||||||
MEDIUM(Component.translatable("speedometer.meter.small"), () -> {
|
|
||||||
try {
|
|
||||||
return ImageIO.read(Objects.requireNonNull(Speedometer.class.getResourceAsStream("/assets/speedometer/meter/meter-67.png")));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, 67)
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final Component name;
|
private final Component name;
|
||||||
private final BufferedImage image;
|
private final String meterIcon;
|
||||||
|
private BufferedImage image;
|
||||||
private final int size;
|
private final int size;
|
||||||
|
|
||||||
MeterImages(Component name, Loader icon, int size) {
|
MeterImages(Component name, String meterIcon, int size) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.image = icon.load();
|
|
||||||
this.size = size;
|
this.size = size;
|
||||||
|
this.meterIcon = meterIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean initiate(){
|
||||||
|
if(image != null){
|
||||||
|
LOGGER.warn("Already loaded \""+meterIcon+"\"");
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
LOGGER.info("Loading speedometer \""+meterIcon+"\"");
|
||||||
|
image = ImageIO.read(Objects.requireNonNull(Speedometer.class.getResourceAsStream(meterIcon)));
|
||||||
|
LOGGER.info("Loaded speedometer \""+meterIcon+"\"");
|
||||||
|
return true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
image = new BufferedImage(0,0, BufferedImage.TYPE_INT_ARGB);
|
||||||
|
LOGGER.warn("Failed to load speedometer \""+meterIcon+"\"");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferedImage getImage() {
|
public BufferedImage getImage() {
|
||||||
|
if(image == null){
|
||||||
|
LOGGER.warn("\""+meterIcon+"\" has not ben loaded yet!");
|
||||||
|
}
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,8 +57,4 @@ public enum MeterImages {
|
|||||||
public Component getName() {
|
public Component getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface Loader{
|
|
||||||
BufferedImage load();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class Speedometer
|
|||||||
|
|
||||||
|
|
||||||
if(Platform.getEnvironment() != Env.CLIENT) {
|
if(Platform.getEnvironment() != Env.CLIENT) {
|
||||||
LOGGER.error("You're running speedometer on somthing other then a client, this is not supported");
|
LOGGER.error("You're running speedometer on something other then a client, this is not supported");
|
||||||
try {
|
try {
|
||||||
for (File f : Objects.requireNonNull(Platform.getModsFolder().toFile().listFiles())) {
|
for (File f : Objects.requireNonNull(Platform.getModsFolder().toFile().listFiles())) {
|
||||||
if (f.getName().startsWith("speedometer")) {
|
if (f.getName().startsWith("speedometer")) {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
"speedometer.config.yPosition": "Y Position for Meters",
|
"speedometer.config.yPosition": "Y Position for Meters",
|
||||||
"speedometer.config.debug": "Debug",
|
"speedometer.config.debug": "Debug",
|
||||||
"speedometer.config.imageSize": "Image Size",
|
"speedometer.config.imageSize": "Image Size",
|
||||||
|
"speedometer.config.showVisualSpeedType": "\u00A74⨻\u00A7rShow Visual Speed Type",
|
||||||
|
"speedometer.config.showSpeedType": "Show Visual Speed Type",
|
||||||
|
|
||||||
"speedometer.key.configKey": "Config Key",
|
"speedometer.key.configKey": "Config Key",
|
||||||
"speedometer.key.debugKey": "Debug Key",
|
"speedometer.key.debugKey": "Debug Key",
|
||||||
@@ -38,6 +40,9 @@
|
|||||||
"speedometer.debug.true": "\u00A74Yes",
|
"speedometer.debug.true": "\u00A74Yes",
|
||||||
"speedometer.debug.false": "\u00A74No",
|
"speedometer.debug.false": "\u00A74No",
|
||||||
|
|
||||||
|
"speedometer.show": "Show",
|
||||||
|
"speedometer.hide": "Hide",
|
||||||
|
|
||||||
"speedometer.config.tooltip.xPosition.line1": "W = the width of the screen",
|
"speedometer.config.tooltip.xPosition.line1": "W = the width of the screen",
|
||||||
"speedometer.config.tooltip.xPosition.line2": "w = half the width of the screen",
|
"speedometer.config.tooltip.xPosition.line2": "w = half the width of the screen",
|
||||||
"speedometer.config.tooltip.xPosition.line3": "s = the width of the text or image",
|
"speedometer.config.tooltip.xPosition.line3": "s = the width of the text or image",
|
||||||
@@ -50,5 +55,10 @@
|
|||||||
|
|
||||||
"speedometer.config.tooltip.imageSize": "Size of the image. This sets both the height and width",
|
"speedometer.config.tooltip.imageSize": "Size of the image. This sets both the height and width",
|
||||||
|
|
||||||
|
"speedometer.config.tooltip.showVisualSpeedType.line1": "This setting doesn't work fully.",
|
||||||
|
"speedometer.config.tooltip.showVisualSpeedType.line2": "I(the developer) discourages the use of this setting since it doesn't work on smaller sises and the fps breaks at larger",
|
||||||
|
|
||||||
|
"speedometer.config.tooltip.showSpeedType.line1": "This setting shows the speed type above the visual meter which is better then within the visual meter",
|
||||||
|
|
||||||
"speedometer.invalid": "Invalid String"
|
"speedometer.invalid": "Invalid String"
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
"3.0": "Added size setting for visual speedometer, changed how the visual speedometer location is set",
|
"3.0": "Added size setting for visual speedometer, changed how the visual speedometer location is set",
|
||||||
"3.1": "Fixed error in language file",
|
"3.1": "Fixed error in language file",
|
||||||
"3.2": "Correct checker for Client or Server environment, updated dependencies, added dependency check in mod data file, added a renamer to rename the mod file if it's on a server",
|
"3.2": "Correct checker for Client or Server environment, updated dependencies, added dependency check in mod data file, added a renamer to rename the mod file if it's on a server",
|
||||||
"4.0": "Removed the Size part of the position string, combined the visual and text location strings, updated config version to 3, fixed bug where the text would start to drift of screen if you where too fast"
|
"4.0": "Removed the Size part of the position string, combined the visual and text location strings, updated config version to 3, fixed bug where the text would start to drift of screen if you where too fast",
|
||||||
|
"5.0": "Visual speed display has been added",
|
||||||
|
"5.1": "Added second speed display"
|
||||||
},
|
},
|
||||||
"1.20": {
|
"1.20": {
|
||||||
"1.0": "First version",
|
"1.0": "First version",
|
||||||
@@ -14,13 +16,15 @@
|
|||||||
"3.0": "Added size setting for visual speedometer, changed how the visual speedometer location is set",
|
"3.0": "Added size setting for visual speedometer, changed how the visual speedometer location is set",
|
||||||
"3.1": "Fixed error in language file",
|
"3.1": "Fixed error in language file",
|
||||||
"3.2": "Correct checker for Client or Server environment, updated dependencies, added dependency check in mod data file, added a renamer to rename the mod file if it's on a server",
|
"3.2": "Correct checker for Client or Server environment, updated dependencies, added dependency check in mod data file, added a renamer to rename the mod file if it's on a server",
|
||||||
"4.0": "Removed the Size part of the position string, combined the visual and text location strings, updated config version to 3, fixed bug where the text would start to drift of screen if you where too fast"
|
"4.0": "Removed the Size part of the position string, combined the visual and text location strings, updated config version to 3, fixed bug where the text would start to drift of screen if you where too fast",
|
||||||
|
"5.0": "Visual speed display has been added",
|
||||||
|
"5.1": "Added second speed display"
|
||||||
},
|
},
|
||||||
"promos": {
|
"promos": {
|
||||||
"1.20.1-latest": "4.0",
|
"1.20.1-latest": "5.1",
|
||||||
"1.20.1-recommended": "4.0",
|
"1.20.1-recommended": "5.1",
|
||||||
|
|
||||||
"1.20-latest": "4.0",
|
"1.20-latest": "5.1",
|
||||||
"1.20-recommended": "4.0"
|
"1.20-recommended": "5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx8G
|
|||||||
minecraft_version=1.20.1
|
minecraft_version=1.20.1
|
||||||
|
|
||||||
archives_base_name=speedometer
|
archives_base_name=speedometer
|
||||||
mod_version=4
|
mod_version=5.1
|
||||||
maven_group=me.zacharias
|
maven_group=me.zacharias
|
||||||
|
|
||||||
architectury_version=9.1.10
|
architectury_version=9.1.10
|
||||||
|
|||||||
17
readme.md
17
readme.md
@@ -1,7 +1,22 @@
|
|||||||
# Speedometer
|
# Speedometer
|
||||||
This is a simple mod for forge and fabric that displays your current speed
|
This is a simple mod for forge and fabric that displays your current speed
|
||||||
|
|
||||||
This mod is a newer version of [speedometer-forge](https://github.com/zaze06/speedometer-forge)
|
## Credits to
|
||||||
|
[org.json](https://www.json.org/json-en.html) *Included due to problems whit ForgeGradle*
|
||||||
|
|
||||||
|
## Compile your own version?
|
||||||
|
1. Download source code
|
||||||
|
* Run `git clone https://github.com/zaze06/Speedometer`
|
||||||
|
* Download the source code from GitHub page [master.zip](https://github.com/zaze06/Speedometer/archive/refs/heads/master.zip)
|
||||||
|
* unzip the folder
|
||||||
|
2. Open the folder
|
||||||
|
3. Run `gradlew build`(Windows cmd) or `./gradlew build`(Linux, MacOS, Windows powershell)
|
||||||
|
4. the compiled version will be in
|
||||||
|
* Fabic: `fabric/build/libs`
|
||||||
|
* Forge: `forge/build/libs`
|
||||||
|
|
||||||
|
|
||||||
|
# This mod is a newer version of [speedometer-forge](https://github.com/zaze06/speedometer-forge)
|
||||||
|
|
||||||
## Changes from old forge version?
|
## Changes from old forge version?
|
||||||
This was just a project I choose for trying the Architectury API for abstraction.
|
This was just a project I choose for trying the Architectury API for abstraction.
|
||||||
|
|||||||
Reference in New Issue
Block a user