Skip to content

Commit 3aacec1

Browse files
committed
[6.0.10][publish] remove equals & hashCode in ItemTag
1 parent db2903f commit 3aacec1

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

module/module-nms-util/src/main/java/taboolib/module/nms/ItemTag.java

+15-16
Original file line numberDiff line numberDiff line change
@@ -314,22 +314,21 @@ public ItemTagData merge(String key, @NotNull ItemTagData value, @NotNull BiFunc
314314
return this.value.merge(key, value, remappingFunction);
315315
}
316316

317-
@Override
318-
public boolean equals(Object o) {
319-
if (this == o) {
320-
return true;
321-
}
322-
if (!(o instanceof ItemTag)) {
323-
return false;
324-
}
325-
ItemTag that = (ItemTag) o;
326-
return Objects.equals(value, that.value);
327-
}
328-
329-
@Override
330-
public int hashCode() {
331-
return Objects.hash(super.hashCode(), value);
332-
}
317+
// @Override
318+
// public boolean equals(Object o) {
319+
// if (this == o) return true;
320+
// if (!(o instanceof ItemTag)) return false;
321+
// if (!super.equals(o)) return false;
322+
// ItemTag itemTag = (ItemTag) o;
323+
// return Objects.equals(value, itemTag.value);
324+
// }
325+
//
326+
// @Override
327+
// public int hashCode() {
328+
// int result = super.hashCode();
329+
// result = 31 * result + (value != null ? value.hashCode() : 0);
330+
// return result;
331+
// }
333332

334333
@Override
335334
public String toString() {

module/module-nms-util/src/main/java/taboolib/module/nms/ItemTagData.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,22 @@ public static ItemTag translateSection(ItemTag nbt, ConfigurationSection section
209209
return nbt;
210210
}
211211

212-
@Override
213-
public boolean equals(Object o) {
214-
if (this == o) {
215-
return true;
216-
}
217-
if (!(o instanceof ItemTagData)) {
218-
return false;
219-
}
220-
ItemTagData itemTagData = (ItemTagData) o;
221-
return getType() == itemTagData.getType() && Objects.equals(data, itemTagData.data);
222-
}
223-
224-
@Override
225-
public int hashCode() {
226-
return Objects.hash(getType(), data);
227-
}
212+
// @Override
213+
// public boolean equals(Object o) {
214+
// if (this == o) return true;
215+
// if (!(o instanceof ItemTagData)) return false;
216+
// ItemTagData that = (ItemTagData) o;
217+
// if (getType() != that.getType()) return false;
218+
// if (data != null ? !data.equals(that.data) : that.data != null) return false;
219+
// return true;
220+
// }
221+
//
222+
// @Override
223+
// public int hashCode() {
224+
// int result = getType() != null ? getType().hashCode() : 0;
225+
// result = 31 * result + (data != null ? data.hashCode() : 0);
226+
// return result;
227+
// }
228228

229229
@Override
230230
public String toString() {

0 commit comments

Comments
 (0)