29 lines
		
	
	
	
		
			1.3 KiB
			
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			1.3 KiB
			
		
	
	
	
		
			Diff
		
	
	
	
	
	
| --- a/net/minecraft/resources/ResourceKey.java
 | |
| +++ b/net/minecraft/resources/ResourceKey.java
 | |
| @@ -9,7 +9,7 @@
 | |
|  
 | |
|  public class ResourceKey<T> {
 | |
|  
 | |
| -    private static final Map<String, ResourceKey<?>> VALUES = Collections.synchronizedMap(Maps.newIdentityHashMap());
 | |
| +    private static final Map<String, ResourceKey<?>> VALUES = Collections.synchronizedMap(Maps.newHashMap()); // CraftBukkit - SPIGOT-6973: remove costly intern
 | |
|      private final MinecraftKey registryName;
 | |
|      private final MinecraftKey location;
 | |
|  
 | |
| @@ -28,7 +28,7 @@
 | |
|      }
 | |
|  
 | |
|      private static <T> ResourceKey<T> create(MinecraftKey minecraftkey, MinecraftKey minecraftkey1) {
 | |
| -        String s = (minecraftkey + ":" + minecraftkey1).intern();
 | |
| +        String s = (minecraftkey + ":" + minecraftkey1); // CraftBukkit - SPIGOT-6973: remove costly intern
 | |
|  
 | |
|          return (ResourceKey) ResourceKey.VALUES.computeIfAbsent(s, (s1) -> {
 | |
|              return new ResourceKey<>(minecraftkey, minecraftkey1);
 | |
| @@ -49,7 +49,7 @@
 | |
|      }
 | |
|  
 | |
|      public <E> Optional<ResourceKey<E>> cast(ResourceKey<? extends IRegistry<E>> resourcekey) {
 | |
| -        return this.isFor(resourcekey) ? Optional.of(this) : Optional.empty();
 | |
| +        return this.isFor(resourcekey) ? (Optional) Optional.of(this) : Optional.empty(); // CraftBukkit - decompile error
 | |
|      }
 | |
|  
 | |
|      public MinecraftKey location() {
 | 
