Add item lore data for special stats.
Adds spawn egg drop chance Adds custom enchantment
This commit is contained in:
parent
28c60f3a53
commit
e7e08902f0
17 changed files with 408 additions and 68 deletions
|
@ -0,0 +1,28 @@
|
|||
package dev.zontreck.otemod.items.tags;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
public class ItemStatTag {
|
||||
public static final String STATS_TAG = "stat";
|
||||
public ItemStatType type;
|
||||
public int value;
|
||||
|
||||
public ItemStatTag(ItemStatType t, int tag)
|
||||
{
|
||||
type = t;
|
||||
value = tag;
|
||||
}
|
||||
|
||||
public void increment(){
|
||||
value++;
|
||||
}
|
||||
public void decrement()
|
||||
{
|
||||
value--;
|
||||
}
|
||||
|
||||
public void save(CompoundTag tag)
|
||||
{
|
||||
tag.putInt(STATS_TAG+"_"+type.name().toLowerCase(), value);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package dev.zontreck.otemod.items.tags;
|
||||
|
||||
public enum ItemStatType {
|
||||
SWORD,
|
||||
ARMOR,
|
||||
PICK,
|
||||
AXE,
|
||||
SHOVEL,
|
||||
SHOVELPATH,
|
||||
HOE,
|
||||
SHEARS
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package dev.zontreck.otemod.items.tags;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
|
||||
public class ItemStatistics {
|
||||
|
||||
public static String makeText(ItemStatTag tag)
|
||||
{
|
||||
return makeText(tag.type, tag.value);
|
||||
}
|
||||
public static String makeText(ItemStatType type, int val)
|
||||
{
|
||||
String lore = ChatColor.doColors("!White!");
|
||||
switch(type)
|
||||
{
|
||||
case SWORD -> {
|
||||
lore += "Mobs Killed: ";
|
||||
}
|
||||
case PICK -> {
|
||||
lore += "Blocks Mined: ";
|
||||
}
|
||||
case ARMOR -> {
|
||||
lore += "Damage Taken: ";
|
||||
}
|
||||
case SHOVEL -> {
|
||||
lore += "Blocks Dug Up: ";
|
||||
}
|
||||
case SHOVELPATH -> {
|
||||
lore += "Paths Made: ";
|
||||
}
|
||||
case AXE -> {
|
||||
lore += "Wood Chopped: ";
|
||||
}
|
||||
case HOE -> {
|
||||
lore += "Blocks Hoed: ";
|
||||
}
|
||||
case SHEARS -> {
|
||||
lore += "Sheep Shaved: ";
|
||||
}
|
||||
}
|
||||
lore += ChatColor.doColors("!Green!"+val);
|
||||
return lore;
|
||||
}
|
||||
}
|
22
src/main/java/dev/zontreck/otemod/items/tags/ModIDs.java
Normal file
22
src/main/java/dev/zontreck/otemod/items/tags/ModIDs.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package dev.zontreck.otemod.items.tags;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public enum ModIDs {
|
||||
NULL(0,0),
|
||||
ZNI(0x9f, 0x9f),
|
||||
OTE(5292022,1182023), // The date range of mod creation, then the day when this feature was added
|
||||
ITEM_STATS(154301182023L, 0x9f);
|
||||
|
||||
private UUID ID;
|
||||
|
||||
ModIDs(long A, long B)
|
||||
{
|
||||
ID=new UUID(A,B);
|
||||
}
|
||||
|
||||
public UUID get()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
}
|
Reference in a new issue