Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
compileOnly 'org.apache.logging.log4j:log4j-api:2.0-beta9'
compileOnly 'org.apache.logging.log4j:log4j-core:2.0-beta9'

library "com.github.MPKMod.MPKNetworkAPI:common:1.0.0"
library "com.github.MPKMod.MPKNetworkAPI:common:${project.networkApiVersion}"
}

compileJava.doLast {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class Player {
public int[] deltaMouseY = null;
public int airtime = 0;
public Float last45 = null;
public int grinds = 0;
public boolean grindTick = false;
public boolean jumpTick = false;
public boolean landTick = false;
public String lastTiming = "None";
Expand Down Expand Up @@ -217,6 +219,11 @@ public String getLastTiming() {
return lastTiming;
}

@InfoString.Getter
public int getGrinds() {
return grinds;
}

@SuppressWarnings("UnusedReturnValue")
public Player buildAndSave() {
Player prev = getLatest();
Expand Down Expand Up @@ -269,6 +276,17 @@ public Player buildAndSave() {

lastTiming = TimingStorage.match(getInputHistory());

//Grinds
grinds = prev.grinds;
grindTick = jumpTick && pos.getY() == prev.pos.getY() && motion.getY() == (-0.08 * 0.98F);

if (grindTick) {
if (prev.getPrevious().grindTick)
grinds++;
else
grinds = 1;
}

//Blip
lastBlip = prev.lastBlip;
if (onGround && !prev.onGround && pos.getY() == prev.pos.getY() && !prev.jumpTick) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ public double dot(Vector2D other) {
return x * other.x + y * other.y;
}

public Vector2D normalize() {
double len = length();
if (len == 0) return ZERO;
return new Vector2D(x / len, y / len);
}

/**
* @param pos1 top left corner
* @param pos2 bottom right corner
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.21.6/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

implementation "com.github.MPKMod.MPKNetworkAPI:common:1.0.0"
implementation "com.github.MPKMod.MPKNetworkAPI:common:${project.networkApiVersion}"
}

processResources {
Expand Down
2 changes: 1 addition & 1 deletion forge-1.8.9/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ unimined.minecraft {
}

dependencies {
implementation "com.github.MPKMod.MPKNetworkAPI:common:1.0.0"
implementation "com.github.MPKMod.MPKNetworkAPI:common:${project.networkApiVersion}"
}

processResources {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ $modBaseName=mpkmod
$commonBaseName=mpkmod-common
$vendor=kurrycat

networkApiVersion=1.0.1

org.gradle.jvmargs=-Xmx4096m