Skip to content

Commit

Permalink
Fix up some generics
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 1, 2016
1 parent 09058e6 commit e328399
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.properties
@@ -1,6 +1,6 @@
mod_version=1.1.0
minecraft_version=1.10.2
forge_version=12.18.1.2011
forge_version=12.18.1.2084
mappings=snapshot_20160701

jei_version=3.7.+
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/slimeknights/mantle/block/EnumBlockSlab.java
Expand Up @@ -96,7 +96,7 @@ protected E fromMeta(int meta) {

@Nonnull
@Override
public IProperty<?> getVariantProperty() {
public IProperty<E> getVariantProperty() {
return prop;
}

Expand Down
11 changes: 7 additions & 4 deletions src/main/java/slimeknights/mantle/item/ItemBlockSlab.java
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.SoundType;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -11,6 +12,7 @@
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
Expand All @@ -25,13 +27,14 @@

import javax.annotation.Nonnull;

import slimeknights.mantle.block.EnumBlock;
import slimeknights.mantle.block.EnumBlockSlab;

public class ItemBlockSlab extends ItemBlockMeta {
public class ItemBlockSlab<T extends Enum<T> &EnumBlock.IEnumMeta & IStringSerializable> extends ItemBlockMeta {

public EnumBlockSlab<?> slab;
public EnumBlockSlab<T> slab;

public ItemBlockSlab(EnumBlockSlab<?> block) {
public ItemBlockSlab(EnumBlockSlab<T> block) {
super(block);
this.slab = block;
}
Expand Down Expand Up @@ -122,7 +125,7 @@ public void registerItemModels() {
final Item item = this;
final ResourceLocation loc = GameData.getBlockRegistry().getNameForObject(block);

for(Comparable<?> o : (Collection<Comparable<?>>) mappingProperty.getAllowedValues()) {
for(T o : (Collection<T>) mappingProperty.getAllowedValues()) {
int meta = block.getMetaFromState(block.getDefaultState().withProperty(mappingProperty, o));
String name = mappingProperty.getName(o);

Expand Down

0 comments on commit e328399

Please sign in to comment.