mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	Fix crash when lectern has no item
This should never happen in practice, but might happen when using /setblock or after world corruption, so let's be careful here. Closes #2014
This commit is contained in:
		| @@ -119,7 +119,7 @@ public final class CustomLecternBlockEntity extends BlockEntity implements MenuP | |||||||
|     @Override |     @Override | ||||||
|     public CompoundTag getUpdateTag() { |     public CompoundTag getUpdateTag() { | ||||||
|         var tag = super.getUpdateTag(); |         var tag = super.getUpdateTag(); | ||||||
|         tag.put(NBT_ITEM, item.save(new CompoundTag())); |         if (!item.isEmpty()) tag.put(NBT_ITEM, item.save(new CompoundTag())); | ||||||
|         return tag; |         return tag; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates