mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-27 23:46:10 +00:00
Refactor hand chiseling to display variations with the resulting NBT data
Also fix an output duplication bug whe chiseling via keyboard 1-9 or Q
This commit is contained in:
1 parent
c7c478684d
commit
c0a68ee410
2 files changed
+29
-18
No files matched your search
@@ -146,7 +146,16 @@ public class InventoryChiselSelection implements IInventory {
|
||||
list.get(activeVariations + currentScroll)
|
||||
.getItem()))
|
||||
!= null) {
|
||||
inventory[activeVariations] = list.get(activeVariations + currentScroll);
|
||||
ItemStack variationTemplate = list.get(activeVariations + currentScroll);
|
||||
|
||||
// Preserve the original's NBT tags
|
||||
if (chiseledItem.hasTagCompound()) {
|
||||
variationTemplate = variationTemplate.copy();
|
||||
// We can defer the deep copy the NBT object until the player actually chisels the item
|
||||
variationTemplate.setTagCompound(chiseledItem.getTagCompound());
|
||||
}
|
||||
|
||||
inventory[activeVariations] = variationTemplate;
|
||||
activeVariations++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user