This commit is contained in:
gigabit101 2016-03-27 19:53:55 +01:00
parent 33c8386324
commit 2360df0148
2 changed files with 29 additions and 2 deletions

View file

@ -1,14 +1,22 @@
package techreborn.blocks.storage; package techreborn.blocks.storage;
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.math.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.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
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.lesu.TileLesu; import techreborn.tiles.lesu.TileLesu;
public class BlockLESU extends BlockMachineBase implements IAdvancedRotationTexture public class BlockLESU extends BlockMachineBase implements IAdvancedRotationTexture
@ -30,14 +38,21 @@ public class BlockLESU extends BlockMachineBase implements IAdvancedRotationText
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
float hitY, float hitZ)
{ {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.lesuID, world, x, y, z); player.openGui(Core.INSTANCE, GuiHandler.lesuID, 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(ModBlocks.LesuStorage));
return items;
}
@Override @Override
public String getFront(boolean isActive) public String getFront(boolean isActive)
{ {

View file

@ -1,7 +1,11 @@
package techreborn.blocks.storage; package techreborn.blocks.storage;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -45,6 +49,14 @@ public class BlockLESUStorage extends BlockMachineBase implements IAdvancedRotat
super.breakBlock(world, x, y, z, block, meta); super.breakBlock(world, x, y, z, block, meta);
} }
@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;
}
@Override @Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{ {