I am trying to implement a block with metadata in scala. Here is my code:
There seems to be some problems. At (1), The compiler says that
[pre]Error:(45, 56) inferred type arguments [Any,Int] do not conform to method withProperty's type parameter bounds [T <: Comparable[T],V <: T]
getDefaultState.withProperty(propertyFacing, facing).withProperty(propertyIndex, index)
^[/pre]
At (2), it says [pre]Error:(57, 33) type mismatch;
found : Array[net.minecraft.block.properties.PropertyHelper[_ >: Integer with net.minecraft.util.EnumFacing <: Comparable[_ >: Integer with net.minecraft.util.EnumFacing <: java.io.Serializable] with java.io.Serializable]]
required: net.minecraft.block.properties.IProperty[?0] forSome { type ?0 <: Comparable[?0] }
new BlockStateContainer(this, properties)
^[/pre]
These codes are from MinecraftByExamples and work perfectly fine in Java. What should I change to fix the problem? For (2), I have tried casting the elements to type [pre]IProperty[_ <: Comparable[_]][/pre] and to [pre]IProperty[_][/pre], but that did not solve the problem.
Are there any examples/tutorials of scala modding? Thanks in advance.