1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-06 23:41:21 +01:00

No more legacy data load

This commit is contained in:
Zrips 2021-07-15 11:40:33 +03:00
parent c8936fc653
commit 509ac682ad
4 changed files with 9 additions and 6 deletions

View File

@ -22,9 +22,11 @@ import org.bukkit.inventory.ItemStack;
import com.gamingmesh.jobs.container.ActionType;
import net.Zrips.CMILib.Version.Version;
public class ItemActionInfo extends MaterialActionInfo {
@SuppressWarnings("deprecation")
public ItemActionInfo(ItemStack items, ActionType type) {
super(items.getType(), items.getData().getData(), type);
super(items.getType(), Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : items.getData().getData(), type);
}
}

View File

@ -20,6 +20,7 @@ import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Container.PageInfo;
import net.Zrips.CMILib.Items.CMIItemStack;
import net.Zrips.CMILib.RawMessages.RawMessage;
import net.Zrips.CMILib.Version.Version;
public class editjobs implements Cmd {
@ -338,11 +339,11 @@ public class editjobs implements Cmd {
switch (args[3]) {
case "hand":
ItemStack item = CMIItemStack.getItemInMainHand(player);
key = item.getType().name() + "-" + item.getData().getData();
key = item.getType().name() + "-" + (Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : item.getData().getData());
break;
case "offhand":
item = CMIItemStack.getItemInOffHand(player);
key = item.getType().name() + "-" + item.getData().getData();
key = item.getType().name() + "-" + (Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : item.getData().getData());
break;
case "looking":
case "lookingat":

View File

@ -320,11 +320,11 @@ public class editquests implements Cmd {
switch (args[4]) {
case "hand":
ItemStack item = CMIItemStack.getItemInMainHand(player);
key = item.getType().name() + "-" + item.getData().getData();
key = item.getType().name() + "-" + (Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : item.getData().getData());
break;
case "offhand":
item = CMIItemStack.getItemInOffHand(player);
key = item.getType().name() + "-" + item.getData().getData();
key = item.getType().name() + "-" + (Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : item.getData().getData());
break;
case "looking":
case "lookingat":

View File

@ -40,7 +40,7 @@ public class iteminfo implements Cmd {
EnchantmentTarget.FISHING_ROD.includes(iih))
tool = true;
byte data = iih.getData().getData();
byte data = (Version.isCurrentEqualOrHigher(Version.v1_13_R1) ? 0 : iih.getData().getData());
String dataString = data == 0 ? "" : "-" + data;
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));