Update for deprecated method

This commit is contained in:
drcrazy 2017-09-01 02:32:05 +03:00
parent 6a36f79e03
commit ceac5fc282

View file

@ -24,8 +24,11 @@
package techreborn.blocks.generator; package techreborn.blocks.generator;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
@ -37,8 +40,14 @@ import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileDieselGenerator; import techreborn.tiles.generator.TileDieselGenerator;
/**
* Block for Diesel Generator
*/
public class BlockDieselGenerator extends BlockMachineBase { public class BlockDieselGenerator extends BlockMachineBase {
/**
*
*/
public BlockDieselGenerator() { public BlockDieselGenerator() {
super(); super();
this.setCreativeTab(TechRebornCreativeTab.instance); this.setCreativeTab(TechRebornCreativeTab.instance);
@ -46,18 +55,27 @@ public class BlockDieselGenerator extends BlockMachineBase {
} }
@Override @Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { public TileEntity createNewTileEntity(final World world,
final int p_149915_2_) {
return new TileDieselGenerator(); return new TileDieselGenerator();
} }
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world,
final float hitY, final float hitZ) { final BlockPos pos,
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { final IBlockState state,
final EntityPlayer player,
EnumHand hand,
EnumFacing side,
float hitX,
float hitY,
float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true; return true;
} }
if (!player.isSneaking()) if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.DIESEL_GENERATOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.DIESEL_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true; return true;
} }
} }