Skip to content

Commit

Permalink
refactor(common): store item rendering instead rendering flag
Browse files Browse the repository at this point in the history
chore(common): specify specific deploy repository (github)
  • Loading branch information
flowerinsnowdh committed Dec 10, 2024
1 parent 85fa007 commit 55a5e08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
8 changes: 4 additions & 4 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins() {
}

group = 'cn.flowerinsnow.greatscrollabletooltips'
version = '1.1.0'
version = '1.2.0'

repositories() {
mavenCentral()
Expand Down Expand Up @@ -48,10 +48,10 @@ publishing() {
mavenJava(MavenPublication) {
repositories() {
maven() {
url = "${System.getenv('PUBLISH_REPO_URL')}"
url = 'https://maven.pkg.github.com/flowerinsnowdh/GreatScrollableTooltips'
credentials() {
username = "${System.getenv('PUBLISH_REPO_USERNAME')}"
password = "${System.getenv('PUBLISH_REPO_PASSWORD')}"
username = "${System.getenv('GITHUB_USERNAME')}"
password = "${System.getenv('GITHUB_TOKEN')}"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8

# Dependencies
night_config_version=3.8.1
junit_version=5.11.0
junit_version=5.11.3
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ public class ScrollSession<I> {
* <p>当前水平滚动值</p>
*/
private int vertical;
/**
* <p>本 tick 是否渲染中</p>
*/
private boolean rendering;

/**
* <p>最后一次渲染的物品</p>
Expand Down Expand Up @@ -51,11 +47,7 @@ public void addVertical(int value) {
}

public boolean isRendering() {
return this.rendering;
}

public void setRendering(boolean rendering) {
this.rendering = rendering;
return this.lastItemStackRendered != null;
}

public I getLastItemStackRendered() {
Expand All @@ -79,15 +71,14 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ScrollSession<?> that = (ScrollSession<?>) o;
return this.horizontal == that.horizontal && this.vertical == that.vertical && this.rendering == that.rendering && Objects.equals(this.lastItemStackRendered, that.lastItemStackRendered);
return this.horizontal == that.horizontal && this.vertical == that.vertical && Objects.equals(this.lastItemStackRendered, that.lastItemStackRendered);
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.horizontal;
result = 31 * result + this.vertical;
result = 31 * result + (this.rendering ? 1231 : 1237);
result = 31 * result + (this.lastItemStackRendered != null ? this.lastItemStackRendered.hashCode() : 0);
return result;
}
Expand All @@ -97,7 +88,6 @@ public String toString() {
return "ScrollSession{" +
"horizontal=" + this.horizontal +
", vertical=" + this.vertical +
", rendering=" + this.rendering +
", lastItemStackRendered=" + this.lastItemStackRendered +
'}';
}
Expand Down

0 comments on commit 55a5e08

Please sign in to comment.