Fixes #590 and fixes build

This commit is contained in:
modmuss50 2016-05-21 20:05:13 +01:00
parent 1efa303bad
commit dbaed2721e
5 changed files with 13 additions and 1 deletions

View file

@ -217,6 +217,9 @@ public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvi
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
if(meta > ores.length){
meta = 0;
}
return getBlockState().getBaseState().withProperty(VARIANTS, oreNamesList.get(meta)); return getBlockState().getBaseState().withProperty(VARIANTS, oreNamesList.get(meta));
} }

View file

@ -138,6 +138,9 @@ public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProv
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
if(meta > ores.length){
meta = 0;
}
return getBlockState().getBaseState().withProperty(VARIANTS, oreNamesList.get(meta)); return getBlockState().getBaseState().withProperty(VARIANTS, oreNamesList.get(meta));
} }

View file

@ -25,7 +25,7 @@ public class BlockRubberSapling extends BlockSapling
setUnlocalizedName("techreborn.rubbersapling"); setUnlocalizedName("techreborn.rubbersapling");
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
this.setDefaultState(this.getDefaultState().withProperty(STAGE, 0)); this.setDefaultState(this.getDefaultState().withProperty(STAGE, 0));
setSoundType(SoundType.PLANT) setSoundType(SoundType.PLANT);
} }
@Override @Override

View file

@ -88,6 +88,9 @@ public class BlockStorage extends BaseBlock implements ITexturedBlock
@Override @Override
public IBlockState getStateFromMeta(int meta) public IBlockState getStateFromMeta(int meta)
{ {
if(meta > types.length){
meta = 0;
}
return this.getDefaultState().withProperty(METADATA, meta); return this.getDefaultState().withProperty(METADATA, meta);
} }

View file

@ -85,6 +85,9 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock
@Override @Override
public IBlockState getStateFromMeta(int meta) public IBlockState getStateFromMeta(int meta)
{ {
if(meta > types.length){
meta = 0;
}
return this.getDefaultState().withProperty(METADATA, meta); return this.getDefaultState().withProperty(METADATA, meta);
} }