From 4b7d230b58dcd80d62d6ca5d4c95bfc503a85a42 Mon Sep 17 00:00:00 2001 From: IS4 Date: Wed, 13 Nov 2024 14:32:45 +0100 Subject: [PATCH] Fix copying written book and increment generation --- .../contraptions/enchanting/printer/PrintEntries.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrintEntries.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrintEntries.java index b54ee699..26ae44ce 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrintEntries.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrintEntries.java @@ -163,9 +163,12 @@ public Fluid requiredInkType(ItemStack target) { @Override public ItemStack print(ItemStack target, ItemStack material) { var ret = target.copy(); - if(CeiConfigs.SERVER.copyingWrittenBookAlwaysGetOriginalVersion.get()) - target.getOrCreateTag().putInt("generation", 0); - else target.getOrCreateTag().putInt("generation", 1); + if (!CeiConfigs.SERVER.copyingWrittenBookAlwaysGetOriginalVersion.get()) { + var tag = ret.getOrCreateTag(); + int generation = tag.getInt("generation"); + if (generation <= 1) + tag.putInt("generation", generation + 1); + } return ret; }