Iron furnace and Iron alloy furnace now return when broken

This commit is contained in:
gigabit101 2016-03-06 20:09:30 +00:00
parent 90f5d77a41
commit b99df6f0a8
2 changed files with 31 additions and 4 deletions

View file

@ -1,13 +1,21 @@
package techreborn.blocks; package techreborn.blocks;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.GuiHandler; import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileAlloyFurnace; import techreborn.tiles.TileAlloyFurnace;
import techreborn.tiles.TileIronFurnace; import techreborn.tiles.TileIronFurnace;
@ -30,6 +38,13 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z); player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z);
return true; return true;
} }
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
List<ItemStack> items = new ArrayList<ItemStack>();
items.add(new ItemStack(this));
return items;
}
private final String prefix = "techreborn:blocks/machine/"; private final String prefix = "techreborn:blocks/machine/";

View file

@ -1,8 +1,15 @@
package techreborn.blocks.machine; package techreborn.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
@ -26,13 +33,18 @@ public class BlockAlloyFurnace extends BlockMachineBase implements IRotationText
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, z);
z);
return true; return true;
} }
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
List<ItemStack> items = new ArrayList<ItemStack>();
items.add(new ItemStack(this));
return items;
}
private final String prefix = "techreborn:blocks/machine/"; private final String prefix = "techreborn:blocks/machine/";