-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 1.7.6: Human readable container inventory interaction logs
- Loading branch information
Showing
6 changed files
with
115 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/server/java/com/kiva/kivaserverutils/ItemStackWithoutStackSize.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.kiva.kivaserverutils; | ||
|
||
import net.minecraft.src.game.item.ItemStack; | ||
import net.minecraft.src.game.nbt.NBTTagCompound; | ||
|
||
import java.util.Objects; | ||
|
||
public class ItemStackWithoutStackSize { | ||
public int itemID; | ||
public int itemDamage; | ||
public NBTTagCompound nbtTagCompound; | ||
private final int hashCode; | ||
|
||
public ItemStackWithoutStackSize(ItemStack itemStack) { | ||
this.itemID = itemStack.itemID; | ||
this.itemDamage = itemStack.itemDamage; | ||
this.nbtTagCompound = itemStack.nbtTagCompound; | ||
this.hashCode = Objects.hash(this.itemID, this.itemDamage, this.nbtTagCompound); | ||
} | ||
|
||
public ItemStack asItemStack(int withStackSize) { | ||
return new ItemStack(this.itemID, withStackSize, this.itemDamage, this.nbtTagCompound); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null || getClass() != obj.getClass()) | ||
return false; | ||
|
||
ItemStackWithoutStackSize that = (ItemStackWithoutStackSize) obj; | ||
return itemID == that.itemID && itemDamage == that.itemDamage && nbtTagCompound == that.nbtTagCompound; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return this.hashCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters