diff --git a/build.properties b/build.properties index 5f1e89a..ce6c341 100644 --- a/build.properties +++ b/build.properties @@ -1,9 +1,9 @@ -#Fri Feb 02 19:58:59 UTC 2024 +#Mon Aug 05 15:03:26 UTC 2024 mapping_channel=parchment forge_version=47.2.0 mod_id=akashictome dir_repo=./ -build_number=25 +build_number=26 dir_output=../Build Output/AkashicTome/ mapping_version=2023.09.03-1.20.1 version=1.7 diff --git a/src/main/java/vazkii/akashictome/MorphingHandler.java b/src/main/java/vazkii/akashictome/MorphingHandler.java index d457c55..9966dca 100644 --- a/src/main/java/vazkii/akashictome/MorphingHandler.java +++ b/src/main/java/vazkii/akashictome/MorphingHandler.java @@ -37,7 +37,7 @@ public final class MorphingHandler { public void onPlayerLeftClick(PlayerInteractEvent.LeftClickEmpty event) { ItemStack stack = event.getItemStack(); if (!stack.isEmpty() && isAkashicTome(stack) && !stack.is(Registries.TOME.get())) { - NetworkHandler.sendToServer(new MessageUnmorphTome()); + NetworkHandler.sendToServer(new MessageUnmorphTome()); //TODO fix } } @@ -69,6 +69,7 @@ public void onItemDropped(ItemTossEvent event) { } copyCmp.remove("display"); + /* Component displayName = null; CompoundTag nameCmp = (CompoundTag) copyCmp.get(TAG_TOME_DISPLAY_NAME); if (nameCmp != null) @@ -76,6 +77,8 @@ public void onItemDropped(ItemTossEvent event) { if (displayName != null && !displayName.getString().isEmpty() && displayName != copy.getHoverName()) copy.setHoverName(displayName); + */ + copyCmp.remove(TAG_MORPHING); copyCmp.remove(TAG_TOME_DISPLAY_NAME); copyCmp.remove(TAG_TOME_DATA); @@ -104,7 +107,7 @@ public static String getModOrAlias(String mod) { return aliases.getOrDefault(mod, mod); } - public static boolean doesStackHaveModAttached(ItemStack stack, String mod) { + public static boolean doesStackHaveModAttached(ItemStack stack, String mod) { //TODO what was this used for? if (!stack.hasTag()) return false; @@ -172,6 +175,7 @@ public static ItemStack makeMorphedStack(ItemStack currentStack, String targetMo else stackCmp.put(TAG_TOME_DISPLAY_NAME, displayName); + MutableComponent rawComp = Component.Serializer.fromJson(displayName.getString("text")); if (rawComp == null) { stackCmp.put(TAG_TOME_DISPLAY_NAME, displayName); diff --git a/src/main/java/vazkii/akashictome/TomeItem.java b/src/main/java/vazkii/akashictome/TomeItem.java index 863111f..1554fc6 100644 --- a/src/main/java/vazkii/akashictome/TomeItem.java +++ b/src/main/java/vazkii/akashictome/TomeItem.java @@ -29,7 +29,7 @@ public class TomeItem extends Item { public TomeItem() { - super(new Properties().stacksTo(1)/*TODO .tab(CreativeModeTab.TAB_TOOLS)*/); + super(new Properties().stacksTo(1)); } @Override @@ -43,7 +43,7 @@ public InteractionResult useOn(UseOnContext context) { if (playerIn.isShiftKeyDown()) { String mod = MorphingHandler.getModFromState(worldIn.getBlockState(pos)); ItemStack newStack = MorphingHandler.getShiftStackForMod(stack, mod); - if (!ItemStack.isSameItemSameTags(newStack, stack)) { //TODO test if sameTags as well + if (!ItemStack.isSameItem(newStack, stack)) { //TODO test if sameTags as well playerIn.setItemInHand(hand, newStack); return InteractionResult.SUCCESS; } @@ -89,7 +89,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level world, List