Files
Postea/src/main/java/com/myname/mymodid/API/ItemStackKey.java
T

38 lines
798 B
Java
Raw Normal View History

2023-10-21 21:25:10 +01:00
package com.myname.mymodid.API;
2023-10-21 19:28:34 +01:00
2023-10-21 20:49:33 +01:00
import cpw.mods.fml.common.registry.RegistryDelegate;
import net.minecraft.item.Item;
2023-10-21 19:28:34 +01:00
import java.util.Objects;
public class ItemStackKey {
2023-10-21 20:49:33 +01:00
private final Item item;
2023-10-21 19:28:34 +01:00
private final int meta;
2023-10-21 20:49:33 +01:00
public ItemStackKey(Item item, int meta) {
this.item = item;
2023-10-21 19:28:34 +01:00
this.meta = meta;
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
ItemStackKey that = (ItemStackKey) o;
2023-10-21 20:49:33 +01:00
return (this.meta == that.meta) && Objects.equals(this.item, that.item);
2023-10-21 19:28:34 +01:00
}
@Override
public int hashCode() {
2023-10-21 20:49:33 +01:00
return Objects.hash(item, meta);
}
public int getDamage() {
return meta;
}
2023-10-21 21:25:10 +01:00
public Item getItem() {
return item;
2023-10-21 19:28:34 +01:00
}
}