Skip to content

Commit

Permalink
lang fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Uraneptus committed Aug 5, 2024
1 parent 736d0a1 commit 6e1a27e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/vazkii/akashictome/MorphingHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -69,13 +69,16 @@ public void onItemDropped(ItemTossEvent event) {
}

copyCmp.remove("display");
/*
Component displayName = null;
CompoundTag nameCmp = (CompoundTag) copyCmp.get(TAG_TOME_DISPLAY_NAME);
if (nameCmp != null)
displayName = Component.literal(nameCmp.getString("text"));
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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vazkii/akashictome/TomeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level world, List<Compone

if (!currMod.equals(mod))
tooltip.add(Component.literal(MorphingHandler.getModNameForId(mod)).setStyle(Style.EMPTY.applyFormats(ChatFormatting.AQUA)));
tooltip.add(Component.literal(" \u2520 " + name));
tooltip.add(Component.literal(" " + name));

currMod = mod;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/akashictome/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"akashictome.sudo_name": "Akashic Tome (%s)",
"akashictome.click_morph": "Shift-right click to change",
"item.akashictome.tome": "Akashic Tome"
"item.akashictome.tome": "Akashic Tome",
"akashictome.misc.shift_for_info": "§7Hold §bSHIFT§7 for more info"
}

0 comments on commit 6e1a27e

Please sign in to comment.