Posted January 3, 201510 yr How would i check if a certain block is in directly front of a Tile Entity? My Tile Entity is a generator and has a specific front? How would I go about checking if a block is in that direction? Here's my code for looking for this block currently http://pastebin.com/hvDQhXK2 I want to make it so that machine[?] is only equal to that block if its not in front of the generator as I don't want to output power to it, if it is! Currently making a voxel game.
January 4, 201510 yr public EnumFacing getNearbyMachine(World world, BlockPos pos) { for (EnumFacing facing : EnumFacing.values) { TileEntity te = world.getTileEntity(pos.offset(facing, 1)); if (te instanceof IEnergyAccepter) return facing; } return null; }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.