Update onBlockActivated to use newer method
This commit is contained in:
parent
ceac5fc282
commit
ace5813745
36 changed files with 317 additions and 145 deletions
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
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 BlockAssemblingMachine 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.ASSEMBLING_MACHINE.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
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 BlockChargeOMat 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.CHARGEBENCH.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
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 BlockChemicalReactor 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.CHEMICAL_REACTOR.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
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 BlockChunkLoader 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.CHUNK_LOADER.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
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 BlockMatterFabricator 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.MATTER_FABRICATOR.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
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 BlockRollingMachine 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.ROLLING_MACHINE.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,10 +24,14 @@
|
|||
|
||||
package techreborn.blocks.machine;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
|
@ -55,10 +59,11 @@ public class BlockScrapboxinator 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.SCRAPBOXINATOR.ordinal(), world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -66,7 +71,7 @@ public class BlockScrapboxinator extends BlockMachineBase {
|
|||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
|
||||
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
|
||||
//TODO Finish Scrapboxinator and add recipe
|
||||
//Remember to remove WIP override and imports once complete
|
||||
// TODO Finish Scrapboxinator and add recipe
|
||||
// Remember to remove WIP override and imports once complete
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,15 +54,9 @@ public class BlockVacuumFreezer extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
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) {
|
||||
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.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue