/*
 * This file is part of TechReborn, licensed under the MIT License (MIT).
 *
 * Copyright (c) 2017 TechReborn
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package techreborn.blocks.generator;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileDieselGenerator;

public class BlockDieselGenerator extends BlockMachineBase {

	public BlockDieselGenerator() {
		super();
		this.setCreativeTab(TechRebornCreativeTab.instance);
		ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
	}

	@Override
	public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
		return new TileDieselGenerator();
	}

	@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,
	                                final float hitY, final float hitZ) {
		if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
			return true;
		}
		if (!player.isSneaking())
			player.openGui(Core.INSTANCE, EGui.DIESEL_GENERATOR.ordinal(), world, x, y, z);
		return true;
	}
}

@@ -1224,16 +1224,62 @@
 rator;%0A%0A
+import net.minecraft.block.state.IBlockState;%0A
 import n
@@ -1363,16 +1363,90 @@
 Entity;%0A
+import net.minecraft.util.EnumFacing;%0Aimport net.minecraft.util.EnumHand;%0A
 import n
@@ -1849,16 +1849,54 @@
 rator;%0A%0A
+/**%0A * Block for Diesel Generator%0A */%0A
 public c
@@ -1949,16 +1949,31 @@
 Base %7B%0A%0A
+%09/**%0A%09 * %0A%09 */%0A
 %09public 
@@ -2221,32 +2221,71 @@
 nal World world,
+%0A%09                                     
  final int p_149
@@ -2400,96 +2400,310 @@
 rld,
- final int x, final int y, final int z, final EntityPlayer player, final int
+%0A%09                                final BlockPos pos,%0A%09                                final IBlockState state,%0A%09                                final EntityPlayer player,%0A%09                                EnumHand hand,%0A%09                                EnumFacing
  side,
- final
+%0A%09                               
  flo
@@ -2744,22 +2744,16 @@
         
-final 
 float hi
@@ -2755,22 +2755,49 @@
 at hitY,
- final
+%0A%09                               
  float h
@@ -2844,29 +2844,11 @@
 ld, 
-new BlockPos(x, y, z)
+pos
 , pl
@@ -2903,16 +2903,18 @@
 aking())
+ %7B
 %0A%09%09%09play
@@ -2983,17 +2983,48 @@
 ld, 
-x, y, z);
+pos.getX(), pos.getY(), pos.getZ());%0A%09%09%7D
 %0A%09%09r

Update for deprecated method