Skip to content

Commit

Permalink
Merge branch 'master' into 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Uraneptus authored Aug 7, 2024
2 parents 626be78 + 572385e commit ae8e320
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- Updated several lang files
- Added a bunch of mod books to the default config
- Fix: Removing a book from the Tome changes its title to the raw name
- Fix: Changing book option when looking at a mod's block is using the raw name
11 changes: 1 addition & 10 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()); //TODO fix
NetworkHandler.sendToServer(new MessageUnmorphTome());
}
}

Expand Down Expand Up @@ -69,15 +69,6 @@ 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);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/vazkii/akashictome/client/HUDHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ public void onDrawScreen(RenderGuiOverlayEvent.Post event) {

if (!state.isAir()) {
ItemStack drawStack = ItemStack.EMPTY;
String line1 = "";
MutableComponent line1 = null;
String line2 = "";

String mod = MorphingHandler.getModFromState(state);
ItemStack morphStack = MorphingHandler.getShiftStackForMod(tomeStack, mod);

if (!morphStack.isEmpty() && !ItemStack.isSameItemSameTags(morphStack, tomeStack)) {
drawStack = morphStack;
line1 = NBTUtils.getCompound(morphStack, MorphingHandler.TAG_TOME_DISPLAY_NAME, false).getString("text");
Expand All @@ -70,7 +71,6 @@ public void onDrawScreen(RenderGuiOverlayEvent.Post event) {
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
int sx = res.getGuiScaledWidth() / 2 - 17;
int sy = res.getGuiScaledHeight() / 2 + 2;

guiGraphics.renderItem(drawStack, sx, sy);
guiGraphics.drawString(mc.font, line1Component.withStyle(ChatFormatting.GREEN), sx + 20, sy + 4, 0xFFFFFFFF);
guiGraphics.drawString(mc.font, line2, sx + 25, sy + 14, 0xFFFFFFFF);
Expand Down

0 comments on commit ae8e320

Please sign in to comment.