Eliminate extraneous casts (#327)
This commit is contained in:
parent
06bfd71d07
commit
7e53a8bc73
|
|
@ -350,7 +350,7 @@ public class ModelBakeryHelpers {
|
|||
}
|
||||
|
||||
private static <T extends Comparable<T>> T getValueHelper(Property<T> property, String value) {
|
||||
return property.getValue(value).orElse((T) null);
|
||||
return property.getValue(value).orElse(null);
|
||||
}
|
||||
|
||||
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@ public class RegistryStorage {
|
|||
|
||||
public static <T> BiMap<ResourceKey<T>, DirectStorageRegistryObject> createKeyStorage(ResourceKey<? extends Registry<T>> registryKey, BiMap<ResourceLocation, DirectStorageRegistryObject> storage) {
|
||||
if(storage instanceof DirectStorageBiMap) {
|
||||
DirectStorageBiMap<ResourceLocation, DirectStorageRegistryObject> directStorageBiMap = (DirectStorageBiMap<ResourceLocation, DirectStorageRegistryObject>)storage;
|
||||
// silently ignore put/putAll calls on this map
|
||||
return new TransformingBiMap<ResourceLocation, DirectStorageRegistryObject, ResourceKey<T>, DirectStorageRegistryObject>(directStorageBiMap, loc -> ResourceKey.create(registryKey, loc), ResourceKey::location, Function.identity(), Function.identity()) {
|
||||
return new TransformingBiMap<ResourceLocation, DirectStorageRegistryObject, ResourceKey<T>, DirectStorageRegistryObject>(storage, loc -> ResourceKey.create(registryKey, loc), ResourceKey::location, Function.identity(), Function.identity()) {
|
||||
@Override
|
||||
public DirectStorageRegistryObject put(ResourceKey<T> key, DirectStorageRegistryObject value) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user