Smelting recipes for trap blocks

This commit is contained in:
Emmanuel BENOîT 2016-07-12 22:50:12 +02:00
parent 9f49d862aa
commit 0b9a74c738
3 changed files with 33 additions and 2 deletions

View file

@ -2,6 +2,7 @@ package mmm.materials.traps;
import mmm.core.CRegistry; import mmm.core.CRegistry;
import mmm.core.api.I_RecipeRegistrar;
import mmm.core.api.blocks.I_TrapBlock; import mmm.core.api.blocks.I_TrapBlock;
import mmm.utils.UMaths; import mmm.utils.UMaths;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -11,15 +12,17 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class MMud public class MMud
extends Block extends Block
implements I_TrapBlock implements I_TrapBlock , I_RecipeRegistrar
{ {
private static final AxisAlignedBB MUD_AABB = UMaths.makeBlockAABB( 0 , 0 , 0 , 16 , 15 , 16 ); private static final AxisAlignedBB MUD_AABB = UMaths.makeBlockAABB( 0 , 0 , 0 , 16 , 15 , 16 );
@ -67,4 +70,11 @@ public class MMud
entityIn.motionZ *= .1; entityIn.motionZ *= .1;
} }
@Override
public void registerRecipes( )
{
GameRegistry.addSmelting( this , new ItemStack( Blocks.DIRT ) , .01f );
}
} }

View file

@ -2,6 +2,7 @@ package mmm.materials.traps;
import mmm.core.CRegistry; import mmm.core.CRegistry;
import mmm.core.api.I_RecipeRegistrar;
import mmm.core.api.blocks.I_TrapBlock; import mmm.core.api.blocks.I_TrapBlock;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling; import net.minecraft.block.BlockFalling;
@ -11,18 +12,20 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.IPlantable;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class MQuicksand public class MQuicksand
extends BlockFalling extends BlockFalling
implements I_TrapBlock implements I_TrapBlock , I_RecipeRegistrar
{ {
public final IBlockState forType; public final IBlockState forType;
@ -98,4 +101,12 @@ public class MQuicksand
} }
} }
@Override
public void registerRecipes( )
{
final Block block = this.forType.getBlock( );
GameRegistry.addSmelting( this , new ItemStack( block , 1 , block.getMetaFromState( this.forType ) ) , .01f );
}
} }

View file

@ -3,6 +3,7 @@ package mmm.materials.traps;
import mmm.core.api.blocks.I_TintedBlock; import mmm.core.api.blocks.I_TintedBlock;
import mmm.core.api.items.I_TintedItem; import mmm.core.api.items.I_TintedItem;
import net.minecraft.block.BlockDirt;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.IItemColor;
@ -14,6 +15,7 @@ import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.biome.BiomeColorHelper; import net.minecraft.world.biome.BiomeColorHelper;
import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.IPlantable;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -85,4 +87,12 @@ public class MSwampPit
}; };
} }
@Override
public void registerRecipes( )
{
GameRegistry.addSmelting( this ,
new ItemStack( Blocks.DIRT , 1 , BlockDirt.DirtType.COARSE_DIRT.getMetadata( ) ) , .01f );
}
} }