-
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.
- fixed IA compatibility - added NBT support - added ItemUtils#compare(...) methods
- Loading branch information
1 parent
bb4b80e
commit 5ecccd1
Showing
19 changed files
with
86 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# | ||
# PowerLib v1.2.13-SNAPSHOT | ||
# PowerLib v1.2.14-SNAPSHOT | ||
# | ||
check-for-updates: true |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: PowerLib | ||
authors: [AlbeMiglio, FranFrau] | ||
main: it.mycraft.powerlib.bukkit.PowerLibPlugin | ||
version: 1.2.13-SNAPSHOT | ||
version: 1.2.14-SNAPSHOT |
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
26 changes: 26 additions & 0 deletions
26
bukkit/src/main/java/it/mycraft/powerlib/bukkit/item/ItemUtils.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,26 @@ | ||
package it.mycraft.powerlib.bukkit.item; | ||
|
||
import de.tr7zw.changeme.nbtapi.NBTItem; | ||
import dev.lone.itemsadder.api.CustomStack; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.Material; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class ItemUtils { | ||
|
||
public static boolean compare(ItemStack i1, ItemStack i2, boolean ignoreAmount) { | ||
if (i1 == null || i2 == null || i1.getType() == Material.AIR || i2.getType() == Material.AIR) return false; | ||
if (i1 == i2) return true; | ||
if ((i1.getAmount() != i2.getAmount()) && !(ignoreAmount)) return false; | ||
Material comparisonType = (i1.getType().isLegacy()) ? Bukkit.getUnsafe().fromLegacy(i1.getData(), true) : i1.getType(); | ||
return comparisonType == i2.getType() | ||
&& i1.getDurability() == i2.getDurability() | ||
&& i1.hasItemMeta() == i2.hasItemMeta() | ||
&& new NBTItem(i1).getCompound().equals(new NBTItem(i2).getCompound()); | ||
} | ||
|
||
public static boolean compare(ItemStack i1, ItemStack i2) { | ||
return compare(i1, i2, true); | ||
} | ||
} |
31 changes: 0 additions & 31 deletions
31
bukkit/src/main/java/it/mycraft/powerlib/bukkit/item/PersistentDataTypes.java
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# | ||
# PowerLib v1.2.13-SNAPSHOT | ||
# PowerLib v1.2.14-SNAPSHOT | ||
# | ||
check-for-updates: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
{"id":"powerlib","name":"PowerLib","version":"1.2.13-SNAPSHOT","authors":["AlbeMiglio","FranFrau"], | ||
{"id":"powerlib","name":"PowerLib","version":"1.2.14-SNAPSHOT","authors":["AlbeMiglio","FranFrau"], | ||
"dependencies":[],"main":"it.mycraft.powerlib.velocity.PowerLibPlugin"} |
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