mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-30 21:23:00 +00:00 
			
		
		
		
	Better error handling in treasure disks
- Return a more sensible string for empty treasure disks (i.e. those given by /give). This should help identify packs which are giving items in non-supported ways. - Fix NPE when the treasure mount doesn't exist. Fixes #801
This commit is contained in:
		| @@ -68,6 +68,8 @@ public class ItemTreasureDisk extends Item implements IMedia | |||||||
|     public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) |     public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) | ||||||
|     { |     { | ||||||
|         IMount rootTreasure = getTreasureMount(); |         IMount rootTreasure = getTreasureMount(); | ||||||
|  |         if( rootTreasure == null ) return null; | ||||||
|  |  | ||||||
|         String subPath = getSubPath( stack ); |         String subPath = getSubPath( stack ); | ||||||
|         try |         try | ||||||
|         { |         { | ||||||
| @@ -121,7 +123,7 @@ public class ItemTreasureDisk extends Item implements IMedia | |||||||
|     private static String getTitle( @Nonnull ItemStack stack ) |     private static String getTitle( @Nonnull ItemStack stack ) | ||||||
|     { |     { | ||||||
|         CompoundNBT nbt = stack.getTag(); |         CompoundNBT nbt = stack.getTag(); | ||||||
|         return nbt != null && nbt.contains( NBT_TITLE ) ? nbt.getString( NBT_TITLE ) : "'alongtimeago' by dan200"; |         return nbt != null && nbt.contains( NBT_TITLE ) ? nbt.getString( NBT_TITLE ) : "'missingno' by how did you get this anyway?"; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Nonnull |     @Nonnull | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates