mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-13 22:25:53 +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 java.time.Duration;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
final class BlockImpl implements Block {
|
||||
@ -142,6 +139,23 @@ final class BlockImpl implements Block {
|
||||
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
|
||||
public String toString() {
|
||||
return name() + "{" +
|
||||
|
Loading…
Reference in New Issue
Block a user