Compare commits

..

No commits in common. "master" and "11-Readonly_Database" have entirely different histories.

4 changed files with 17 additions and 36 deletions

View file

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.7-SNAPSHOT'
}
sourceCompatibility = JavaVersion.VERSION_1_8
@ -24,11 +24,12 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
//include group: 'org.postgresql', name: 'postgresql', version: '42.2.9'
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
include group: 'mysql', name: 'mysql-connector-java', version: "${project.jdbc_mysql}"
implementation group: 'mysql', name: 'mysql-connector-java', version: "${project.jdbc_mysql}"
//implementation(include('mysql:mysql-connector-java:8.0.25'))
include group: 'mysql', name: 'mysql-connector-java', version: '8.0.25'
implementation group: 'mysql', name: 'mysql-connector-java', version: '8.0.25'
//modImplementation(group: 'mysql', name: 'mysql-connector-java', version: '8.0.25')
include group: 'com.googlecode.json-simple', name: 'json-simple', version: "${project.json_simple}"
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: "${project.json_simple}"
include group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

View file

@ -4,19 +4,14 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.10
loader_version=0.12.11
yarn_mappings=1.16.5+build.9
loader_version=0.11.3
# Mod Properties
mod_version = 1.1.3
mod_version = 1.1.0
maven_group = net.saltymc.eaa
archives_base_name = EAA_MOD
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api (or https://fabricmc.net/versions.html)
fabric_version=0.42.0+1.16
#SQL
jdbc_mysql=8.0.27
#JSON
json_simple=1.1.1
fabric_version=0.34.2+1.16

View file

@ -163,21 +163,12 @@ public final class CustomPlayerListHud {
/*
* PLAYER TAG
*/
int offset_tag_playername = aa; // safe current x offset ->
TagDTO playerTAG = TagFunction.getScoreboardTag(player.getProfile().getId().toString()); // retrieve Tag object
mc.textRenderer.drawWithShadow(stack, playerTAG.getType().getTag(), (float)aa, (float)ab, playerTAG.getType().getColor()); // draw tag name
offset_tag_playername += mc.textRenderer.getWidth(playerTAG.getType().getTag()) + 1; // add tag name length to offset
// current offset plus amount to center grade text
float tmp_x = offset_tag_playername
+ ((mc.textRenderer.getWidth("10") - mc.textRenderer.getWidth(playerTAG.getGrade() < 1 ? "|" : playerTAG.getGrade() +""))
/ 2.0f);
mc.textRenderer.drawWithShadow(stack,
playerTAG.getGrade() < 1 ? "|" : playerTAG.getGrade() +"", // if not given draw a pipe
(float) tmp_x, (float) ab, playerTAG.getGradeColor());
offset_tag_playername += mc.textRenderer.getWidth("10") + 2; // add offset of largest character
int offset_tag_playername = aa;
TagDTO playerTAG = TagFunction.getScoreboardTag(player.getProfile().getId().toString());
mc.textRenderer.drawWithShadow(stack, playerTAG.getType().getTag(), (float)aa, (float)ab, playerTAG.getType().getColor());
offset_tag_playername += mc.textRenderer.getWidth(playerTAG.getType().getTag()) + 1;
mc.textRenderer.drawWithShadow(stack,"|", (float) offset_tag_playername, (float) ab, playerTAG.getGradeColor());
offset_tag_playername += mc.textRenderer.getWidth("|") + 2;
Text playerName = hud.getPlayerName(player);

View file

@ -5,12 +5,10 @@ import net.saltymc.eaa.util.database.DB_Tag;
import static net.saltymc.eaa.custom.ping.PingColors.computeOffset;
public class TagDTO {
final int grade;
final int gradeColor;
final DB_Tag.Type type;
public TagDTO(int grade, DB_Tag.Type type) {
this.grade = grade;
this.gradeColor = calcGradient(grade, type);
this.type = type;
}
@ -32,8 +30,4 @@ public class TagDTO {
type.getColor(),
computeOffset(0, 10, grade));
}
public int getGrade(){
return grade;
}
}