mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Clean up null issues, add more annotations (#3590)
This commit is contained in:
1 parent
43efa3cfc4
commit
c545b8ecd4
130 files changed
+629
-262
No files matched your search
@@ -37,6 +37,9 @@ import com.google.common.collect.ImmutableTable;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ExtendedBlockState extends BlockStateContainer
|
||||
{
|
||||
private final ImmutableSet<IUnlistedProperty<?>> unlistedProperties;
|
||||
@@ -68,7 +71,8 @@ public class ExtendedBlockState extends BlockStateContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
protected StateImplementation createState(Block block, ImmutableMap<IProperty<?>, Comparable<?>> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties)
|
||||
@Nonnull
|
||||
protected StateImplementation createState(@Nonnull Block block, @Nonnull ImmutableMap<IProperty<?>, Comparable<?>> properties, @Nullable ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties)
|
||||
{
|
||||
if (unlistedProperties == null || unlistedProperties.isEmpty()) return super.createState(block, properties, unlistedProperties);
|
||||
return new ExtendedStateImplementation(block, properties, unlistedProperties, null);
|
||||
@@ -79,7 +83,7 @@ public class ExtendedBlockState extends BlockStateContainer
|
||||
private final ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties;
|
||||
private Map<Map<IProperty<?>, Comparable<?>>, BlockStateContainer.StateImplementation> normalMap;
|
||||
|
||||
protected ExtendedStateImplementation(Block block, ImmutableMap<IProperty<?>, Comparable<?>> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties, ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> table)
|
||||
protected ExtendedStateImplementation(Block block, ImmutableMap<IProperty<?>, Comparable<?>> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties, @Nullable ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> table)
|
||||
{
|
||||
super(block, properties);
|
||||
this.unlistedProperties = unlistedProperties;
|
||||
@@ -87,7 +91,8 @@ public class ExtendedBlockState extends BlockStateContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Comparable<T>, V extends T> IBlockState withProperty(IProperty<T> property, V value)
|
||||
@Nonnull
|
||||
public <T extends Comparable<T>, V extends T> IBlockState withProperty(@Nonnull IProperty<T> property, @Nonnull V value)
|
||||
{
|
||||
if (!this.getProperties().containsKey(property))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user