Updated raw types in ExtendedBlockState, fixed some ATs, updated some things that needed updating in model classes.

This commit is contained in:
RainWarrior committed 2016-03-02 20:00:32 +03:00
1 parent d44d82e19d
commit cff4bf21ae
12 files changed
+46 -59

No files matched your search

@@ -22,7 +22,7 @@ public class ExtendedBlockState extends BlockStateContainer
{
private final ImmutableSet<IUnlistedProperty<?>> unlistedProperties;
public ExtendedBlockState(Block blockIn, @SuppressWarnings("rawtypes") IProperty[] properties, IUnlistedProperty<?>[] unlistedProperties)
public ExtendedBlockState(Block blockIn, IProperty<?>[] properties, IUnlistedProperty<?>[] unlistedProperties)
{
super(blockIn, properties, buildUnlistedMap(unlistedProperties));
ImmutableSet.Builder<IUnlistedProperty<?>> builder = ImmutableSet.<IUnlistedProperty<?>>builder();
@@ -49,7 +49,7 @@ public class ExtendedBlockState extends BlockStateContainer
}
@Override
protected StateImplementation createState(Block block, @SuppressWarnings("rawtypes") ImmutableMap<IProperty, Comparable> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties)
protected StateImplementation createState(Block block, ImmutableMap<IProperty<?>, Comparable<?>> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties)
{
if (unlistedProperties == null || unlistedProperties.isEmpty()) return super.createState(block, properties, unlistedProperties);
return new ExtendedStateImplementation(block, properties, unlistedProperties, null);
@@ -58,10 +58,9 @@ public class ExtendedBlockState extends BlockStateContainer
protected static class ExtendedStateImplementation extends StateImplementation implements IExtendedBlockState
{
private final ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties;
@SuppressWarnings("rawtypes")
private Map<Map<IProperty, Comparable>, BlockState.StateImplementation> normalMap;
private Map<Map<IProperty<?>, Comparable<?>>, BlockStateContainer.StateImplementation> normalMap;
protected ExtendedStateImplementation(Block block, @SuppressWarnings("rawtypes") ImmutableMap<IProperty, Comparable> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties, @SuppressWarnings("rawtypes") ImmutableTable<IProperty, Comparable, IBlockState> table)
protected ExtendedStateImplementation(Block block, ImmutableMap<IProperty<?>, Comparable<?>> properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties, ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> table)
{
super(block, properties);
this.unlistedProperties = unlistedProperties;
@@ -85,15 +84,13 @@ public class ExtendedBlockState extends BlockStateContainer
{
return this;
}
@SuppressWarnings("rawtypes")
Map<IProperty, Comparable> map = Maps.newHashMap(getProperties());
Map<IProperty<?>, Comparable<?>> map = Maps.newHashMap(getProperties());
map.put(property, value);
if(Iterables.all(unlistedProperties.values(), Predicates.<Optional<?>>equalTo(Optional.absent())))
{ // no dynamic properties present, looking up in the normal table
return (IExtendedBlockState) normalMap.get(map);
}
@SuppressWarnings("rawtypes")
ImmutableTable<IProperty, Comparable, IBlockState> table = propertyValueTable;
ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> table = propertyValueTable;
table = ((StateImplementation)table.get(property, value)).getPropertyValueTable();
return new ExtendedStateImplementation(getBlock(), ImmutableMap.copyOf(map), unlistedProperties, table).setMap(this.normalMap);
}
@@ -138,13 +135,13 @@ public class ExtendedBlockState extends BlockStateContainer
}
@Override
public void buildPropertyValueTable(@SuppressWarnings("rawtypes") Map<Map<IProperty, Comparable>, BlockState.StateImplementation> map)
public void buildPropertyValueTable(Map<Map<IProperty<?>, Comparable<?>>, BlockStateContainer.StateImplementation> map)
{
this.normalMap = map;
super.buildPropertyValueTable(map);
}
private ExtendedStateImplementation setMap(@SuppressWarnings("rawtypes") Map<Map<IProperty, Comparable>, BlockState.StateImplementation> map)
private ExtendedStateImplementation setMap(Map<Map<IProperty<?>, Comparable<?>>, BlockStateContainer.StateImplementation> map)
{
this.normalMap = map;
return this;