Update onBlockActivated to use newer method
This commit is contained in:
parent
ceac5fc282
commit
ace5813745
36 changed files with 317 additions and 145 deletions
|
@ -55,21 +55,14 @@ public class BlockDieselGenerator extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(final World world,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final EntityPlayer player,
|
||||
EnumHand hand,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
|
||||
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
|
||||
final float hitX, final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, pos, player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,11 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
|
@ -51,13 +54,14 @@ public class BlockGasTurbine extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@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)) {
|
||||
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
|
||||
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
|
||||
final float hitX, final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, pos, player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.GAS_TURBINE.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.GAS_TURBINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,12 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
import prospector.shootingstar.model.ModelCompound;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
|
@ -38,4 +44,11 @@ public class BlockMagicEnergyAbsorber extends BlockMachineBase {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
|
||||
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
|
||||
// TODO
|
||||
// Remember to remove WIP override and imports once complete
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,12 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
import prospector.shootingstar.model.ModelCompound;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
|
@ -37,4 +43,11 @@ public class BlockMagicEnergyConverter extends BlockMachineBase {
|
|||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
|
||||
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
|
||||
//TODO
|
||||
//Remember to remove WIP override and imports once complete
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,13 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
|
@ -35,4 +41,11 @@ public class BlockPlasmaGenerator extends BlockMachineBase {
|
|||
setUnlocalizedName("techreborn.plasmagenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
|
||||
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
|
||||
// TODO
|
||||
// Remember to remove WIP override and imports once complete
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,11 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
|
@ -51,13 +54,14 @@ public class BlockSemiFluidGenerator extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@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)) {
|
||||
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
|
||||
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
|
||||
final float hitX, final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, pos, player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.SEMIFLUID_GENERATOR.ordinal(), world, x, y, z);
|
||||
player.openGui( Core.INSTANCE, EGui.SEMIFLUID_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
import prospector.shootingstar.model.ModelCompound;
|
||||
|
@ -50,10 +54,11 @@ public class BlockSolidFuelGenerator extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@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) {
|
||||
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
|
||||
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
|
||||
final float hitX, final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,11 @@
|
|||
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
|
@ -51,13 +54,14 @@ public class BlockThermalGenerator extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@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)) {
|
||||
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
|
||||
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
|
||||
final float hitX, final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, pos, player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.THERMAL_GENERATOR.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.THERMAL_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue