mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Implements #equals for BlockImpl
This commit is contained in:
parent
be07fdb647
commit
35d63ae547
@ -13,10 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Collection;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
final class BlockImpl implements Block {
|
final class BlockImpl implements Block {
|
||||||
@ -142,6 +139,23 @@ final class BlockImpl implements Block {
|
|||||||
return nbt != null ? tag.read(nbt) : null;
|
return nbt != null ? tag.read(nbt) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
BlockImpl block = (BlockImpl) o;
|
||||||
|
return registry.equals(block.registry) &&
|
||||||
|
propertyEntry.equals(block.propertyEntry) &&
|
||||||
|
properties.equals(block.properties) &&
|
||||||
|
Objects.equals(nbt, block.nbt) &&
|
||||||
|
Objects.equals(handler, block.handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(registry, propertyEntry, properties, nbt, handler);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name() + "{" +
|
return name() + "{" +
|
||||||
|
Loading…
Reference in New Issue
Block a user