diff --git a/common/build.gradle b/common/build.gradle index 878a44c..fd99941 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -4,7 +4,7 @@ plugins() { } group = 'cn.flowerinsnow.greatscrollabletooltips' -version = '1.1.0' +version = '1.2.0' repositories() { mavenCentral() diff --git a/common/gradle.properties b/common/gradle.properties index 72b516f..e8d92f7 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8 # Dependencies night_config_version=3.8.1 -junit_version=5.11.0 \ No newline at end of file +junit_version=5.11.3 \ No newline at end of file diff --git a/common/src/main/java/cn/flowerinsnow/greatscrollabletooltips/common/object/ScrollSession.java b/common/src/main/java/cn/flowerinsnow/greatscrollabletooltips/common/object/ScrollSession.java index 745ccb5..8f792e9 100644 --- a/common/src/main/java/cn/flowerinsnow/greatscrollabletooltips/common/object/ScrollSession.java +++ b/common/src/main/java/cn/flowerinsnow/greatscrollabletooltips/common/object/ScrollSession.java @@ -16,12 +16,12 @@ public class ScrollSession { */ private int vertical; /** - *
本 tick 是否渲染中
+ *当前正在渲染的物品堆
*/ - private boolean rendering; + private I itemStackRendering; /** - *最后一次渲染的物品
+ *上一次渲染的物品堆
*记录以方便判断是否要回正
*/ private I lastItemStackRendered; @@ -50,12 +50,16 @@ public void addVertical(int value) { this.vertical += value; } - public boolean isRendering() { - return this.rendering; + public boolean isItemStackRendering() { + return this.itemStackRendering != null; } - public void setRendering(boolean rendering) { - this.rendering = rendering; + public I getItemStackRendering() { + return this.itemStackRendering; + } + + public void setItemStackRendering(I itemStackRendering) { + this.itemStackRendering = itemStackRendering; } public I getLastItemStackRendered() { @@ -79,7 +83,7 @@ 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.itemStackRendering, that.itemStackRendering) && Objects.equals(this.lastItemStackRendered, that.lastItemStackRendered); } @Override @@ -87,7 +91,7 @@ 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.itemStackRendering != null ? this.itemStackRendering.hashCode() : 0); result = 31 * result + (this.lastItemStackRendered != null ? this.lastItemStackRendered.hashCode() : 0); return result; } @@ -97,7 +101,7 @@ public String toString() { return "ScrollSession{" + "horizontal=" + this.horizontal + ", vertical=" + this.vertical + - ", rendering=" + this.rendering + + ", itemStackRendering=" + this.itemStackRendering + ", lastItemStackRendered=" + this.lastItemStackRendered + '}'; }